- don't use picnum to address gs.actorinfo

This commit is contained in:
Christoph Oelckers 2022-12-30 19:21:22 +01:00
parent b56aa1e1a3
commit 2f78a10ce1
3 changed files with 7 additions and 5 deletions

View file

@ -109,7 +109,7 @@ bool RRRAFullbrightHack(tspritetype* t, int k)
void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAngle viewang)
{
if (gs.actorinfo[h->spr.picnum].scriptaddress && !(h->flags2 & SFLAG2_DONTANIMATE))// && (t->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB)
if (GetActorInfo(h)->scriptaddress && !(h->flags2 & SFLAG2_DONTANIMATE))// && (t->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB)
{
DAngle kang;
auto action = h->curAction;

View file

@ -1162,10 +1162,6 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
if (bSet) act->spr.cstat = ESpriteFlags::FromInt(lValue);
else SetGameVarID(lVar2, act->spr.cstat, sActor, sPlayer);
break;
case ACTOR_PICNUM:
if (bSet) act->spr.picnum = lValue;
else SetGameVarID(lVar2, act->spr.picnum, sActor, sPlayer);
break;
case ACTOR_SHADE:
if (bSet) act->spr.shade = lValue;
else SetGameVarID(lVar2, act->spr.shade, sActor, sPlayer);

View file

@ -292,6 +292,12 @@ inline void processinputvel(int snum)
p->sync.svel = (float)velvect.Y;
}
inline ActorInfo* GetActorInfo(DDukeActor* actor)
{
auto cls = static_cast<PClassActor*>(actor->GetClass());
return &gs.actorinfo[cls->ActorInfo()->TypeNum];
}
inline const ActorInfo* DDukeActor::conInfo() const
{
auto tn = static_cast<PClassActor*>(GetClass())->ActorInfo()->TypeNum;