Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
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
3 changes: 3 additions & 0 deletions code/__DEFINES/antagonists.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
///An unreadied player counts for this much compared to a readied one
#define UNREADIED_PLAYER_MULTIPLIER 0.5

#define NUKE_RESULT_FLUKE 0
#define NUKE_RESULT_NUKE_WIN 1
#define NUKE_RESULT_CREW_WIN 2
Expand Down
17 changes: 11 additions & 6 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,25 @@
///Checks to see if the game can be setup and ran with the current number of players or whatnot.
/datum/game_mode/proc/can_start()
var/playerC = 0
var/unreadiedPlayers = 0
for(var/mob/dead/new_player/player in GLOB.player_list)
if((player.client)&&(player.ready == PLAYER_READY_TO_PLAY))
if(player.client && (player.ready == PLAYER_READY_TO_PLAY))
playerC++
else if(player.client && (player.ready == PLAYER_NOT_READY) && !player.client.holder) //Admins don't count :)
unreadiedPlayers++
if(!GLOB.Debug2)
if(playerC < required_players || (maximum_players >= 0 && playerC > maximum_players))
return 0
var/adjustedPlayerCount = round(playerC + (unreadiedPlayers * UNREADIED_PLAYER_MULTIPLIER), 1)
log_game("Round can_start() with [adjustedPlayerCount] adjusted count, versus [playerC] regular player count. Requirement: [required_players] Gamemode: [name]")
if(adjustedPlayerCount < required_players || (maximum_players >= 0 && playerC > maximum_players))
return FALSE
antag_candidates = get_players_for_role(antag_flag)
if(!GLOB.Debug2)
if(antag_candidates.len < required_enemies)
return 0
return 1
return FALSE
return TRUE
else
message_admins("<span class='notice'>DEBUG: GAME STARTING WITHOUT PLAYER NUMBER CHECKS, THIS WILL PROBABLY BREAK SHIT.</span>")
return 1
return TRUE


///Attempts to select players for special roles the mode might have.
Expand Down