From 839e2adfe6494662f41ba898f1d1844e17227d0f Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 15 Oct 2015 01:32:22 +1000 Subject: [PATCH] Move an existing mutator hook to support the killing of another gamemode specific check --- qcsrc/common/gamemodes/gamemode/nexball/nexball.qc | 6 ++++++ .../mutators/mutator/waypoints/waypointsprites.qc | 10 ++++------ qcsrc/server/mutators/events.qh | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 7520fcdbb..4d63b9a5f 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -1046,6 +1046,12 @@ MUTATOR_HOOKFUNCTION(nb, DropSpecialItems) return false; } +MUTATOR_HOOKFUNCTION(nb, SendWaypoint) +{ + wp_sendflags &= ~0x80; + return false; +} + REGISTER_MUTATOR(nb, g_nexball) { ActivateTeamplay(); diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 173375d91..4f9116e73 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -12,14 +12,9 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) sendflags = sendflags & 0x7F; - if (g_nexball) - sendflags &= ~0x80; - else if (self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25))) + if (self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25))) sendflags |= 0x80; - WriteByte(MSG_ENTITY, sendflags); - WriteByte(MSG_ENTITY, self.wp_extra); - int f = 0; if(self.currentammo) f |= 1; // hideable @@ -28,6 +23,9 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) MUTATOR_CALLHOOK(SendWaypoint, this, to, sendflags, f); + WriteByte(MSG_ENTITY, sendflags); + WriteByte(MSG_ENTITY, self.wp_extra); + if (sendflags & 0x80) { if (self.max_health) diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 93861ffae..4caacea7c 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -778,7 +778,9 @@ MUTATOR_HOOKABLE(ReadLevelCvars, EV_NO_ARGS); /**/ i(entity, __self) \ /**/ i(entity, wp_sendto) \ /**/ i(int, wp_sendflags) \ + /**/ o(int, wp_sendflags) \ /**/ i(int, wp_flag) \ + /**/ o(int, wp_flag) \ /**/ entity wp_sendto; int wp_sendflags; -- 2.39.2