mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-14 16:40:46 +00:00
- SW: account for invalid player actors being passed to the sound engine.
This commit is contained in:
parent
1f489d5dbe
commit
7262184d53
1 changed files with 10 additions and 1 deletions
|
@ -529,7 +529,16 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
|
||||||
}
|
}
|
||||||
else if (type == SOURCE_Actor || type == SOURCE_Player)
|
else if (type == SOURCE_Actor || type == SOURCE_Player)
|
||||||
{
|
{
|
||||||
vPos = type == SOURCE_Actor ? ((DSWActor*)source)->spr.pos : ((PLAYER*)source)->actor->getPosWithOffsetZ();
|
if (type == SOURCE_Actor)
|
||||||
|
{
|
||||||
|
vPos = ((DSWActor*)source)->spr.pos;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto act = ((PLAYER*)source)->actor;
|
||||||
|
if (act) vPos = act->getPosWithOffsetZ();
|
||||||
|
else vPos = pp->actor->getPosWithOffsetZ();
|
||||||
|
}
|
||||||
pancheck = true;
|
pancheck = true;
|
||||||
FVector3 npos = GetSoundPos(vPos);
|
FVector3 npos = GetSoundPos(vPos);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue