mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 21:20:39 +00:00
- Exhumed: fixed surace collisions of projectiles.
There was some commented out undefined behavior here, we need to properly define this case.
This commit is contained in:
parent
30adac6e7f
commit
0e89bffabd
1 changed files with 7 additions and 22 deletions
|
@ -379,39 +379,23 @@ MOVEEND:
|
|||
z2 = pActor->spr.pos.Z;
|
||||
pHitSect = pActor->sector();
|
||||
|
||||
#if 0
|
||||
// Original code. This was producing some beautiful undefined behavior in the first case because the index can be anything, not just a wall.
|
||||
if (coll.exbits)
|
||||
{
|
||||
hitwall = coll & 0x3FFF;
|
||||
goto HITWALL;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (coll & 0xc000)
|
||||
{
|
||||
case 0x8000:
|
||||
hitwall = coll & 0x3FFF;
|
||||
goto HITWALL;
|
||||
case 0xc000:
|
||||
hitsprite = coll & 0x3FFF;
|
||||
goto HITSPRITE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
switch (coll.type)
|
||||
{
|
||||
case kHitWall:
|
||||
pHitWall = coll.hitWall;
|
||||
goto HITWALL;
|
||||
case 0xc000:
|
||||
case kHitSprite:
|
||||
if (!coll.exbits)
|
||||
{
|
||||
hitactor = coll.actor();
|
||||
goto HITSPRITE;
|
||||
}
|
||||
default:
|
||||
if (coll.exbits)
|
||||
goto HITSECT;
|
||||
break;
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
nVal = coll.type || coll.exbits? 1:0;
|
||||
|
@ -503,6 +487,7 @@ HITSPRITE:
|
|||
}
|
||||
}
|
||||
|
||||
HITSECT:
|
||||
if (pHitSect != nullptr) // NOTE: hitsect can be -1. this check wasn't in original code. TODO: demo compatiblity?
|
||||
{
|
||||
if (hitactor == nullptr && pHitWall == nullptr)
|
||||
|
|
Loading…
Reference in a new issue