self.weapons = randombits(self.weapons, g_weaponarena_random, FALSE);
self.items = start_items;
- self.switchweapon = w_getbestweapon(self);
- self.cnt = self.switchweapon;
- self.weapon = 0;
self.jump_interval = time;
self.spawnshieldtime = time + cvar("g_spawnshieldtime");
self = oldself;
MUTATOR_CALLHOOK(PlayerSpawn);
+
+ self.switchweapon = w_getbestweapon(self);
+ self.cnt = self.switchweapon;
+ self.weapon = 0;
} else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
PutObserverInServer ();
}
W_SwitchWeapon(nix_weapon);
}
+void NIX_precache()
+{
+ float i;
+ for (i = WEP_FIRST; i <= WEP_LAST; ++i)
+ if (NIX_CanChooseWeapon(i))
+ weapon_action(i, WR_PRECACHE);
+}
+
MUTATOR_HOOKFUNCTION(nix_ForbidThrowCurrentWeapon)
{
return 1; // no throwing in NIX
MUTATOR_HOOKFUNCTION(nix_SetStartItems)
{
- float i;
- start_weapons = 0; // will be done later, when player spawns
- warmup_start_weapons = 0; // will be done later, when player spawns
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- if (NIX_CanChooseWeapon(i))
- weapon_action(i, WR_PRECACHE);
+ NIX_precache();
+ // we do NOT change the start weapons any more, so we can later turn off the mutator!
+ // start_weapons = 0; // will be done later, when player spawns
+ // warmup_start_weapons = 0; // will be done later, when player spawns
return 0;
}
MUTATOR_HOOKFUNCTION(nix_PlayerSpawn)
{
self.nix_lastchange_id = -1;
+ NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning
return 0;
}
g_nix_with_laser = cvar("g_nix_with_laser");
nix_nextchange = time;
+ nix_nextweapon = 0;
+
+ NIX_precache();
}
MUTATOR_ONREMOVE
{
- error("NIX currently cannot be shut down.");
g_nix = 0;
+ // as the PlayerSpawn hook will no longer run, NIX is turned off by this!
}
return 0;