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]",

View File

@@ -13,6 +13,7 @@ void sudo(int task) {
ServerCommand("fb_startmoney 50000");
CPrintToChatAll("{darkviolet}[{yellow}INFO{darkviolet}] {red}PROFESSOR'S ASS {white}v0x20 (Core-v%s). Prepare yourself for the unpredictable... [{limegreen}by TTV/ProfessorFartsalot{white}]", PLUGIN_VERSION);
FastFire2("rain", "Alpha", "0", 0.0, false);
UpdateGamemode();
}
//Wave init
case 2: {
@@ -1012,6 +1013,9 @@ public Action TimedOperator(Handle timer, int job) {
CreateTimer(3.0, TimedOperator, 200);
return Plugin_Stop;
}
case 420:{ //Init from Wave Null.
UpdateGamemode();
}
case 6969: {
if (!core.isWave){
ExitEmergencyMode();