From: Mario Date: Wed, 14 Oct 2015 14:26:18 +0000 (+1000) Subject: Kill another gamemode specific check X-Git-Tag: xonotic-v0.8.2~1801^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e100941925c59c9f55dea3b544bc11dd4ebe2eab;p=xonotic%2Fxonotic-data.pk3dir.git Kill another gamemode specific check --- diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 2066e768c..c73e43253 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -738,4 +738,19 @@ entity want_weaponinfo; bool want_allguns; bool want_mutatorblocked; MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon); + +#define EV_SetPlayerFullStatus(i, o) \ + /**/ i(entity, set_player) \ + /**/ i(string, ret_string) \ + /**/ o(string, ret_string) \ + /**/ +entity set_player; +MUTATOR_HOOKABLE(SetPlayerFullStatus, EV_SetPlayerFullStatus); + +#define EV_SetPlayerStatus(i, o) \ + /**/ i(entity, set_player) \ + /**/ i(string, ret_string) \ + /**/ o(string, ret_string) \ + /**/ +MUTATOR_HOOKABLE(SetPlayerStatus, EV_SetPlayerStatus); #endif diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index 84b56daba..8e2d9d9e8 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -462,6 +462,20 @@ MUTATOR_HOOKFUNCTION(ca, WantWeapon) return false; } +MUTATOR_HOOKFUNCTION(ca, SetPlayerFullStatus) +{ + if(set_player.caplayer == 1) + return true; + return false; +} + +MUTATOR_HOOKFUNCTION(ca, SetPlayerStatus) +{ + if(set_player.caplayer == 1) + return true; + return false; +} + void ca_Initialize() { allowed_to_spawn = true; diff --git a/qcsrc/server/mutators/gamemode_lms.qc b/qcsrc/server/mutators/gamemode_lms.qc index aab3b5542..e9a0029d0 100644 --- a/qcsrc/server/mutators/gamemode_lms.qc +++ b/qcsrc/server/mutators/gamemode_lms.qc @@ -242,6 +242,16 @@ MUTATOR_HOOKFUNCTION(lms, WantWeapon) return false; } +MUTATOR_HOOKFUNCTION(lms, SetPlayerFullStatus) +{ + return true; +} + +MUTATOR_HOOKFUNCTION(lms, SetPlayerStatus) +{ + return true; +} + // scoreboard stuff void lms_ScoreRules() { diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index bb489f76f..f1b964417 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -536,15 +536,17 @@ void WinningConditionHelper() s = strcat(s, ":human"); else s = strcat(s, ":bot"); - if(!IS_PLAYER(p) && p.caplayer != 1 && !g_lms) + if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(SetPlayerFullStatus, p, s)) s = strcat(s, ":spectator"); + s = strcat(s, ret_string); } else { - if(IS_PLAYER(p) || p.caplayer == 1 || g_lms) + if(IS_PLAYER(p) || MUTATOR_CALLHOOK(SetPlayerStatus, p, s)) s = GetPlayerScoreString(p, 2); else s = "-666"; + s = strcat(s, ret_string); } if(p.clientstatus)