Skip to content

Commit

Permalink
CTF machines are only added to processing when CTF starts (#3360)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
small optimization to reduce the size of SSmachines processing
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
code: ctf machines now only process while ctf is running
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
FalloutFalcon authored Sep 18, 2024
1 parent bfbe7eb commit 8b2faaf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
/turf/open/floor/plating,
/area/ctf)
"agI" = (
/obj/machinery/power/emitter/energycannon{
/obj/machinery/power/emitter/energycannon/ctf{
active = 0
},
/turf/open/floor/plating,
Expand All @@ -163,7 +163,7 @@
/turf/open/floor/plating,
/area/ctf)
"aha" = (
/obj/machinery/power/emitter/energycannon{
/obj/machinery/power/emitter/energycannon/ctf{
active = 0;
dir = 1
},
Expand Down
3 changes: 3 additions & 0 deletions code/modules/awaymissions/capture_the_flag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
icon = 'icons/obj/device.dmi'
icon_state = "syndbeacon"
resistance_flags = INDESTRUCTIBLE
processing_flags = START_PROCESSING_MANUALLY
var/team = WHITE_TEAM
var/team_span = ""
//Capture the Flag scoring
Expand Down Expand Up @@ -347,6 +348,7 @@

/obj/machinery/capture_the_flag/proc/start_ctf()
ctf_enabled = TRUE
START_PROCESSING(SSmachines, src)
for(var/d in dead_barricades)
var/obj/effect/ctf/dead_barricade/D = d
D.respawn()
Expand Down Expand Up @@ -378,6 +380,7 @@

/obj/machinery/capture_the_flag/proc/stop_ctf()
ctf_enabled = FALSE
STOP_PROCESSING(SSmachines, src)
arena_reset = FALSE
var/area/A = get_area(src)
for(var/i in GLOB.mob_list)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/awaymissions/mission_code/challenge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@

/obj/machinery/power/emitter/energycannon/RefreshParts()
return

/obj/machinery/power/emitter/energycannon/ctf
processing_flags = START_PROCESSING_MANUALLY

/obj/machinery/power/emitter/energycannon/ctf/proc/toggle_ctf(ctf_enabled)
src.active = ctf_enabled
if(ctf_enabled)
START_PROCESSING(SSmachines, src)
else
STOP_PROCESSING(SSmachines, src)
10 changes: 0 additions & 10 deletions code/modules/power/singularity/emitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,6 @@
if(user)
user.visible_message("<span class='warning'>[user.name] emags [src].</span>", "<span class='notice'>You short out the lock.</span>")

/obj/machinery/power/emitter/ctf
name = "Energy Cannon"
active = TRUE
active_power_usage = FALSE
idle_power_usage = FALSE
locked = TRUE
req_access_txt = "100"
welded = TRUE
use_power = FALSE

/obj/machinery/power/emitter/welded/Initialize()
welded = TRUE
return ..()
Expand Down

0 comments on commit 8b2faaf

Please sign in to comment.