#include "gamemode_lms.qh"
-#include "../_all.qh"
#include "gamemode.qh"
}
MUTATOR_HOOKFUNCTION(lms_ResetPlayers)
-{
+{SELFPARAM();
+ entity e;
if(restart_mapalreadyrestarted || (time < game_starttime))
- FOR_EACH_CLIENT(self)
- if(IS_PLAYER(self))
- PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
+ FOR_EACH_CLIENT(e)
+ if(IS_PLAYER(e))
+ {
+ WITH(entity, self, e, PlayerScore_Add(e, SP_LMS_LIVES, LMS_NewPlayerLives()));
+ }
return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn)
-{
+{SELFPARAM();
// player is dead and becomes observer
// FIXME fix LMS scoring for new system
if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
+ {
self.classname = "observer";
+ Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_LMS_NOLIVES);
+ }
return false;
}
MUTATOR_HOOKFUNCTION(lms_PlayerDies)
-{
+{SELFPARAM();
self.respawn_flags |= RESPAWN_FORCE;
return false;
}
MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
-{
+{SELFPARAM();
// Only if the player cannot play at all
if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
self.frags = FRAGS_SPECTATOR;
}
MUTATOR_HOOKFUNCTION(lms_ClientConnect)
-{
+{SELFPARAM();
self.classname = "player";
campaign_bots_may_start = 1;
}
MUTATOR_HOOKFUNCTION(lms_PlayerThink)
-{
+{SELFPARAM();
if(self.deadflag == DEAD_DYING)
self.deadflag = DEAD_RESPAWNING;
}
MUTATOR_HOOKFUNCTION(lms_FilterItem)
-{
+{SELFPARAM();
if(autocvar_g_lms_extra_lives)
- if(self.classname == "item_health_mega")
+ if(self.itemdef == ITEM_HealthMega)
{
self.max_health = 1;
return false;
}
MUTATOR_HOOKFUNCTION(lms_ItemTouch)
-{
+{SELFPARAM();
// give extra lives for mega health
- if(self.items & IT_HEALTH)
+ if (self.items & ITEM_HealthMega.m_itemid)
{
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}