summaryrefslogtreecommitdiff
path: root/src/code/z_actor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/code/z_actor.c')
-rw-r--r--src/code/z_actor.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index aec121001..c3e445f8c 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -1997,10 +1997,8 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
player = PLAYER;
if (0) {
- // This assert is optimized out but it exists due to its presence in rodata
- if (gMaxActorId != ACTOR_ID_MAX) {
- __assert("MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE);
- }
+ // This ASSERT is optimized out but it exists due to its presence in rodata
+ ASSERT(gMaxActorId == ACTOR_ID_MAX, "MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE);
}
sp74 = NULL;
@@ -2390,9 +2388,8 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) {
if ((actor->flags & 0x80) &&
((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) ||
(actor->room != globalCtx->roomCtx.curRoom.num))) {
- if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX) {
- __assert("invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464);
- }
+ ASSERT(invisibleActorCounter < INVISIBLE_ACTOR_MAX,
+ "invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464);
invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++;
} else {
@@ -2632,10 +2629,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
u32 overlaySize;
overlayEntry = &gActorOverlayTable[actorId];
-
- if (actorId >= ACTOR_ID_MAX) {
- __assert("profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
- }
+ ASSERT(actorId < ACTOR_ID_MAX, "profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
name = overlayEntry->name != NULL ? overlayEntry->name : "";
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
@@ -2666,9 +2660,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
}
} else {
if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
- if (overlaySize > AM_FIELD_SIZE) {
- __assert("actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
- }
+ ASSERT(overlaySize <= AM_FIELD_SIZE, "actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
if (actorCtx->absoluteSpace == NULL) {
// Translates to: "AMF: ABSOLUTE MAGIC FIELD"
@@ -2732,9 +2724,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
return NULL;
}
- if (overlayEntry->nbLoaded >= 255) {
- __assert("actor_dlftbl->clients < 255", "../z_actor.c", 7031);
- }
+ ASSERT(overlayEntry->nbLoaded < 255, "actor_dlftbl->clients < 255", "../z_actor.c", 7031);
overlayEntry->nbLoaded++;
@@ -2873,14 +2863,8 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
osSyncPrintf("オーバーレイではありません\n");
}
} else {
- if (overlayEntry->loadedRamAddr == NULL) {
- __assert("actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
- }
-
- if (overlayEntry->nbLoaded <= 0) {
- __assert("actor_dlftbl->clients > 0", "../z_actor.c", 7252);
- }
-
+ ASSERT(overlayEntry->loadedRamAddr != NULL, "actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
+ ASSERT(overlayEntry->nbLoaded > 0, "actor_dlftbl->clients > 0", "../z_actor.c", 7252);
overlayEntry->nbLoaded--;
Actor_FreeOverlay(overlayEntry);
}