]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move an existing mutator hook to support the killing of another gamemode specific...
authorMario <mario@smbclan.net>
Wed, 14 Oct 2015 15:32:22 +0000 (01:32 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Oct 2015 15:32:22 +0000 (01:32 +1000)
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/server/mutators/events.qh

index 7520fcdbb48c4f72d00b2e6a9a857a2c8e18052f..4d63b9a5f2c57b9f0dbfc5b6fe01a4c74d37a55b 100644 (file)
@@ -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();
index 173375d91f01e87d699be910a4f1c812b9b9b05a..4f9116e73c9d689cb6adbf7f0e4d6f7b21dcff67 100644 (file)
@@ -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)
index 93861ffae59e98aa194660518f1dae964843fddf..4caacea7cfb0c4cdf3fd28dd0e087513fa16763e 100644 (file)
@@ -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;