mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
PCExhumed: MoveSector() updates player position variables. Fixes #366
This commit is contained in:
parent
714ed1ecdd
commit
86f2a7a578
1 changed files with 13 additions and 2 deletions
|
@ -507,7 +507,6 @@ int GetSpriteHeight(int nSprite)
|
|||
return tilesiz[sprite[nSprite].picnum].y * sprite[nSprite].yrepeat * 4;
|
||||
}
|
||||
|
||||
// TODO - where is ceildist used?
|
||||
int movesprite(short nSprite, int dx, int dy, int dz, int UNUSED(ceildist), int flordist, unsigned int clipmask)
|
||||
{
|
||||
spritetype *pSprite = &sprite[nSprite];
|
||||
|
@ -588,7 +587,6 @@ int movesprite(short nSprite, int dx, int dy, int dz, int UNUSED(ceildist), int
|
|||
return nRet;
|
||||
}
|
||||
|
||||
// OK
|
||||
void Gravity(short nSprite)
|
||||
{
|
||||
short nSector = sprite[nSprite].sectnum;
|
||||
|
@ -1084,6 +1082,19 @@ void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel)
|
|||
|
||||
*nXVel = xvect;
|
||||
*nYVel = yvect;
|
||||
|
||||
/*
|
||||
Update player position variables, in case the player sprite was moved by a sector,
|
||||
Otherwise these can be out of sync when used in sound code (before being updated in PlayerFunc()).
|
||||
Can cause local player sounds to play off-centre.
|
||||
TODO: Might need to be done elsewhere too?
|
||||
*/
|
||||
int nPlayerSprite = PlayerList[nLocalPlayer].nSprite;
|
||||
initx = sprite[nPlayerSprite].x;
|
||||
inity = sprite[nPlayerSprite].y;
|
||||
initz = sprite[nPlayerSprite].z;
|
||||
inita = sprite[nPlayerSprite].ang;
|
||||
initsect = sprite[nPlayerSprite].sectnum;
|
||||
}
|
||||
|
||||
void SetQuake(short nSprite, int nVal)
|
||||
|
|
Loading…
Reference in a new issue