diff --git a/baystation12.dme b/baystation12.dme index 40eca682b33b5..26ddab85b63db 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1451,6 +1451,7 @@ #include "code\modules\halo\admin\difficulty.dm" #include "code\modules\halo\admin\fleet_spawn.dm" #include "code\modules\halo\admin\lore_accurate.dm" +#include "code\modules\halo\admin\poplock.dm" #include "code\modules\halo\admin\radio_message.dm" #include "code\modules\halo\admin\ship_load.dm" #include "code\modules\halo\admin\spawn_conversion.dm" diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 52a50a6848b5e..8f261d36becd6 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -196,7 +196,9 @@ return TRUE poplock_bypassing = 0 //is this gamemode trying to balance the faction population? - var/num_balancing_factions = ticker.mode ? ticker.mode.faction_balance.len : 0 + var/num_balancing_factions = 0 + if(GLOB.popbalance_active && ticker.mode) + num_balancing_factions = ticker.mode.faction_balance.len if(ticker.current_state == GAME_STATE_PLAYING && num_balancing_factions >= 2) //Only popbalance if we're actually playing rn. if(Debug2) to_debug_listeners("Checking gamemode balance for [src.title]...") diff --git a/code/modules/halo/admin/_verbs.dm b/code/modules/halo/admin/_verbs.dm index 2695c1578cc91..fc299028a3a91 100644 --- a/code/modules/halo/admin/_verbs.dm +++ b/code/modules/halo/admin/_verbs.dm @@ -21,4 +21,7 @@ admin_verbs_fun.Add(/client/proc/custom_radio_message) admin_verbs_hideable.Add(/client/proc/custom_radio_message) + admin_verbs_fun.Add(/client/proc/pop_toggle) + admin_verbs_hideable.Add(/client/proc/pop_toggle) + return 1 diff --git a/code/modules/halo/admin/poplock.dm b/code/modules/halo/admin/poplock.dm new file mode 100644 index 0000000000000..2d6727181c3e5 --- /dev/null +++ b/code/modules/halo/admin/poplock.dm @@ -0,0 +1,15 @@ +GLOBAL_VAR_INIT(popbalance_active,1) + +/client/proc/pop_toggle() + set category = "Fun" + set name = "Toggle Popbalance" + if(!check_rights(R_FUN)) + return + + var/message = "" + if(GLOB.popbalance_active) + message = "Population-based faction balance inactive" + else + message = "Population-based faction balance active" + to_world("[message]") + GLOB.popbalance_active = !GLOB.popbalance_active \ No newline at end of file diff --git a/maps/_gamemodes/_popbalance.dm b/maps/_gamemodes/_popbalance.dm index 56c0b2d95436f..739e6b5550e12 100644 --- a/maps/_gamemodes/_popbalance.dm +++ b/maps/_gamemodes/_popbalance.dm @@ -1,7 +1,7 @@ //GLOBAL_VAR_INIT(max_overpop, 0.5) //now a config var GLOBAL_VAR_INIT(round_no_balance_time, 0 MINUTES) //Nothing, right now. GLOBAL_VAR_INIT(last_admin_notice_overpop, 0) -GLOBAL_VAR_INIT(min_players_balance, 3) +GLOBAL_VAR_INIT(min_players_balance, 10) /datum/game_mode //put the faction types in here that you want to be balanced