hedgewars/uGears.pas
changeset 3483 54ff8cbabaa6
parent 3480 c4c3f3512404
child 3485 ab91c56a9050
--- a/hedgewars/uGears.pas	Fri May 28 13:04:11 2010 +0000
+++ b/hedgewars/uGears.pas	Fri May 28 16:21:54 2010 +0000
@@ -128,6 +128,15 @@
 procedure HHSetWeapon(Gear: PGear); forward;
 procedure doStepCase(Gear: PGear); forward;
 
+function GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt;
+begin
+    GetLaunchX:= dir * (8 + hwRound(AngleSin(angle) * Ammoz[at].ejectX) + hwRound(AngleCos(angle) * Ammoz[at].ejectY))
+end;
+
+function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
+begin
+    GetLaunchY:= hwRound(AngleSin(angle) * Ammoz[at].ejectY) - hwRound(AngleCos(angle) * Ammoz[at].ejectX) - 2;
+end;
 
 {$INCLUDE "GSHandlers.inc"}
 {$INCLUDE "HHHandlers.inc"}