Skip to content

Commit

Permalink
Fixes queen not being able to spawn (#6077)
Browse files Browse the repository at this point in the history
# About the pull request
Fixes #5999 

# Explain why it's good for the game
bug fix

# Changelog
:cl:
fix: fixes queen getting stuck in the lobby if they take too long
/:cl:

---------

Co-authored-by: DOOM <N/A>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
vero5123 and Drulikar committed Apr 5, 2024
1 parent 030e55c commit 1e59864
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@
// target_hive integer the target hive to see if the source_hive is allied to it.
#define HIVE_ALLIED_TO_HIVE(source_hive, target_hive) ((source_hive) == (target_hive) || GLOB.hive_datum[source_hive]?.faction_is_ally(GLOB.hive_datum[target_hive]?.internal_faction))

#define QUEEN_SPAWN_TIMEOUT (2 MINUTES)
#define QUEEN_SPAWN_TIMEOUT (1 MINUTES)

#define FIRE_IMMUNITY_NONE 0
#define FIRE_IMMUNITY_NO_DAMAGE (1<<0)
Expand Down
7 changes: 5 additions & 2 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,9 @@ Additional game mode variables.
return TRUE

/// Pick and setup a queen spawn from landmarks, then spawns the player there alongside any required setup
/datum/game_mode/proc/pick_queen_spawn(datum/mind/ghost_mind, hivenumber = XENO_HIVE_NORMAL)
/datum/game_mode/proc/pick_queen_spawn(mob/player, hivenumber = XENO_HIVE_NORMAL)
RETURN_TYPE(/turf)

var/datum/mind/ghost_mind = player.mind
var/mob/living/original = ghost_mind.current
var/datum/hive_status/hive = GLOB.hive_datum[hivenumber]
if(hive.living_xeno_queen || !original || !original.client)
Expand All @@ -710,6 +710,9 @@ Additional game mode variables.
spawn_list_map[spawn_name] = T

var/selected_spawn = tgui_input_list(original, "Where do you want you and your hive to spawn?", "Queen Spawn", spawn_list_map, QUEEN_SPAWN_TIMEOUT, theme="hive_status")
if(hive.living_xeno_queen)
to_chat(original, SPAN_XENOANNOUNCE("You have taken too long to pick a spawn location, a queen has already evolved before you."))
player.send_to_lobby()
if(!selected_spawn)
selected_spawn = pick(spawn_list_map)
to_chat(original, SPAN_XENOANNOUNCE("You have taken too long to pick a spawn location, one has been chosen for you."))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/colonialmarines/xenovsxeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
var/mob/living/carbon/xenomorph/larva/L = new(xeno_turf, null, hivenumber)
ghost_mind.transfer_to(L)

/datum/game_mode/xenovs/pick_queen_spawn(datum/mind/ghost_mind, hivenumber = XENO_HIVE_NORMAL)
/datum/game_mode/xenovs/pick_queen_spawn(mob/player, hivenumber = XENO_HIVE_NORMAL)
. = ..()
if(!.) return
// Spawn additional hive structures
Expand Down
4 changes: 2 additions & 2 deletions code/game/jobs/job/antag/xeno/queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/datum/job/antag/xenos/queen/set_spawn_positions(count)
return spawn_positions

/datum/job/antag/xenos/queen/transform_to_xeno(mob/new_player/NP, hive_index)
SSticker.mode.pick_queen_spawn(NP.mind, hive_index)
/datum/job/antag/xenos/queen/transform_to_xeno(mob/living/carbon/human/human_to_transform, hive_index)
SSticker.mode.pick_queen_spawn(human_to_transform, hive_index)

/datum/job/antag/xenos/queen/announce_entry_message(mob/new_queen, account, whitelist_status)
to_chat(new_queen, "<B>You are now the alien queen!</B>")
Expand Down

0 comments on commit 1e59864

Please sign in to comment.