Fix VTOLs flying at strange angles. Patch by Safety0ff.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9472 4a71c877-e1ca-e34f-864e-861f7616d084
master
Cyp 2010-01-24 18:25:27 +00:00 committed by Git SVN Gateway
parent 8fc2196f14
commit f9e3b1eb85
3 changed files with 15 additions and 5 deletions

View File

@ -3731,6 +3731,13 @@ BOOL isVtolDroid(const DROID* psDroid)
&& psDroid->droidType != DROID_TRANSPORTER;
}
/*returns true if the droid has lift propulsion and is above the ground level*/
BOOL isFlying(const DROID* psDroid)
{
return (asPropulsionStats + psDroid->asBits[COMP_PROPULSION].nStat)->propulsionType == PROPULSION_TYPE_LIFT
&& psDroid->sMove.Status != MOVEINACTIVE;
}
/* returns true if it's a VTOL weapon droid which has completed all runs */
BOOL vtolEmpty(DROID *psDroid)
{

View File

@ -319,6 +319,8 @@ extern BASE_OBJECT * checkForRepairRange(DROID *psDroid,DROID *psTarget);
//access function
extern BOOL isVtolDroid(const DROID* psDroid);
/*returns true if the droid has lift propulsion and is above the ground level*/
extern BOOL isFlying(const DROID* psDroid);
/*returns true if a VTOL weapon droid which has completed all runs*/
extern BOOL vtolEmpty(DROID *psDroid);
/*returns true if a VTOL weapon droid which still has full ammo*/

View File

@ -659,9 +659,10 @@ void updateDroidOrientation(DROID *psDroid)
double dx, dy;
double direction, pitch, roll;
if(psDroid->droidType == DROID_PERSON || cyborgDroid(psDroid) || psDroid->droidType == DROID_TRANSPORTER)
if(psDroid->droidType == DROID_PERSON || cyborgDroid(psDroid) || psDroid->droidType == DROID_TRANSPORTER
|| isFlying(psDroid))
{
/* These guys always stand upright */
/* The ground doesn't affect the pitch/roll of these droids*/
return;
}
@ -2671,9 +2672,6 @@ static BOOL moveDescending( DROID *psDroid )
/* on floor - stop */
psDroid->sMove.iVertSpeed = 0;
/* conform to terrain */
updateDroidOrientation(psDroid);
/* return false to show stopped descending */
return false;
}
@ -3157,6 +3155,9 @@ void moveUpdateDroid(DROID *psDroid)
{
/* reset move state */
psDroid->sMove.Status = MOVEINACTIVE;
/* conform to terrain */
updateDroidOrientation(psDroid);
}
break;
// Driven around by the player.