]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix and improve the final touches for footstep earthquakes
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 18:59:18 +0000 (20:59 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 18:59:18 +0000 (20:59 +0200)
data/qcsrc/server/sv_main.qc
docs/TODO.txt

index 3bf49db91deca33f6a8f2d3ef7f654b252f23956..fd7545146a54e723dc443a66bb978e828b749040 100644 (file)
@@ -115,23 +115,29 @@ void CreatureFrame (void)
                                                                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 * playersize_macro(self), 1), ATTN_NORM);\r
 \r
-                                                       entity head;\r
-                                                       for(head = findradius(self.origin, cvar("g_healthsize_quake_step_radius")); head; head = head.chain)\r
+                                                       // earthquake effect for nearby players when a macro walks by\r
+                                                       if(cvar("g_healthsize_quake_step"))\r
                                                        {\r
-                                                               if(head.classname != "player")\r
-                                                                       continue;\r
-\r
-                                                               float shake;\r
-                                                               shake = vlen(head.origin - self.origin);\r
-                                                               if(shake)\r
-                                                                       shake = 1 - (shake / cvar("g_healthsize_quake_step_radius"));\r
-                                                               shake *= cvar("g_healthsize_quake_step");\r
-\r
-                                                               head.punchvector_x += crandom() * shake;\r
-                                                               head.punchvector_y += crandom() * shake;\r
-                                                               head.punchvector_z += crandom() * shake;\r
-\r
-                                                               dprint(strcat(head.netname, " | ", ftos(shake), " --------\n"));\r
+                                                               entity head;\r
+                                                               for(head = findradius(self.origin, cvar("g_healthsize_quake_step_radius")); head; head = head.chain)\r
+                                                               {\r
+                                                                       if not(head.classname == "player")\r
+                                                                               continue;\r
+                                                                       if(head == self)\r
+                                                                               continue; // not for self\r
+                                                                       if not(head.flags & FL_ONGROUND)\r
+                                                                               continue; // we only feel the ground shaking if we are sitting on it\r
+\r
+                                                                       float shake;\r
+                                                                       shake = vlen(head.origin - self.origin);\r
+                                                                       if(shake)\r
+                                                                               shake = 1 - bound(0, shake / cvar("g_healthsize_quake_step_radius"), 1);\r
+                                                                       shake *= cvar("g_healthsize_quake_step");\r
+\r
+                                                                       head.punchvector_x += crandom() * shake;\r
+                                                                       head.punchvector_y += crandom() * shake;\r
+                                                                       head.punchvector_z += crandom() * shake;\r
+                                                               }\r
                                                        }\r
                                                }\r
                                                else\r
index 84daab6d1729742a27dd10efedd55d8da83471d6..eb6f5f62baa9abefdf29ef65e31203018c04564e 100644 (file)
 \r
 - 0.7 BUG: Disabling g_healthsize gives a different field of view, even at 100 heatlh\r
 \r
-- 0.7 | 0.8: Add an earthquake effect for the giantess footsteps?
\ No newline at end of file
+- 0.7 | 0.8: The macro earthquake effect does not work for spectators who are spectating a player, because fl_onground needs to be bhack for the spectated player, not the spectator
\ No newline at end of file