Fixes exploit allowing players to open Bag of Holding rifts in the Heretic dimension (#85330)

## About The Pull Request

This PR prevents players from opening a BoH tear in the Heretic
dimension areas. It also introduces a new area flag, "NO_BOH", which can
be added to areas to replicate this behavior.

## Why It's Good For The Game

This prevents the (very unlikely) edge case that someone manages to open
a BoH tear in one of the funny hand rooms, which is bad not only because
it fucks over anyone else who gets sacrificed, but could also interfere
with other things on that z-level (shuttles, other Lazy Template areas,
etc).

Messing with some new code here, so if there's better ways to handle
this, by all means, chime in. This is a much more elegant method than
just banning anything but the station.
## Changelog
🆑 Vekter
fix: Fixes an exploit that allowed players to open a Bag of Holding rift
in the Heretic dimension.
/🆑

---------

Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
This commit is contained in:
Vekter
2024-07-28 21:26:34 -06:00
committed by GitHub
co-authored by Kapu1178
parent 7135acc443
commit 5b23db8a2c
4 changed files with 6 additions and 1 deletions
+2
View File
@@ -136,6 +136,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define VIRTUAL_SAFE_AREA (1<<16)
/// This area does not allow the Binary channel
#define BINARY_JAMMING (1<<17)
/// This area prevents Bag of Holding rifts from being opened.
#define NO_BOH (1<<18)
/*
These defines are used specifically with the atom/pass_flags bitmask
+1
View File
@@ -64,6 +64,7 @@ DEFINE_BITFIELD(area_flags, list(
"UNIQUE_AREA" = UNIQUE_AREA,
"VALID_TERRITORY" = VALID_TERRITORY,
"XENOBIOLOGY_COMPATIBLE" = XENOBIOLOGY_COMPATIBLE,
"NO_BOH" = NO_BOH,
))
DEFINE_BITFIELD(turf_flags, list(
@@ -16,6 +16,7 @@
return ..()
/datum/storage/bag_of_holding/proc/recursive_insertion(obj/item/to_insert, mob/living/user)
var/area/bag_area = get_area(user)
var/safety = tgui_alert(user, "Doing this will have extremely dire consequences for the station and its crew. Be sure you know what you're doing.", "Put in [to_insert.name]?", list("Proceed", "Abort"))
if(safety != "Proceed" \
|| QDELETED(to_insert) \
@@ -24,6 +25,7 @@
|| QDELETED(user) \
|| !user.can_perform_action(parent, NEED_DEXTERITY) \
|| !can_insert(to_insert, user) \
|| (bag_area.area_flags & NO_BOH) \
)
return
@@ -87,7 +87,7 @@ GLOBAL_LIST_EMPTY(heretic_sacrifice_landmarks)
has_gravity = STANDARD_GRAVITY
ambience_index = AMBIENCE_SPOOKY
sound_environment = SOUND_ENVIRONMENT_CAVE
area_flags = UNIQUE_AREA | NOTELEPORT | HIDDEN_AREA | BLOCK_SUICIDE
area_flags = UNIQUE_AREA | NOTELEPORT | HIDDEN_AREA | BLOCK_SUICIDE | NO_BOH
/area/centcom/heretic_sacrifice/Initialize(mapload)
if(!ambientsounds)