Skip to content

Commit

Permalink
Fixdatfucckenzas
Browse files Browse the repository at this point in the history
  • Loading branch information
Filatelele authored Sep 20, 2024
1 parent c22b13b commit 0b41fc7
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
12 changes: 10 additions & 2 deletions code/__defines/ZAS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ GLOBAL_LIST_INIT(csrfz_check, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, N
} \
else if (B.z != A.z) { \
if (B.z < A.z) { \
ret = A.z_flags ? ZONE_BLOCKED : BLOCKED; \
if (!istype(A, /turf/simulated/open)) { \
ret = BLOCKED; \
} else { \
ret = ZONE_BLOCKED; \
} \
} \
else { \
ret = B.z_flags ? ZONE_BLOCKED : BLOCKED; \
if (!istype(B, /turf/simulated/open)) { \
ret = BLOCKED; \
} else { \
ret = ZONE_BLOCKED; \
} \
} \
} \
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
Expand Down
5 changes: 2 additions & 3 deletions code/game/machinery/atmoalter/sauna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
var/turf/simulated/T = get_turf(src)
var/list/turfs = T?.zone?.contents
for(var/turf/turf in turfs)
turf.vis_contents.Remove(overlay)
turf.update_graphic()

QDEL_NULL(overlay)

Expand Down Expand Up @@ -363,8 +363,7 @@
var/turf/simulated/T = get_turf(src)
var/list/turfs = T?.zone?.contents
for(var/turf/simulated/floor/turf in turfs)
if(!LAZYISIN(turf.vis_contents, overlay))
turf.vis_contents.Add(overlay)
LAZYDISTINCTADD(turf.vis_contents, overlay)

if(!reagents.reagent_list.len)
continue
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/simulated/floor_icon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var/list/flooring_cache = list()
if(!isnull(burnt) && (flooring.flags & TURF_CAN_BURN))
AddOverlays(get_damage_overlay("burned[burnt]"))

update_graphic(zone?.air?.graphic)
update_graphic()

if(update_neighbors)
for(var/turf/simulated/floor/F in orange(src, 1))
Expand Down
3 changes: 1 addition & 2 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
var/is_outside = OUTSIDE_AREA
var/last_outside_check = OUTSIDE_UNCERTAIN

var/z_flags = FALSE

/datum/rad_resist/turf
alpha_particle_resist = 38 MEGA ELECTRONVOLT
beta_particle_resist = 50 KILO ELECTRONVOLT
Expand All @@ -96,6 +94,7 @@

RecalculateOpacity()
update_astar_node()
update_graphic()

/turf/Destroy()
if(!changing_turf)
Expand Down
20 changes: 15 additions & 5 deletions code/modules/ZAS/Turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,18 @@ var/global/obj/effect/zasdbg/mark/zasdbgovl_mark = new
air.copy_from(zone.air)
air.group_multiplier = 1

/turf/proc/update_graphic(list/graphic_add = null, list/graphic_remove = null)
if(graphic_add && graphic_add.len)
vis_contents += graphic_add
if(graphic_remove && graphic_remove.len)
vis_contents -= graphic_remove
/turf/proc/update_graphic()
var/air_graphic = get_air_graphic()
if(LAZYLEN(air_graphic))
vis_contents = air_graphic
else
vis_contents = null

/turf/proc/get_air_graphic()
if(zone && !zone.invalid)
return zone.air?.graphic
if(external_atmosphere_participation && is_outside())
var/datum/gas_mixture/external = get_external_air()
return external.graphic
var/datum/gas_mixture/environment = return_air()
return environment?.graphic
10 changes: 5 additions & 5 deletions code/modules/ZAS/Zone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Class Procs:
fuel_objs += fuel
fire_tiles.Add(T)
SSair.active_fire_zones |= src
T.update_graphic(air.graphic)
T.update_graphic()

/zone/proc/remove(turf/T)
#ifdef ZASDBG
Expand All @@ -95,7 +95,7 @@ Class Procs:
var/obj/effect/decal/cleanable/liquid_fuel/fuel = locate() in T
fuel_objs -= fuel
T.zone = null
T.update_graphic(air.graphic)
T.update_graphic()
if(contents.len)
air.group_multiplier = contents.len
else
Expand All @@ -114,7 +114,7 @@ Class Procs:
continue

into.add(T)
T.update_graphic(air.graphic)
T.update_graphic()
#ifdef ZASDBG
T.dbg(zasdbgovl_merged)
#endif
Expand All @@ -141,7 +141,7 @@ Class Procs:

c_invalidate()
for(var/turf/T as anything in contents)
T.update_graphic(air.graphic)
T.update_graphic()
T.needs_air_update = 0 //Reset the marker so that it will be added to the list.
SSair.mark_for_update(T)
CHECK_TICK
Expand All @@ -165,7 +165,7 @@ Class Procs:
// Update gas overlays.
if(air.check_tile_graphic(graphic_add, graphic_remove))
for(var/turf/T as anything in contents)
T.update_graphic(air.graphic)
T.update_graphic()
CHECK_TICK
graphic_add.len = 0
graphic_remove.len = 0
Expand Down
12 changes: 11 additions & 1 deletion code/modules/multiz/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,24 @@
var/turf/below = GetBelow(src)
if(below)
var/below_is_open = isopenspace(below)
vis_contents += below
update_graphic()

if(!below_is_open)
AddOverlays(GLOB.over_OS_darkness)

return 0
return PROCESS_KILL

/turf/simulated/open/update_graphic()
var/air_graphic = get_air_graphic()
if(LAZYLEN(air_graphic))
vis_contents = air_graphic
else
vis_contents = null

var/turf/below = GetBelow(src)
if(below)
vis_contents += below

/turf/simulated/open/attackby(obj/item/C, mob/user)
if (istype(C, /obj/item/stack/rods))
Expand Down

0 comments on commit 0b41fc7

Please sign in to comment.