]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Refactor of weapon throwing in Weapon class. (named it thrown as throw is reserved...
[lugaru.git] / Source / Person.cpp
index 81267bcc93355f1b446e145ae1e330fd8658729e..b1ebde7a0f9a0eb1fdbd745a36aeaf712da674a6 100644 (file)
@@ -2625,16 +2625,9 @@ void Person::DoAnimations()
                     if (weaponactive != -1) {
                         escapednum = 0;
                         XYZ aim;
-                        weapons[weaponids[0]].owner = -1;
                         aim = victim->coords + DoRotation(victim->jointPos(abdomen), 0, victim->yaw, 0) * victim->scale + victim->velocity * findDistance(&victim->coords, &coords) / 50 - (coords + DoRotation(jointPos(righthand), 0, yaw, 0) * scale);
                         Normalise(&aim);
-                        weapons[weaponids[0]].velocity = aim * 50;
-                        weapons[weaponids[0]].tipvelocity = aim * 50;
-                        weapons[weaponids[0]].missed = 0;
-                        weapons[weaponids[0]].hitsomething = 0;
-                        weapons[weaponids[0]].freetime = 0;
-                        weapons[weaponids[0]].firstfree = 1;
-                        weapons[weaponids[0]].physics = 0;
+                        weapons[weaponids[0]].thrown(aim * 50);
                         num_weapons--;
                         if (num_weapons) {
                             weaponids[0] = weaponids[num_weapons];