Skip to content

Commit

Permalink
Makes grid check area protection actually work (tgstation#80863)
Browse files Browse the repository at this point in the history
## About The Pull Request
Okay so turns out, the only thing stopping the exterior sm chamber from
being shut down by a grid check are the filters being marked as
critical. There's SUPPOSED to be an area based check, but that wasn't
being set up properly, so it only protected a single area, no subtypes.

Beyond fixing the very rare case that the sm room becomes vulnerable
when the filters are removed/replaced, the atmos engine and ai sat foyer
are also now protected. AI upload is NOT protected.

Also, I don't believe it has any impact now that the area check is
working, but I've made sure that the canister filters are also marked as
critical- They were already on all but northstar and birdshot.

Fixes tgstation#80852
## Why It's Good For The Game
fix bug, throw insect into sm
## Changelog
:cl:
fix: Certain areas are now properly protected against grid check. Namely
the supermatter should consistently be protected.
/:cl:
  • Loading branch information
FlufflesTheDog authored Jan 9, 2024
1 parent 57f2251 commit 400b10f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -25274,7 +25274,7 @@
dir = 9
},
/obj/structure/cable,
/obj/machinery/atmospherics/components/trinary/filter,
/obj/machinery/atmospherics/components/trinary/filter/critical,
/turf/open/floor/iron/smooth,
/area/station/engineering/supermatter/room)
"jeg" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/NorthStar/north_star.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -75505,7 +75505,7 @@
/turf/open/floor/pod/dark,
/area/station/maintenance/floor3/port)
"tLH" = (
/obj/machinery/atmospherics/components/trinary/filter{
/obj/machinery/atmospherics/components/trinary/filter/critical{
dir = 4
},
/obj/machinery/status_display/evac/directional/north,
Expand Down
10 changes: 6 additions & 4 deletions code/__HELPERS/areas.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#define BP_MAX_ROOM_SIZE 300

GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(/area/station/engineering/main, \
/area/station/engineering/supermatter, \
/area/station/engineering/atmospherics_engine, \
/area/station/ai_monitored/turret_protected/ai))
GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(list(
/area/station/engineering/main,
/area/station/engineering/supermatter,
/area/station/engineering/atmospherics_engine,
/area/station/ai_monitored/turret_protected/ai,
)))

// Gets an atmos isolated contained space
// Returns an associative list of turf|dirs pairs
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
if(!current_apc.cell || !SSmapping.level_trait(current_apc.z, ZTRAIT_STATION))
continue
var/area/apc_area = current_apc.area
if(GLOB.typecache_powerfailure_safe_areas[apc_area.type])
if(is_type_in_typecache(apc_area, GLOB.typecache_powerfailure_safe_areas))
continue

var/duration = rand(duration_min,duration_max)
Expand Down

0 comments on commit 400b10f

Please sign in to comment.