From: Mario Date: Tue, 9 Apr 2013 06:05:16 +0000 (+1000) Subject: Fix players able to rejoin after spectating X-Git-Tag: xonotic-v0.7.0~60^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=60da5ecc59ddef8d79f9ba5c0ce7348e6bdddb96;p=xonotic%2Fxonotic-data.pk3dir.git Fix players able to rejoin after spectating --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 5114649ef..c0df8e2fc 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -662,6 +662,9 @@ void PutClientInServer (void) if((g_arena && !self.spawned) || (g_ca && !allowed_to_spawn)) self.classname = "observer"; + + if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0) + self.classname = "observer"; if(gameover) self.classname = "observer"; diff --git a/qcsrc/server/mutators/gamemode_lms.qc b/qcsrc/server/mutators/gamemode_lms.qc index be84a517c..6266fbfc2 100644 --- a/qcsrc/server/mutators/gamemode_lms.qc +++ b/qcsrc/server/mutators/gamemode_lms.qc @@ -29,16 +29,6 @@ MUTATOR_HOOKFUNCTION(lms_RemovePlayer) return FALSE; } -MUTATOR_HOOKFUNCTION(lms_PlayerSpawn) -{ - // 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"; - - return FALSE; -} - MUTATOR_HOOKFUNCTION(lms_ClientConnect) { self.classname = "player"; @@ -124,7 +114,7 @@ MUTATOR_HOOKFUNCTION(lms_BotSpawn) } return FALSE; -} +} // scoreboard stuff void lms_ScoreRules() @@ -146,7 +136,6 @@ void lms_Initialize() MUTATOR_DEFINITION(gamemode_lms) { MUTATOR_HOOK(MakePlayerObserver, lms_RemovePlayer, CBC_ORDER_ANY); - MUTATOR_HOOK(PlayerSpawn, lms_PlayerSpawn, CBC_ORDER_ANY); MUTATOR_HOOK(ClientConnect, lms_ClientConnect, CBC_ORDER_ANY); MUTATOR_HOOK(PlayerPreThink, lms_PlayerThink, CBC_ORDER_ANY); MUTATOR_HOOK(ForbidThrowCurrentWeapon, lms_ForbidThrowing, CBC_ORDER_ANY);