]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
tuba: support bot_sound_monopoly
authorRudolf Polzer <divverent@xonotic.org>
Sun, 16 Oct 2011 20:42:27 +0000 (22:42 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 16 Oct 2011 20:42:27 +0000 (22:42 +0200)
qcsrc/server/miscfunctions.qc
qcsrc/server/w_tuba.qc

index 4a860f03efd783058191ccb3725b391a7e248be7..27c04f8a4d02499a2549a81c9aedec74ec53958e 100644 (file)
@@ -1292,7 +1292,9 @@ float sound_allowed(float dest, entity e)
     {
         if (e.classname == "body")
             e = e.enemy;
-        if (e.owner && e.owner != e)
+       else if (e.realowner && e.realowner != e)
+            e = e.realowner;
+       else if (e.owner && e.owner != e)
             e = e.owner;
         else
             break;
index 1ed217851ee176308daeee8d2a1857b50a21ae96..c10d1f544a2d01e67fdef7e2c3b8b396fe53b515 100644 (file)
@@ -78,6 +78,10 @@ float W_Tuba_NoteSendEntity(entity to, float sf)
 {
        float f;
 
+       msg_entity = to;
+       if(!sound_allowed(MSG_ONE, self.realowner))
+               return FALSE;
+
        WriteByte(MSG_ENTITY, ENT_CLIENT_TUBANOTE);
        WriteByte(MSG_ENTITY, sf);
        if(sf & 1)