mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- reworked non-functional anim detection when picking up an item.
This would not unregister the item's run list entries because the logic was insufficient.
This commit is contained in:
parent
43fdc1bb56
commit
afec39aded
4 changed files with 10 additions and 3 deletions
|
@ -111,6 +111,8 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, int x, int y,
|
|||
pActor->nIndex = 0;
|
||||
pActor->nIndex2 = SeqOffsets[val] + val2;
|
||||
pActor->pTarget = nullptr;
|
||||
pActor->nDamage = pActor->nRun;
|
||||
pActor->nPhase = ITEM_MAGIC;
|
||||
|
||||
if (nFlag & 0x80) {
|
||||
pSprite->cstat |= 0x2; // set transluscence
|
||||
|
|
|
@ -39,6 +39,8 @@ BEGIN_PS_NS
|
|||
|
||||
enum { kTimerTicks = 120 };
|
||||
|
||||
const int ITEM_MAGIC = 0x4711;
|
||||
|
||||
enum basepal_t {
|
||||
BASEPAL = 0,
|
||||
ANIMPAL,
|
||||
|
|
|
@ -146,7 +146,7 @@ void BuildItemAnim(DExhumedActor* pActor)
|
|||
|
||||
void DestroyItemAnim(DExhumedActor* actor)
|
||||
{
|
||||
if (actor && actor->s().owner == 0)
|
||||
if (actor && actor->s().owner >= 0)
|
||||
DestroyAnim(actor);
|
||||
}
|
||||
|
||||
|
|
|
@ -1349,7 +1349,10 @@ sectdone:
|
|||
// CHECKME - is order of evaluation correct?
|
||||
if (!mplevel || (var_70 >= 25 && (var_70 <= 25 || var_70 == 50)))
|
||||
{
|
||||
DestroyItemAnim(pActorB);
|
||||
// If this is an anim we need to properly destroy it so we need to do some proper detection and not wild guesses.
|
||||
if (pActorB->nRun == pActorB->nDamage && pActorB->nRun != 0 && pActorB->nPhase == ITEM_MAGIC)
|
||||
DestroyAnim(pActorB);
|
||||
else
|
||||
DeleteActor(pActorB);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue