- 5 newstatus calls + 3 deletesprite calls.

This commit is contained in:
Christoph Oelckers 2021-11-14 17:37:34 +01:00
parent 858ac6bf35
commit 2b73adb5a5
5 changed files with 8 additions and 8 deletions

View file

@ -264,14 +264,14 @@ void aiProcess() {
if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) { if (bcos(spr.ang) * (plr.x - spr.x) + bsin(spr.ang) * (plr.y - spr.y) >= 0) {
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7), if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum)) { spr.sectnum)) {
newstatus(i, CHASE); SetNewStatus(actor, CHASE);
} }
} }
else if (moveStat.type != kHitNone) { else if (moveStat.type != kHitNone) {
if (moveStat.type == kHitWall) { // hit a wall if (moveStat.type == kHitWall) { // hit a wall
actoruse(i); actoruse(i);
} }
newstatus(i, FINDME); SetNewStatus(actor, FINDME);
} }
} }

View file

@ -282,7 +282,7 @@ void nukespell(PLAYER& plr, short const j) {
switch (spr.detail) { switch (spr.detail) {
case WILLOWTYPE: case WILLOWTYPE:
case SPIDERTYPE: case SPIDERTYPE:
deletesprite((short) j); DeleteActor(actor);
addscore(&plr, 10); addscore(&plr, 10);
break; break;
case KOBOLDTYPE: case KOBOLDTYPE:

View file

@ -238,7 +238,7 @@ void animateobjs(PLAYER& plr) {
spr.cstat = 0x303; spr.cstat = 0x303;
spr.pal = 0; spr.pal = 0;
spr.extra = 12; spr.extra = 12;
newstatus((short) i, EVILSPIRIT); SetNewStatus(actor, EVILSPIRIT);
} }
} }

View file

@ -1081,9 +1081,9 @@ void weaponpowerup(PLAYER& plr) {
int j = actor->GetSpriteIndex(); int j = actor->GetSpriteIndex();
if (tspr.picnum == CONE) { if (tspr.picnum == CONE) {
deletesprite(j); DeleteActor(actor);
} else if (tspr.picnum == SPARKBALL) { } else if (tspr.picnum == SPARKBALL) {
deletesprite(j); DeleteActor(actor);
} }
} }
} }

View file

@ -28,7 +28,7 @@ void operatesprite(PLAYER& plr, short s) {
auto actor = &whActors[s]; auto actor = &whActors[s];
auto& spr = actor->s(); auto& spr = actor->s();
if (spr.picnum == SPAWNFIREBALL) if (spr.picnum == SPAWNFIREBALL)
newstatus(s, DEVILFIRE); SetNewStatus(actor, DEVILFIRE);
if (spr.picnum == SPAWNJAVLIN) if (spr.picnum == SPAWNJAVLIN)
trowajavlin(s); trowajavlin(s);
@ -42,7 +42,7 @@ void operatesprite(PLAYER& plr, short s) {
break; break;
case GONZOHMJUMP: case GONZOHMJUMP:
case GONZOSHJUMP: case GONZOSHJUMP:
newstatus((short) s, AMBUSH); SetNewStatus(actor, AMBUSH);
break; break;
case STAINGLASS1: case STAINGLASS1:
case STAINGLASS2: case STAINGLASS2: