X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FObjects%2FPerson.cpp;h=bc54a0df073f2b4a0491265f1dcf80ac0418c793;hb=6cb245d6d347e0f610b2851d08273087fff9c0d0;hp=6af3c02d32ff6b7cde2a0227b27f39296d6ec3ec;hpb=3a6ebcc050c7ee941e5d5ea243f59827d113d968;p=lugaru.git diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index 6af3c02..bc54a0d 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -531,7 +531,7 @@ void Person::CatchFire() XYZ flatfacing, flatvelocity; int howmany; for (int i = 0; i < 10; i++) { - howmany = abs(Random() % (skeleton.joints.size())); + howmany = fabs(Random() % (skeleton.joints.size())); if (skeleton.free) { flatvelocity = skeleton.joints[howmany].velocity; flatfacing = skeleton.joints[howmany].position * scale + coords; @@ -1762,13 +1762,13 @@ void Person::RagDoll(bool checkcollision) change.y = (float)(Random() % 100) / 100; change.z = (float)(Random() % 100) / 100; skeleton.joints[i].velocity += change; - skeleton.joints[abs(Random() % skeleton.joints.size())].velocity -= change; + skeleton.joints[fabs(Random() % skeleton.joints.size())].velocity -= change; change.x = (float)(Random() % 100) / 100; change.y = (float)(Random() % 100) / 100; change.z = (float)(Random() % 100) / 100; skeleton.joints[i].velchange += change; - skeleton.joints[abs(Random() % skeleton.joints.size())].velchange -= change; + skeleton.joints[fabs(Random() % skeleton.joints.size())].velchange -= change; } if (checkcollision) { @@ -4387,7 +4387,7 @@ void Person::DoStuff() } while (flamedelay < 0 && onfire) { flamedelay += .006; - howmany = abs(Random() % (skeleton.joints.size())); + howmany = fabs(Random() % (skeleton.joints.size())); if (skeleton.free) { flatvelocity = skeleton.joints[howmany].velocity * scale / 2; flatfacing = skeleton.joints[howmany].position * scale + coords; @@ -4400,7 +4400,7 @@ void Person::DoStuff() while (flamedelay < 0 && !onfire && tutoriallevel == 1 && id != 0) { flamedelay += .05; - howmany = abs(Random() % (skeleton.joints.size())); + howmany = fabs(Random() % (skeleton.joints.size())); if (skeleton.free) { flatvelocity = skeleton.joints[howmany].velocity * scale / 2; flatfacing = skeleton.joints[howmany].position * scale + coords;