key.angles_y -= key.owner.angles.y;
#endif
key.flags = 0;
+ IL_REMOVE(g_items, key);
key.solid = SOLID_NOT;
set_movetype(key, MOVETYPE_NONE);
key.team = key.owner.team;
float first;
entity key;
float score;
- score = (kh_teams - 1) * autocvar_g_balance_keyhunt_score_capture;
- DistributeEvenly_Init(score, kh_teams);
+ score = (NumTeams(kh_teams) - 1) * autocvar_g_balance_keyhunt_score_capture;
+ DistributeEvenly_Init(score, NumTeams(kh_teams));
// twice the score for 3 team games, three times the score for 4 team games!
// note: for a win by destroying the key, this should NOT be applied
FOR_EACH_KH_KEY(key)
firstorigin = thisorigin;
first = false;
}
- if(kh_teams > 2)
+ if(NumTeams(kh_teams) > 2)
{
te_lightning2(NULL, lastorigin, firstorigin);
}
- midpoint = midpoint * (1 / kh_teams);
+ midpoint = midpoint * (1 / NumTeams(kh_teams));
te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
play2all(SND(KH_CAPTURE));
fragsleft = DistributeEvenly_Get(players);
// Now distribute these among all other teams...
- j = kh_teams - 1;
- for(i = 0; i < kh_teams; ++i)
+ j = NumTeams(kh_teams) - 1;
+ for(i = 0; i < NumTeams(kh_teams); ++i)
{
thisteam = kh_Team_ByID(i);
if(thisteam == teem) // bad boy, no cookie - this WILL happen
float keys;
teem = -1;
- keys = kh_teams;
+ keys = NumTeams(kh_teams);
FOR_EACH_KH_KEY(key)
{
if(!key.owner)
float kh_CheckPlayers(float num)
{
- if(num < kh_teams)
+ if(num < NumTeams(kh_teams))
{
float t_team = kh_Team_ByID(num);
float players = 0;
return 0;
}
-#define KH_READY_TEAMS() (!p1 + !p2 + ((kh_teams >= 3) ? !p3 : p3) + ((kh_teams >= 4) ? !p4 : p4))
-#define KH_READY_TEAMS_OK() (KH_READY_TEAMS() == kh_teams)
+#define KH_READY_TEAMS() (!p1 + !p2 + ((NumTeams(kh_teams) >= 3) ? !p3 : p3) + ((NumTeams(kh_teams) >= 4) ? !p4 : p4))
+#define KH_READY_TEAMS_OK() (KH_READY_TEAMS() == NumTeams(kh_teams))
void kh_WaitForPlayers() // delay start of the round until enough players are present
{
if(time < game_starttime)
Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT);
Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT_OTHER);
- for(i = 0; i < kh_teams; ++i)
+ for(i = 0; i < NumTeams(kh_teams); ++i)
{
teem = kh_Team_ByID(i);
players = 0;
my_player = it;
}
));
- kh_Key_Spawn(my_player, 360 * i / kh_teams, i);
+ kh_Key_Spawn(my_player, 360 * i / NumTeams(kh_teams), i);
}
kh_tracking_enabled = false;