int kh_Key_AllOwnedByWhichTeam();
-const float ST_KH_CAPS = 1;
+const int ST_KH_CAPS = 1;
void kh_ScoreRules(int teams)
{
GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
kh_teams = autocvar_g_keyhunt_teams_override;
if(kh_teams < 2)
kh_teams = cvar("g_keyhunt_teams"); // read the cvar directly as it gets written earlier in the same frame
- kh_teams = bound(2, kh_teams, 4);
-
- int teams = 0;
- if(kh_teams >= 1) teams |= BIT(0);
- if(kh_teams >= 2) teams |= BIT(1);
- if(kh_teams >= 3) teams |= BIT(2);
- if(kh_teams >= 4) teams |= BIT(3);
-
- kh_teams = teams; // now set it?
+ kh_teams = BITS(bound(2, kh_teams, 4));
// make a KH entity for controlling the game
kh_controller = spawn();
return;
}
- if (this.bot_strategytime < time)
+ if (navigation_goalrating_timeout(this))
{
- this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
if(kh_Key_AllOwnedByWhichTeam() == this.team)
havocbot_goalrating_kh(this, 4, 4, 1); // play defensively
navigation_goalrating_end(this);
+
+ navigation_goalrating_timeout_set(this);
}
}
return;
}
- if (this.bot_strategytime < time)
+ if (navigation_goalrating_timeout(this))
{
float key_owner_team;
- this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
key_owner_team = kh_Key_AllOwnedByWhichTeam();
havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK ANYWAY
navigation_goalrating_end(this);
+
+ navigation_goalrating_timeout_set(this);
}
}
return;
}
- if (this.bot_strategytime < time)
+ if (navigation_goalrating_timeout(this))
{
float key_owner_team;
- this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
key_owner_team = kh_Key_AllOwnedByWhichTeam();
havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK! EMERGENCY!
navigation_goalrating_end(this);
+
+ navigation_goalrating_timeout_set(this);
}
}
return;
}
- if (this.bot_strategytime < time)
+ if (navigation_goalrating_timeout(this))
{
- this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
int key_owner_team = kh_Key_AllOwnedByWhichTeam();
havocbot_goalrating_kh(this, 0.1, 0.1, 10); // ATTACK ANYWAY
navigation_goalrating_end(this);
+
+ navigation_goalrating_timeout_set(this);
}
}