]> git.jsancho.org Git - lugaru.git/commitdiff
Trying to avoid crashes in Weapon::DoStuff
authorCôme Chilliet <come@chilliet.eu>
Mon, 12 Dec 2016 16:02:00 +0000 (23:02 +0700)
committerCôme Chilliet <come@chilliet.eu>
Mon, 12 Dec 2016 16:02:00 +0000 (23:02 +0700)
Source/Objects/Weapons.cpp

index 0126c2e01ed547d8a6c50c5018169b66978734fc..a6a1786736897d38e198661869c2fe09fa9d148d 100644 (file)
@@ -100,7 +100,6 @@ void Weapon::setType(int t)
 
 void Weapon::DoStuff(int i)
 {
-    //~ cout << position.x << "," << position.y << "," << position.z << "|" << tippoint.x << "," << tippoint.y << "," << tippoint.z << endl;
     static int whichpatchx, whichpatchz, whichhit;
     static XYZ start, end, colpoint, normalrot, footvel, footpoint;
     static XYZ terrainnormal;
@@ -118,6 +117,10 @@ void Weapon::DoStuff(int i)
     static XYZ closestswordpoint;
     static float tempmult;
 
+    if (multiplier <= 0) {
+        return;
+    }
+
     if (owner != -1) {
         oldowner = owner;
     }