]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Improve code in the last commit
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 14:14:23 +0000 (16:14 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 14:14:23 +0000 (16:14 +0200)
data/qcsrc/server/sv_main.qc

index e2f26c8c066478461ca7f1d09dbc78d72311ffa9..25eaaf9356d8f8be66a9c15e40247330e4bd8f2d 100644 (file)
@@ -106,25 +106,22 @@ void CreatureFrame (void)
                                        */\r
                                        if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)\r
                                        {\r
-                                               float micro_to_normal, normal_to_macro;\r
+                                               // if healthsize is enabled, play effects based on player size\r
                                                if(cvar("g_healthsize"))\r
                                                {\r
-                                                       micro_to_normal = 1 - playersize_micro(self);\r
-                                                       normal_to_macro = playersize_macro(self);\r
+                                                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
+                                                               GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));\r
+                                                       else\r
+                                                               GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));\r
+                                                       sound(self, CHAN_AUTO, "misc/macro_footstep.wav", bound(0, VOL_BASE * normal_to_macro, 1), ATTN_NORM);\r
                                                }\r
                                                else\r
                                                {\r
-                                                       // healthsize is disabled, always play normal sounds\r
-                                                       micro_to_normal = 1;\r
-                                                       normal_to_macro = 0;\r
+                                                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
+                                                               GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE, 1));\r
+                                                       else\r
+                                                               GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE, 1));\r
                                                }\r
-\r
-                                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
-                                                       GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * micro_to_normal, 1));\r
-                                               else\r
-                                                       GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * micro_to_normal, 1));\r
-\r
-                                               sound(self, CHAN_AUTO, "misc/macro_footstep.wav", bound(0, VOL_BASE * normal_to_macro, 1), ATTN_NORM);\r
                                        }\r
                                }\r
                        }\r