]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/sv_main.qc
Simplify and improve my last commit
[voretournament/voretournament.git] / data / qcsrc / server / sv_main.qc
index b8baf2965a7716334b5a8ec3b353e074f6220c88..fc1467445f725775bab0298fa6cf80b06b8b1e06 100644 (file)
@@ -106,14 +106,10 @@ void CreatureFrame (void)
                                        */\r
                                        if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)\r
                                        {\r
-                                               float micro_to_normal, normal_to_macro;\r
-                                               micro_to_normal = 1 - bound(0, (self.health / cvar("g_healthsize_center") - 1) / (cvar("g_healthsize_min") / cvar("g_healthsize_center") - 1), 1);\r
-                                               normal_to_macro = 1 - bound(0, (self.health / cvar("g_healthsize_max") - 1) / (cvar("g_healthsize_center") / cvar("g_healthsize_max") - 1), 1);\r
-\r
                                                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
-                                                       GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * micro_to_normal, 1));\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 * micro_to_normal, 1));\r
+                                                       GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));\r
 \r
                                                //sound(self, CHAN_AUTO, "misc/macro_footstep.wav", VOL_BASE, ATTN_NORM);\r
                                        }\r