From: Mario Date: Wed, 14 Oct 2015 15:32:22 +0000 (+1000) Subject: Move an existing mutator hook to support the killing of another gamemode specific... X-Git-Tag: xonotic-v0.8.2~1801^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=839e2adfe6494662f41ba898f1d1844e17227d0f;p=xonotic%2Fxonotic-data.pk3dir.git Move an existing mutator hook to support the killing of another gamemode specific check --- 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;