]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
GlobalSound: fix `cl_forceplayermodels 1` using default voices when observing
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Nov 2015 08:21:15 +0000 (19:21 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Nov 2015 08:21:15 +0000 (19:21 +1100)
qcsrc/common/effects/qc/globalsound.qc

index 0e924226880bfeed75d483f0661df6f6952865ce..301b0215b4c3dcb4f8a8f350dbe1617b450bdc2b 100644 (file)
                        ps = PlayerSounds_from(ReadByte());
                        float r = ReadByte() / 255;
                        int who = ReadByte();
-                       entity e = findfloat(world, entnum, autocvar_cl_forceplayermodels ? player_currententnum : who);
+                       entity e = findfloat(world, entnum, who);
+                       if (autocvar_cl_forceplayermodels)
+                       {
+                               entity me = findfloat(world, entnum, player_currententnum);
+                               if (me.model != "null") e = me;
+                       }
                        UpdatePlayerSounds(e);
                        string s = e.(ps.m_playersoundfld);
                        string sample = GlobalSound_sample(s, r);