mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- Gravity function.
This commit is contained in:
parent
5234481370
commit
9ef4f0fa99
3 changed files with 7 additions and 9 deletions
|
@ -221,11 +221,7 @@ void MoveThings();
|
||||||
void ResetMoveFifo();
|
void ResetMoveFifo();
|
||||||
void InitChunks();
|
void InitChunks();
|
||||||
void InitPushBlocks();
|
void InitPushBlocks();
|
||||||
void Gravity(short nSprite);
|
void Gravity(DExhumedActor* actor);
|
||||||
inline void Gravity(DExhumedActor* actor)
|
|
||||||
{
|
|
||||||
Gravity(actor->GetSpriteIndex());
|
|
||||||
}
|
|
||||||
short UpdateEnemy(short *nEnemy);
|
short UpdateEnemy(short *nEnemy);
|
||||||
DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy)
|
DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy)
|
||||||
{
|
{
|
||||||
|
|
|
@ -612,9 +612,9 @@ int movesprite(short nSprite, int dx, int dy, int dz, int, int flordist, unsigne
|
||||||
return nRet;
|
return nRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gravity(short nSprite)
|
void Gravity(DExhumedActor* actor)
|
||||||
{
|
{
|
||||||
auto pSprite = &sprite[nSprite];
|
auto pSprite = &actor->s();
|
||||||
short nSector = pSprite->sectnum;
|
short nSector = pSprite->sectnum;
|
||||||
|
|
||||||
if (SectFlag[nSector] & kSectUnderwater)
|
if (SectFlag[nSector] & kSectUnderwater)
|
||||||
|
@ -1503,9 +1503,10 @@ void AICreatureChunk::Tick(RunListEvent* ev)
|
||||||
{
|
{
|
||||||
int nSprite = RunData[ev->nRun].nObjIndex;
|
int nSprite = RunData[ev->nRun].nObjIndex;
|
||||||
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
|
auto pActor = &exhumedActors[nSprite];
|
||||||
auto pSprite = &sprite[nSprite];
|
auto pSprite = &sprite[nSprite];
|
||||||
|
|
||||||
Gravity(nSprite);
|
Gravity(pActor);
|
||||||
|
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
pSprite->pal = sector[nSector].ceilingpal;
|
pSprite->pal = sector[nSector].ceilingpal;
|
||||||
|
|
|
@ -2042,6 +2042,7 @@ void AIObject::Tick(RunListEvent* ev)
|
||||||
short nObject = RunData[ev->nRun].nObjIndex;
|
short nObject = RunData[ev->nRun].nObjIndex;
|
||||||
auto pObject = &ObjectList[nObject];
|
auto pObject = &ObjectList[nObject];
|
||||||
|
|
||||||
|
auto pActor = &exhumedActors[pObject->nSprite];// ev->pObjActor;
|
||||||
short nSprite = pObject->nSprite;
|
short nSprite = pObject->nSprite;
|
||||||
auto pSprite = &sprite[nSprite];
|
auto pSprite = &sprite[nSprite];
|
||||||
short nStat = pSprite->statnum;
|
short nStat = pSprite->statnum;
|
||||||
|
@ -2052,7 +2053,7 @@ void AIObject::Tick(RunListEvent* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nStat != kStatExplodeTarget) {
|
if (nStat != kStatExplodeTarget) {
|
||||||
Gravity(nSprite);
|
Gravity(pActor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// do animation
|
// do animation
|
||||||
|
|
Loading…
Reference in a new issue