Sync gamemode var on wave init

This commit is contained in:
2025-04-23 07:50:55 -04:00
parent 45d3d54731
commit 0254ad5eed
2 changed files with 15 additions and 2 deletions

View File

@@ -406,8 +406,6 @@ enum struct BULKFIRE {
}
BULKFIRE crusaderAtk[64];
//Configure all variables
void SetupCoreData(){
AssLogger(LOGLVL_INFO, "Setting up core data...");
@@ -789,6 +787,17 @@ void SetupCoreData(){
HookEventEx("player_hurt", Event_PlayerHurt, EventHookMode_Pre);
AssLogger(1, "Core data setup complete!");
}
void UpdateGamemode(){
char logdata[256];
char popfile[128];
int ent = FindEntityByClassname(-1, "tf_objective_resource");
if (ent == -1) return;
GetEntPropString(ent, Prop_Send, "m_iszMvMPopfileName", popfile, sizeof(popfile));
core.gamemode = (StrContains(popfile, "tacobell") != -1 ? 1 : (StrContains(popfile, "wavenull") != -1) ? 2 : 0);
Format(logdata, sizeof(logdata), "Testing if popfile contains tacobell or wavenull, result %i", core.gamemode);
AssLogger(LOGLVL_DEBUG, logdata);
}
//Messages to be printed when the fail safe has been triggered.
char failsafe[][256] = {
"{orange}🔥Burnt Mocha🍵 {white}: FAILSAFE HAS BEEN TRIGGERED. ROBOT EXTERMINATION IN PROGRESS. [Failsafe Activated]",