Apply scale-based weight to wind fields too (trigger_impulse)
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 13:33:35 +0000 (15:33 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 19 Mar 2012 13:33:35 +0000 (15:33 +0200)
data/qcsrc/server/g_triggers.qc
docs/TODO.txt

index 92a9cfe..f2c3205 100644 (file)
@@ -1136,6 +1136,9 @@ void trigger_impulse_touch1()
     other.lastpushtime = time;\r
     if(!pushdeltatime) return;\r
 \r
+       // apply size-based weight\r
+       str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1;\r
+\r
     other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;\r
        other.flags &~= FL_ONGROUND;\r
 }\r
@@ -1144,6 +1147,7 @@ void trigger_impulse_touch1()
 void trigger_impulse_touch2()\r
 {\r
     float pushdeltatime;\r
+       float str;\r
 \r
        // FIXME: Better checking for what to push and not.\r
        if not(other.iscreature)\r
@@ -1170,8 +1174,13 @@ void trigger_impulse_touch2()
     other.lastpushtime = time;\r
     if(!pushdeltatime) return;\r
 \r
+       str = pow(self.strength, pushdeltatime);\r
+\r
+       // apply size-based weight\r
+       str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1;\r
+\r
     // div0: ticrate independent, 1 = identity (not 20)\r
-    other.velocity = other.velocity * pow(self.strength, pushdeltatime);\r
+    other.velocity = other.velocity * str;\r
 }\r
 \r
 // Spherical (gravity/repulsor) mode\r
@@ -1216,6 +1225,9 @@ void trigger_impulse_touch3()
     else\r
         str = self.strength;\r
 \r
+       // apply size-based weight\r
+       str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1;\r
+\r
     other.velocity = other.velocity + normalize(other.origin - self.origin) * str * pushdeltatime;\r
 }\r
 \r
index fd18247..42f5858 100644 (file)
 \r
 - +0.8: Some sort of bullet time feature in single player, by setting the slowmo cvar\r
 \r
-- 0.8: Does the wind trigger brush need to account scale based gravity?\r
-\r
 - 0.8 BUG: Stomach load appeared 101 while my health was 100\r
 \r
 - 0.8: Give weapons a weight, which affects the player based on size\r
 \r
+- 0.8: Don't allow macros in the tutorial map (use health rot), since their weight makes it impossible to pass some parts\r
+\r
 - 0.8: Make some g_healthsize cvars g_balance_healthsize, and move them to balanceVT.cfg\r
 \r
 - 0.8: Make player fatness depend on frags, using a trick I heard about with shaders\r