Merge pull request #21800 from Shadowlight213/changeturffix

Fixes lavaland cave generation creating airless turfs.
This commit is contained in:
oranges
2016-11-29 17:08:09 +13:00
committed by GitHub
6 changed files with 13 additions and 12 deletions

View File

@@ -24,6 +24,7 @@
icon = 'icons/turf/floors.dmi'
icon_state = "necro1"
baseturf = /turf/open/indestructible/necropolis
initial_gas_mix = "o2=14;n2=23;TEMP=300"
/turf/open/indestructible/necropolis/New()
..()

View File

@@ -230,7 +230,7 @@
if(istype(tunnel))
// Small chance to have forks in our tunnel; otherwise dig our tunnel.
if(i > 3 && prob(20))
var/turf/open/floor/plating/asteroid/airless/cave/C = tunnel.ChangeTurf(data_having_type)
var/turf/open/floor/plating/asteroid/airless/cave/C = tunnel.ChangeTurf(data_having_type,FALSE,TRUE)
C.going_backwards = FALSE
C.produce_tunnel_from_data(rand(10, 15), dir)
else
@@ -256,7 +256,7 @@
SpawnFlora(T)
SpawnMonster(T)
T.ChangeTurf(turf_type)
T.ChangeTurf(turf_type,FALSE,TRUE)
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnMonster(turf/T)
if(prob(30))

View File

@@ -145,7 +145,7 @@
if (prob(mineralChance))
var/path = pickweight(mineralSpawnChanceList)
var/turf/T = ChangeTurf(path)
var/turf/T = ChangeTurf(path,FALSE,TRUE)
if(T && ismineralturf(T))
var/turf/closed/mineral/M = T

View File

@@ -20,7 +20,7 @@
continue
W.connected = 1
var/turf/cur_turf = get_turf(W)
cur_turf.ChangeTurf(turf_type)
cur_turf.ChangeTurf(turf_type,FALSE,TRUE)
var/turf/target_turf = get_turf(pick(river_nodes - W))
if(!target_turf)
break
@@ -49,7 +49,7 @@
cur_turf = get_step(cur_turf, cur_dir)
continue
else
var/turf/river_turf = cur_turf.ChangeTurf(turf_type)
var/turf/river_turf = cur_turf.ChangeTurf(turf_type,FALSE,TRUE)
river_turf.Spread(25, 11, whitelist_area)
for(var/WP in river_nodes)
@@ -85,16 +85,16 @@
for(var/F in cardinal_turfs) //cardinal turfs are always changed but don't always spread
var/turf/T = F
if(!istype(T, logged_turf_type) && T.ChangeTurf(type) && prob(probability))
if(!istype(T, logged_turf_type) && T.ChangeTurf(type,FALSE,TRUE) && prob(probability))
T.Spread(probability - prob_loss, prob_loss, whitelisted_area)
for(var/F in diagonal_turfs) //diagonal turfs only sometimes change, but will always spread if changed
var/turf/T = F
if(!istype(T, logged_turf_type) && prob(probability) && T.ChangeTurf(type))
if(!istype(T, logged_turf_type) && prob(probability) && T.ChangeTurf(type,FALSE,TRUE))
T.Spread(probability - prob_loss, prob_loss, whitelisted_area)
else if(ismineralturf(T))
var/turf/closed/mineral/M = T
M.ChangeTurf(M.turf_type)
M.ChangeTurf(M.turf_type,FALSE,TRUE)
#undef RANDOM_UPPER_X

View File

@@ -136,7 +136,7 @@
qdel(L)
//Creates a new turf
/turf/proc/ChangeTurf(path, defer_change = FALSE)
/turf/proc/ChangeTurf(path, defer_change = FALSE,ignore_air = FALSE)
if(!path)
return
if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed
@@ -147,11 +147,11 @@
var/turf/W = new path(src)
if(!defer_change)
W.AfterChange()
W.AfterChange(ignore_air)
W.blueprint_data = old_blueprint_data
return W
/turf/proc/AfterChange() //called after a turf has been replaced in ChangeTurf()
/turf/proc/AfterChange(ignore_air = FALSE) //called after a turf has been replaced in ChangeTurf()
levelupdate()
CalculateAdjacentTurfs()

View File

@@ -996,7 +996,7 @@
for(var/F in RANGE_TURFS(1, src))
if(ismineralturf(F))
var/turf/closed/mineral/M = F
M.ChangeTurf(M.turf_type)
M.ChangeTurf(M.turf_type,FALSE,TRUE)
gps = new /obj/item/device/gps/internal(src)
/mob/living/simple_animal/hostile/spawner/lavaland/Destroy()