summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorTom Overton <tom-overton@users.noreply.github.com>2022-10-14 21:35:55 -0700
committerGitHub <noreply@github.com>2022-10-15 05:35:55 +0100
commit638f5062cbf6e9289f624cbdeee918d35642fb3a (patch)
treebf2f2c1d2503841bc50be5dca9d2414b4b7e6cb0 /src/code
parenta38f45b26884078f6ac7f30fade35f313f8dcf98 (diff)
Replace `Actor_MarkForDeath` with `Actor_Kill` (#1118)
* Replace `Actor_MarkForDeath` with `Actor_Kill` * Replace if-else with early returns, as per hensldm's review * Respond to Elliptic's review * Redundant spelling
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_actor.c10
-rw-r--r--src/code/z_en_item00.c12
2 files changed, 11 insertions, 11 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 01894f269..52b113c76 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -1026,7 +1026,7 @@ void* func_800B6680(PlayState* play, s16 id) {
return NULL;
}
-void Actor_MarkForDeath(Actor* actor) {
+void Actor_Kill(Actor* actor) {
actor->draw = NULL;
actor->update = NULL;
actor->flags &= ~ACTOR_FLAG_1;
@@ -2346,7 +2346,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
}
} else {
if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
- Actor_MarkForDeath(actor);
+ Actor_Kill(actor);
} else {
s32 tmp = (params->unk_08 == 0);
@@ -2872,7 +2872,7 @@ void func_800BA6FC(PlayState* play, ActorContext* actorCtx) {
while (actor != NULL) {
if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
- Actor_MarkForDeath(actor);
+ Actor_Kill(actor);
}
actor = actor->next;
@@ -2896,7 +2896,7 @@ void func_800BA798(PlayState* play, ActorContext* actorCtx) {
if (!actor->isDrawn) {
actor = Actor_Delete(actorCtx, actor, play);
} else {
- Actor_MarkForDeath(actor);
+ Actor_Kill(actor);
Actor_Destroy(actor, play);
actor = actor->next;
}
@@ -2925,7 +2925,7 @@ void func_800BA8B8(PlayState* play, ActorContext* actorCtx) {
if (!actor->isDrawn) {
actor = Actor_Delete(actorCtx, actor, play);
} else {
- Actor_MarkForDeath(actor);
+ Actor_Kill(actor);
Actor_Destroy(actor, play);
actor = actor->next;
}
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index d6ab737c7..a07e31e2f 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -86,7 +86,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
this->collectibleFlag = 0;
this->actor.params = ITEM00_RECOVERY_HEART;
} else {
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
return;
}
}
@@ -358,7 +358,7 @@ void func_800A640C(EnItem00* this, PlayState* play) {
if (this->unk152 == 0) {
if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) &&
(this->actor.params != ITEM00_HEART_CONTAINER)) {
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
}
}
@@ -464,7 +464,7 @@ void func_800A6A40(EnItem00* this, PlayState* play) {
}
if (this->unk152 == 0) {
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
return;
}
@@ -510,7 +510,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 15.0f, 15.0f, 0x1D);
if (this->actor.floorHeight <= BGCHECK_Y_MIN) {
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
return;
}
}
@@ -659,7 +659,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
case ITEM00_COMPASS:
if (Actor_HasParent(&this->actor, play)) {
Flags_SetCollectible(play, this->collectibleFlag);
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
}
return;
@@ -672,7 +672,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
} else if (getItemId != GI_NONE) {
if (Actor_HasParent(&this->actor, play)) {
Flags_SetCollectible(play, this->collectibleFlag);
- Actor_MarkForDeath(&this->actor);
+ Actor_Kill(&this->actor);
}
return;
} else {