From 5158bd57d22cb2da6e7eaf6a2ccddae4e9287d58 Mon Sep 17 00:00:00 2001 From: gez Date: Sat, 10 Dec 2011 21:32:54 +0000 Subject: [PATCH] * Updated to ZDoom r3322: - When a missile teleports, maintain velocity on the other end. * Unversioned and ignored gdtoa user file. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1270 b0f79afe-0144-0410-b225-9a4edf0717df --- .../gdtoa.vcproj.Christoph-PC.Christoph.user | 65 ------------------- src/p_teleport.cpp | 9 ++- src/svnrevision.h | 4 +- 3 files changed, 9 insertions(+), 69 deletions(-) delete mode 100644 gdtoa/gdtoa.vcproj.Christoph-PC.Christoph.user diff --git a/gdtoa/gdtoa.vcproj.Christoph-PC.Christoph.user b/gdtoa/gdtoa.vcproj.Christoph-PC.Christoph.user deleted file mode 100644 index f8282408..00000000 --- a/gdtoa/gdtoa.vcproj.Christoph-PC.Christoph.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index e6d1a08b..cc31358a 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -110,6 +110,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, sector_t *destsect; bool resetpitch = false; fixed_t floorheight, ceilingheight; + fixed_t missilespeed; oldx = thing->x; oldy = thing->y; @@ -122,6 +123,10 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, player = NULL; floorheight = destsect->floorplane.ZatPoint (x, y); ceilingheight = destsect->ceilingplane.ZatPoint (x, y); + if (thing->flags & MF_MISSILE) + { // We don't measure z velocity, because it doesn't change. + missilespeed = xs_CRoundToInt(TVector2(thing->velx, thing->vely).Length()); + } if (keepHeight) { z = floorheight + aboveFloor; @@ -210,8 +215,8 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, if (thing->flags & MF_MISSILE) { angle >>= ANGLETOFINESHIFT; - thing->velx = FixedMul (thing->Speed, finecosine[angle]); - thing->vely = FixedMul (thing->Speed, finesine[angle]); + thing->velx = FixedMul (missilespeed, finecosine[angle]); + thing->vely = FixedMul (missilespeed, finesine[angle]); } // [BC] && bHaltVelocity. else if (!keepOrientation && bHaltVelocity) // no fog doesn't alter the player's momentum diff --git a/src/svnrevision.h b/src/svnrevision.h index e52a37b8..2060dd22 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "3321" -#define ZD_SVN_REVISION_NUMBER 3321 +#define ZD_SVN_REVISION_STRING "3322" +#define ZD_SVN_REVISION_NUMBER 3322