From ead58cd4f5b3d3716935ff72a7a7f9905761f290 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 12 Dec 2016 23:02:00 +0700 Subject: [PATCH] Trying to avoid crashes in Weapon::DoStuff --- Source/Objects/Weapons.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Objects/Weapons.cpp b/Source/Objects/Weapons.cpp index 0126c2e..a6a1786 100644 --- a/Source/Objects/Weapons.cpp +++ b/Source/Objects/Weapons.cpp @@ -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; } -- 2.39.5