From: Mario Date: Wed, 14 Oct 2015 14:36:59 +0000 (+1000) Subject: Merge 3 hooks into 1 and kill another gamemode specific check X-Git-Tag: xonotic-v0.8.2~1801^2~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cb9aedf463db7c71854f784f0132c017466db1b6;p=xonotic%2Fxonotic-data.pk3dir.git Merge 3 hooks into 1 and kill another gamemode specific check --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 05f08f057..e121e6f96 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1425,7 +1425,7 @@ void DumpStats(float final) { s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":"); s = strcat(s, ftos(rint(time - other.jointime)), ":"); - if(IS_PLAYER(other) || other.caplayer == 1 || g_lms) + if(IS_PLAYER(other) || MUTATOR_CALLHOOK(GetPlayerStatus, other, s)) s = strcat(s, ftos(other.team), ":"); else s = strcat(s, "spectator:"); diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 45e4572e8..c6815e7fb 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -739,21 +739,6 @@ 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); - #define EV_AddPlayerScore(i, o) \ /**/ i(int, score_field) \ /**/ i(float, ret_float) \ @@ -761,4 +746,12 @@ MUTATOR_HOOKABLE(SetPlayerStatus, EV_SetPlayerStatus); /**/ int score_field; MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore); + +#define EV_GetPlayerStatus(i, o) \ + /**/ i(entity, set_player) \ + /**/ i(string, ret_string) \ + /**/ o(string, ret_string) \ + /**/ +entity set_player; +MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus); #endif diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index 8e2d9d9e8..af870ec6c 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -462,14 +462,7 @@ MUTATOR_HOOKFUNCTION(ca, WantWeapon) return false; } -MUTATOR_HOOKFUNCTION(ca, SetPlayerFullStatus) -{ - if(set_player.caplayer == 1) - return true; - return false; -} - -MUTATOR_HOOKFUNCTION(ca, SetPlayerStatus) +MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus) { if(set_player.caplayer == 1) return true; diff --git a/qcsrc/server/mutators/gamemode_lms.qc b/qcsrc/server/mutators/gamemode_lms.qc index facf5771c..dc56fb17a 100644 --- a/qcsrc/server/mutators/gamemode_lms.qc +++ b/qcsrc/server/mutators/gamemode_lms.qc @@ -242,12 +242,7 @@ MUTATOR_HOOKFUNCTION(lms, WantWeapon) return false; } -MUTATOR_HOOKFUNCTION(lms, SetPlayerFullStatus) -{ - return true; -} - -MUTATOR_HOOKFUNCTION(lms, SetPlayerStatus) +MUTATOR_HOOKFUNCTION(lms, GetPlayerStatus) { return true; } diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 9ef3e1e75..2279e649d 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -537,13 +537,13 @@ void WinningConditionHelper() s = strcat(s, ":human"); else s = strcat(s, ":bot"); - if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(SetPlayerFullStatus, p, s)) + if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(GetPlayerStatus, p, s)) s = strcat(s, ":spectator"); s = strcat(s, ret_string); } else { - if(IS_PLAYER(p) || MUTATOR_CALLHOOK(SetPlayerStatus, p, s)) + if(IS_PLAYER(p) || MUTATOR_CALLHOOK(GetPlayerStatus, p, s)) s = GetPlayerScoreString(p, 2); else s = "-666";