Skip to content

Commit

Permalink
Fixes time freezing once and forall (#11262)
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerfulBacon authored Aug 2, 2024
1 parent af5d907 commit 01ea793
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions code/__DEFINES/explosions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
target.ex_act(##args);

// Explodable component deletion values
/// Makes the explodable component queue to reset its exploding status when it detonates.
#define EXPLODABLE_NO_DELETE 0
/// Makes the explodable component delete itself when it detonates.
#define EXPLODABLE_DELETE_SELF 1
#define EXPLODABLE_DELETE_SELF 0
/// Makes the explodable component delete its parent when it detonates.
#define EXPLODABLE_DELETE_PARENT 2
#define EXPLODABLE_DELETE_PARENT 1
4 changes: 3 additions & 1 deletion code/controllers/subsystem/explosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ SUBSYSTEM_DEF(explosions)
new /obj/effect/hotspot(T) //Mostly for ambience!
cost_flameturf = MC_AVERAGE(cost_flameturf, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))

if (low_turf.len || med_turf.len || high_turf.len)
// If a significant amount of turfs change, then we will run lighter for the rest of the tick
// because maptick is going to have an unexpected increase.
if (low_turf.len + med_turf.len + high_turf.len > 10)
Master.laggy_byond_map_update_incoming()

if(currentpart == SSEXPLOSIONS_MOVABLES)
Expand Down
5 changes: 0 additions & 5 deletions code/datums/components/explodable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
var/delete_after
/// For items, lets us determine where things should be hit.
var/equipped_slot
/// it won't explode again if cooldown is on. This is necessary because explosion() proc through SSexplosion doesn't tell if it's exploded
COOLDOWN_DECLARE(explosion_cooling)

/datum/component/explodable/Initialize(devastation_range, heavy_impact_range, light_impact_range, flash_range, uncapped = FALSE, delete_after = EXPLODABLE_DELETE_PARENT)
if(!isatom(parent))
Expand Down Expand Up @@ -125,9 +123,6 @@
/// Expldoe and remove the object
/datum/component/explodable/proc/detonate()
SIGNAL_HANDLER
if(!COOLDOWN_FINISHED(src, explosion_cooling))
return // If we don't do this and this doesn't delete it can lock the MC into only processing Input, Timers, and Explosions.
COOLDOWN_START(src, explosion_cooling, 1)

var/atom/bomb = parent
explosion(bomb, devastation_range, heavy_impact_range, light_impact_range, flash_range, uncapped) //epic explosion time
Expand Down
2 changes: 1 addition & 1 deletion code/datums/materials/basemats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Unless you know what you're doing, only use the first three numbers. They're in
. = ..()
if(ismovable(source))
source.AddElement(/datum/element/firestacker, amount=1)
source.AddComponent(/datum/component/explodable, 0, 0, amount / 1000, amount / 500, delete_after = EXPLODABLE_NO_DELETE)
source.AddComponent(/datum/component/explodable, 0, 0, amount / 1000, amount / 500, delete_after = EXPLODABLE_DELETE_PARENT)

/datum/material/plasma/on_removed(atom/source, amount, material_flags)
. = ..()
Expand Down

0 comments on commit 01ea793

Please sign in to comment.