- Duke: Clean up player/actor accesses in addweapon_d.cpp.

This commit is contained in:
Mitchell Richters 2023-10-02 21:14:55 +11:00
parent 95d5e1f57d
commit fe5581f3cf

View file

@ -77,6 +77,7 @@ void addweapon_d(DukePlayer *p, int weapon, bool wswitch)
p->curr_weapon = weapon; p->curr_weapon = weapon;
p->wantweaponfire = -1; p->wantweaponfire = -1;
const auto pact = p->GetActor();
switch (weapon) switch (weapon)
{ {
case KNEE_WEAPON: case KNEE_WEAPON:
@ -85,13 +86,13 @@ void addweapon_d(DukePlayer *p, int weapon, bool wswitch)
case HANDBOMB_WEAPON: case HANDBOMB_WEAPON:
break; break;
case SHOTGUN_WEAPON: case SHOTGUN_WEAPON:
S_PlayActorSound(SHOTGUN_COCK, p->GetActor()); S_PlayActorSound(SHOTGUN_COCK, pact);
break; break;
case PISTOL_WEAPON: case PISTOL_WEAPON:
S_PlayActorSound(INSERT_CLIP, p->GetActor()); S_PlayActorSound(INSERT_CLIP, pact);
break; break;
default: default:
S_PlayActorSound(SELECT_WEAPON, p->GetActor()); S_PlayActorSound(SELECT_WEAPON, pact);
break; break;
} }
} }