- proper way to get player actor.

This commit is contained in:
Christoph Oelckers 2021-09-04 12:28:27 +02:00
parent 1cb98593f1
commit ff9a86b7b4

View file

@ -1064,7 +1064,7 @@ void WeaponUpdateState(PLAYER *pPlayer)
void FirePitchfork(int, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
Aim *aim = &pPlayer->aim;
int r1 = Random2(2000);
int r2 = Random2(2000);
@ -1205,7 +1205,7 @@ enum { kMaxShotgunBarrels = 4 };
void FireShotgun(int nTrigger, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
assert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels);
if (nTrigger == 1)
{
@ -1252,7 +1252,7 @@ void EjectShell(int, PLAYER *pPlayer)
void FireTommy(int nTrigger, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
Aim *aim = &pPlayer->aim;
sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0);
switch (nTrigger)
@ -1291,7 +1291,7 @@ enum { kMaxSpread = 14 };
void FireSpread(int nTrigger, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
Aim *aim = &pPlayer->aim;
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
@ -1313,7 +1313,7 @@ void FireSpread(int nTrigger, PLAYER *pPlayer)
void AltFireSpread(int nTrigger, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
Aim *aim = &pPlayer->aim;
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
@ -1343,7 +1343,7 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer)
void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
Aim *aim = &pPlayer->aim;
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
@ -1752,7 +1752,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer)
void FireBeast(int , PLAYER * pPlayer)
{
auto actor = &bloodActors[pPlayer->pSprite->index];
auto actor = pPlayer->actor();
int r1 = Random2(2000);
int r2 = Random2(2000);
int r3 = Random2(2000);