Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix time of death persistence for larva queue #3781

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__HELPERS/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ var/atom/cmp_dist_origin=null
/// Compares observers based on their larva_queue_time value in ascending order
/// Assumes the client on the observer is not null
/proc/cmp_obs_larvaqueuetime_asc(mob/dead/observer/A, mob/dead/observer/B)
return A.client.larva_queue_time - B.client.larva_queue_time
return A.client.player_details.larva_queue_time - B.client.player_details.larva_queue_time
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
to_chat(candidates[i], chat_message)

// Count how many are prioritized
if(cur_obs.client.larva_queue_time < 2) // 0 and 1 because facehuggers/t-domers are slightly deprioritized
if(cur_obs.client.player_details.larva_queue_time < 2) // 0 and 1 because facehuggers/t-domers are slightly deprioritized
new_players++

/proc/convert_k2c(temp)
Expand Down
2 changes: 0 additions & 2 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
var/adminobs = null
var/area = null
var/time_died_as_mouse = null //when the client last died as a mouse
/// The descriminator for larva queue ordering: Generally set to timeofdeath except for facehuggers/admin z-level play
var/larva_queue_time

var/donator = 0
var/adminhelped = 0
Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/player_details.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details
var/list/post_logout_callbacks = list()
var/list/played_names = list() //List of names this key played under this round
var/byond_version = "Unknown"
/// The descriminator for larva queue ordering: Generally set to timeofdeath except for facehuggers/admin z-level play
var/larva_queue_time


/proc/log_played_names(ckey, ...)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Works together with spawning an observer, noted above.
// We don't change facehugger timeofdeath because they are still on cooldown if they died as a hugger
// Facehuggers are atleast 1 because they did get some action compared to those at 0 timeofdeath
var/new_tod = isfacehugger(src) ? 1 : ghost.timeofdeath
ghost.client.larva_queue_time = max(ghost.client.larva_queue_time, new_tod)
ghost.client.player_details.larva_queue_time = max(ghost.client.player_details.larva_queue_time, new_tod)

ghost.set_huds_from_prefs()

Expand Down Expand Up @@ -413,7 +413,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/mob/dead/observer/ghost = ghostize((is_nested && nest && !QDELETED(nest))) //FALSE parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
if(ghost && !is_admin_level(z))
ghost.timeofdeath = world.time
ghost.client?.larva_queue_time = world.time
ghost.client?.player_details.larva_queue_time = world.time
if(is_nested && nest && !QDELETED(nest))
ghost.can_reenter_corpse = FALSE
nest.ghost_of_buckled_mob = ghost
Expand Down
1 change: 1 addition & 0 deletions code/modules/organs/limb_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
H.regenerate_icons()

if(braindeath_on_decap)
brainmob.timeofdeath = world.time
brainmob.set_stat(DEAD)
brainmob.death(cause)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
var/mob/dead/observer/obs = mob.ghostize(FALSE)
if(obs)
obs.timeofdeath = world.time
obs.client?.larva_queue_time = world.time
obs.client?.player_details.larva_queue_time = world.time
mob.moveToNullspace()

// Now that mobs are stowed, delete the shuttle
Expand Down
Loading