foxygit / doom Log in
commit 2ff89acb8fac478f1bea14054e4e43882516e4f9
Author:     Samuel Villareal <svkaiser@gmail.com>
AuthorDate: Mon Sep 6 21:51:41 2010 +0000
Commit:     Samuel Villareal <svkaiser@gmail.com>
CommitDate: Mon Sep 6 21:51:41 2010 +0000

    + P_ThrustMobj implemented

    Subversion-branch: /branches/strife-branch
    Subversion-revision: 2023
---
 src/strife/p_enemy.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index 2d47d6af..e62f6bd6 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -2336,6 +2336,20 @@ void A_SpawnEntity(mobj_t* actor)

 }

+//
+// P_ThrustMobj
+// villsa [STRIFE] new function
+// Thrusts an thing in a specified force/direction
+// Beware! This is inlined everywhere in the asm
+//
+
+void P_ThrustMobj(mobj_t *actor, angle_t angle, fixed_t force)
+{
+    angle_t an = angle >> ANGLETOFINESHIFT;
+    actor->momx += FixedMul(finecosine[an], force);
+    actor->momy += FixedMul(finesine[an], force);
+}
+
 void A_EntityDeath(mobj_t* actor)
 {