MUTATOR_CALLHOOK(PlayerSpawn);
self.switchweapon = w_getbestweapon(self);
- self.cnt = self.switchweapon;
+ self.cnt = -1; // W_LastWeapon will not complain
self.weapon = 0;
self.switchingweapon = 0;
W_CycleWeapon(self.cvar_cl_weaponpriority, +1);
}
+// previously used if exists and has ammo, (second) best otherwise
+void W_LastWeapon()
+{
+ if(client_hasweapon(self, self.cnt, TRUE, FALSE))
+ W_SwitchWeapon(self.cnt);
+ else
+ W_SwitchToOtherWeapon(self);
+}
+
float w_getbestweapon(entity e)
{
return W_GetCycleWeapon(e, e.cvar_cl_weaponpriority, 0, -1, FALSE, TRUE);
#else
#ifdef SVQC
void(float imp) W_SwitchWeapon;
+void() W_LastWeapon;
void W_Laser_Touch (void)
{
else
{
if(self.switchweapon == WEP_LASER) // don't do this if already switching
- W_SwitchWeapon (self.cnt);
+ W_LastWeapon();
}
}
}