- Exhumed: Set opos for all dynamically spawned sprites.

Fixes #253

Let's hope this covers everything, the code is a bit scattered...
This commit is contained in:
Christoph Oelckers 2021-02-27 00:16:03 +01:00
parent ba5ede65b8
commit e470c59263
8 changed files with 13 additions and 0 deletions

View file

@ -118,6 +118,7 @@ int BuildAnim(int nSprite, int val, int val2, int x, int y, int z, int nSector,
sprite[nSprite].xvel = 0;
sprite[nSprite].yvel = 0;
sprite[nSprite].zvel = 0;
sprite[nSprite].backuppos();
// CHECKME - where is hitag set otherwise?
if (sprite[nSprite].statnum < 900) {

View file

@ -146,6 +146,7 @@ int BuildBubble(int x, int y, int z, short nSector)
sprite[nSprite].hitag = -1;
sprite[nSprite].extra = -1;
sprite[nSprite].lotag = runlist_HeadRun() + 1;
sprite[nSprite].backuppos();
// GrabTimeSlot(3);

View file

@ -691,6 +691,7 @@ int BuildBullet(short nSprite, int nType, int, int, int val1, int nAngle, int va
pBullet->field_8 = runlist_AddRunRec(NewRun, nBullet | 0xB0000);
pBullet->field_13 = val3;
sprite[nBulletSprite].z += val1;
sprite[nBulletSprite].backuppos();
int var_18;

View file

@ -566,6 +566,7 @@ void mydeletesprite(int nSprite)
soundEngine->RelinkSound(SOURCE_Actor, &sprite[nSprite], nullptr, &pos);
deletesprite(nSprite);
sprite[nSprite].ox = 0x80000000;
if (nSprite == besttarget) {
besttarget = -1;

View file

@ -188,6 +188,7 @@ int BuildGrenade(int nPlayer)
sprite[nSprite].hitag = 0;
sprite[nSprite].lotag = runlist_HeadRun() + 1;
sprite[nSprite].extra = -1;
sprite[nSprite].backuppos();
// GrabTimeSlot(3);

View file

@ -1117,6 +1117,7 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in
sprite[nSprite].x = wall[nStartWall].x;
sprite[nSprite].y = wall[nStartWall].y;
sprite[nSprite].z = sector[nSector].floorz;
sprite[nSprite].backuppos();
SlideData[nSlide].field_8a = 0;
@ -1363,6 +1364,8 @@ int BuildTrap(int nSprite, int edx, int ebx, int ecx)
ecx++;
nWall++;
}
sprite[nSprite].backuppos();
}
void FuncTrap(int a, int, int nRun)
@ -1545,6 +1548,7 @@ int BuildSpark(int nSprite, int nVal)
spr->lotag = runlist_HeadRun() + 1;
spr->clipdist = 1;
spr->hitag = 0;
spr->backuppos();
// GrabTimeSlot(3);
@ -1754,6 +1758,7 @@ int BuildEnergyBlock(short nSector)
spr->lotag = runlist_HeadRun() + 1;
spr->hitag = 0;
spr->owner = runlist_AddRunRec(spr->lotag - 1, nSprite | 0x250000);
spr->backuppos();
nEnergyBlocks++;
@ -2025,6 +2030,7 @@ int BuildObject(int const nSprite, int nOjectType, int nHitag)
ObjectList[nObject].field_10 = -nHitag;
}
}
spr->backuppos();
return nObject | 0x170000;
}

View file

@ -454,6 +454,7 @@ int BuildQueenEgg(short nQueen, int nVal)
sprite[nSprite2].shade = -12;
sprite[nSprite2].picnum = 1;
sprite[nSprite2].ang = (RandomSize(9) + (nAngle - 256)) & kAngleMask;
sprite[nSprite2].backuppos();
if (!nVal)
{

View file

@ -225,6 +225,7 @@ int BuildSnake(short nPlayer, short zVal)
sprite[nSprite].hitag = 0;
sprite[nSprite].extra = -1;
sprite[nSprite].lotag = runlist_HeadRun() + 1;
sprite[nSprite].backuppos();
SnakeList[nSnake].nSprites[i] = nSprite;