Skip to content

Commit

Permalink
Add Bypass Time of Death variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Jul 19, 2023
1 parent 6f98fd9 commit 7eb1321
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@

// copied from join as xeno
var/deathtime = world.time - cur_obs.timeofdeath
if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN)) )
if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN) || !cur_obs.bypass_time_of_death_checks))
continue

// AFK players cannot be drafted
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
var/observer_actions = list(/datum/action/observer_action/join_xeno)
var/datum/action/minimap/observer/minimap
var/larva_queue_cached_message
///Used to bypass time of death checks such as when being selected for larva.
var/bypass_time_of_death_checks = FALSE

alpha = 127

Expand Down Expand Up @@ -368,6 +370,8 @@ Works together with spawning an observer, noted above.
// Larva queue: We use the larger of their existing queue time or the new timeofdeath except for facehuggers
// We don't change facehugger timeofdeath because they are still on cooldown if they died as a hugger
var/new_tod = isfacehugger(src) ? 1 : ghost.timeofdeath
// if they died as facehugger, bypass typical TOD checks
ghost.bypass_time_of_death_checks = isfacehugger(src) ? TRUE : FALSE
ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod)

ghost.set_huds_from_prefs()
Expand Down

0 comments on commit 7eb1321

Please sign in to comment.