Skip to content

Commit

Permalink
global variable, Flags section
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 26, 2023
1 parent 79d02aa commit 86009e2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
#define MODE_DISPOSABLE_MOBS (1<<10) // Toggles if mobs fit in disposals or not. Off by default.
#define MODE_BYPASS_JOE (1<<11) // Toggles if ghosts can bypass Working Joe spawn limitations, does NOT bypass WL requirement. Off by default.
#define MODE_NO_JOIN_AS_XENO (1<<12) // Toggles if players can join as xeno
#define MODE_BYPASS_VEHICLE_BLOCKERS (1<<13) /// Toggles if vehicles can bypass mapped vehicle blockers. Off by default.

#define ROUNDSTATUS_FOG_DOWN 1
#define ROUNDSTATUS_PODDOORS_OPEN 2
Expand Down
9 changes: 7 additions & 2 deletions code/game/objects/structures/blocker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@
if(!visible)
invisibility = 101

GLOBAL_VAR_INIT(vehicle_blockers, TRUE)

/obj/structure/blocker/forcefield/vehicles
types = list(/obj/vehicle/)


/obj/structure/blocker/forcefield/vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle)
if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS)
if(!GLOB.vehicle_blockers)
return TRUE
if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS)
return TRUE
return FALSE

Expand All @@ -116,7 +119,9 @@


/obj/structure/blocker/forcefield/multitile_vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle)
if(MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) || multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS)
if(!GLOB.vehicle_blockers)
return TRUE
if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS)
return TRUE
return FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// For PvE CM we start without the ability for people to join as xenos. This can be toggled by game masters.
/client/proc/toggle_join_xeno()
set name = "Toggle Player Xeno Joins"
set category = "Game Master.Extras"
set category = "Game Master.Flags"

if(!admin_holder || !check_rights(R_MOD, FALSE))
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
/// For PvE CM a convenient button to enable/disable the invisible vehicle blockers.
/client/proc/toggle_vehicle_blockers()
set name = "Toggle Vehicle Blockers"
set category = "Game Master.Extras"
set category = "Game Master.Flags"

if(!admin_holder || !check_rights(R_MOD, FALSE))
return

if(!SSticker.mode)
to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!"))
return

SSticker.mode.toggleable_flags ^= MODE_BYPASS_VEHICLE_BLOCKERS
message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_VEHICLE_BLOCKERS) ? "allowed vehicles to bypass" : "prevented vehicles from bypassing"] vehicle blockers.")
GLOB.vehicle_blockers = !GLOB.vehicle_blockers
message_admins("[src] has [GLOB.vehicle_blockers ? "enabled" : "disabled"] vehicle blockers.")

0 comments on commit 86009e2

Please sign in to comment.