mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- use collision struct in ActorMoveHitReact
This commit is contained in:
parent
2a897c0582
commit
ec9ab56ece
3 changed files with 14 additions and 31 deletions
|
@ -699,10 +699,6 @@ enum EHitBits
|
|||
kHitSector = 0x4000,
|
||||
kHitWall = 0x8000,
|
||||
kHitSprite = 0xC000,
|
||||
kHitSky = 0x10000, // SW only
|
||||
kHitFloor = 0x18000, // Exhumed only
|
||||
kHitCeiling = 0x1c000, // Exhumed only
|
||||
|
||||
};
|
||||
|
||||
void updateModelInterpolation();
|
||||
|
|
|
@ -118,42 +118,22 @@ bool ActorMoveHitReact(DSWActor* actor)
|
|||
// Should only return true if there is a reaction to what was hit that
|
||||
// would cause the calling function to abort
|
||||
|
||||
switch (TEST(u->ret, HIT_MASK))
|
||||
auto coll = u->hitCode();
|
||||
if (coll.type == kHitSprite)
|
||||
{
|
||||
case HIT_SPRITE:
|
||||
{
|
||||
short HitSprite = NORM_SPRITE(u->ret);
|
||||
USERp hu;
|
||||
ANIMATORp action;
|
||||
|
||||
hu = User[HitSprite].Data();
|
||||
|
||||
|
||||
// if you ran into a player - call close range functions
|
||||
if (hu && hu->PlayerP)
|
||||
auto hitActor = coll.actor;
|
||||
if (hitActor->hasU() && hitActor->u()->PlayerP)
|
||||
{
|
||||
// if you ran into a player - call close range functions
|
||||
DoActorPickClosePlayer(SpriteNum);
|
||||
action = ChooseAction(u->Personality->TouchTarget);
|
||||
auto action = ChooseAction(u->Personality->TouchTarget);
|
||||
if (action)
|
||||
{
|
||||
(*action)(actor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case HIT_WALL:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case HIT_SECTOR:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,13 @@ public:
|
|||
};
|
||||
|
||||
|
||||
enum EHitBitsSW
|
||||
{
|
||||
kHitTypeMaskSW = 0x1C000,
|
||||
kHitSky = 0x10000, // SW only
|
||||
};
|
||||
|
||||
|
||||
// Wrapper around the insane collision info mess from Build.
|
||||
struct Collision
|
||||
{
|
||||
|
@ -185,7 +192,7 @@ struct Collision
|
|||
int setFromEngine(int value)
|
||||
{
|
||||
legacyVal = value;
|
||||
type = value & kHitTypeMask;
|
||||
type = value & kHitTypeMaskSW;
|
||||
if (type == 0) { index = -1; actor = nullptr; }
|
||||
else if (type != kHitSprite) { index = value & kHitIndexMask; actor = nullptr; }
|
||||
else { index = -1; actor = &swActors[value & kHitIndexMask]; }
|
||||
|
|
Loading…
Reference in a new issue