summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-06-02 14:39:39 +1000
committerGitHub <noreply@github.com>2023-06-02 14:39:39 +1000
commit4b25b4d8e655c5280fd42e5c99f3971ae9b5326b (patch)
tree166fa44044ca69bc57e2f64ccb899365ec81df28 /src/code
parent0261dc0a5c99ab87fed760c0cb81d1f7c4f9dc3b (diff)
Misc Cleanup 2 (#1260)
* more misc cleanup * PR suggestions * more abs alt, csId * more cleanup, can't help it * fix incorrect sq * more fixes
Diffstat (limited to 'src/code')
-rw-r--r--src/code/sched.c2
-rw-r--r--src/code/z_actor.c22
-rw-r--r--src/code/z_bgcheck.c6
-rw-r--r--src/code/z_camera.c5
-rw-r--r--src/code/z_collision_btltbls.c2
-rw-r--r--src/code/z_eff_blure.c66
-rw-r--r--src/code/z_effect.c66
-rw-r--r--src/code/z_eventmgr.c12
-rw-r--r--src/code/z_parameter.c1
-rw-r--r--src/code/z_scene.c2
-rw-r--r--src/code/z_scene_proc.c2
-rw-r--r--src/code/z_snap.c20
-rw-r--r--src/code/z_sram_NES.c4
13 files changed, 105 insertions, 105 deletions
diff --git a/src/code/sched.c b/src/code/sched.c
index c2630677c..9e2016833 100644
--- a/src/code/sched.c
+++ b/src/code/sched.c
@@ -396,7 +396,7 @@ void Sched_HandleRetrace(SchedContext* sched) {
if (sched->curBuf->updateRate2 > 0) {
sched->curBuf->updateRate2--;
}
- if (sched->curBuf->updateRate2 <= 0 && sched->pendingSwapBuf1 != NULL) {
+ if ((sched->curBuf->updateRate2 <= 0) && (sched->pendingSwapBuf1 != NULL)) {
Sched_RetraceUpdateFramebuffer(sched, sched->pendingSwapBuf1);
}
}
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index b5a24cfac..c7e2c4574 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -695,7 +695,7 @@ void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GameS
* Tests if current scene switch flag is set.
*/
s32 Flags_GetSwitch(PlayState* play, s32 flag) {
- if (flag >= 0 && flag < 0x80) {
+ if ((flag >= 0) && (flag < 0x80)) {
return play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
}
return 0;
@@ -705,7 +705,7 @@ s32 Flags_GetSwitch(PlayState* play, s32 flag) {
* Sets current scene switch flag.
*/
void Flags_SetSwitch(PlayState* play, s32 flag) {
- if (flag >= 0 && flag < 0x80) {
+ if ((flag >= 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
}
}
@@ -714,7 +714,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) {
* Unsets current scene switch flag.
*/
void Flags_UnsetSwitch(PlayState* play, s32 flag) {
- if (flag >= 0 && flag < 0x80) {
+ if ((flag >= 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] &= ~(1 << (flag & 0x1F));
}
}
@@ -793,7 +793,7 @@ void Flags_UnsetClearTemp(PlayState* play, s32 roomNumber) {
* Tests if current scene collectible flag is set.
*/
s32 Flags_GetCollectible(PlayState* play, s32 flag) {
- if (flag > 0 && flag < 0x80) {
+ if ((flag > 0) && (flag < 0x80)) {
return play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
}
return 0;
@@ -803,7 +803,7 @@ s32 Flags_GetCollectible(PlayState* play, s32 flag) {
* Sets current scene collectible flag.
*/
void Flags_SetCollectible(PlayState* play, s32 flag) {
- if (flag > 0 && flag < 0x80) {
+ if ((flag > 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
}
}
@@ -3268,12 +3268,12 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
for (i = 0; i < numTransitionActors; transitionActorList++, i++) {
if (transitionActorList->id >= 0) {
- if ((transitionActorList->sides[0].room >= 0 &&
- (play->roomCtx.curRoom.num == transitionActorList->sides[0].room ||
- play->roomCtx.prevRoom.num == transitionActorList->sides[0].room)) ||
- (transitionActorList->sides[1].room >= 0 &&
- (play->roomCtx.curRoom.num == transitionActorList->sides[1].room ||
- play->roomCtx.prevRoom.num == transitionActorList->sides[1].room))) {
+ if (((transitionActorList->sides[0].room >= 0) &&
+ ((play->roomCtx.curRoom.num == transitionActorList->sides[0].room) ||
+ (play->roomCtx.prevRoom.num == transitionActorList->sides[0].room))) ||
+ ((transitionActorList->sides[1].room >= 0) &&
+ ((play->roomCtx.curRoom.num == transitionActorList->sides[1].room) ||
+ (play->roomCtx.prevRoom.num == transitionActorList->sides[1].room)))) {
s16 rotY = DEG_TO_BINANG((transitionActorList->rotY >> 7) & 0x1FF);
if (Actor_SpawnAsChildAndCutscene(actorCtx, play, transitionActorList->id & 0x1FFF,
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index 2fc1852ab..e30dec5d5 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -1920,12 +1920,14 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
s32 bgId;
f32 temp_f0_2;
f32 f32temp;
- f32 nx2, nz2;
+ f32 nx2;
+ f32 nz2;
Vec3f checkLineNext;
Vec3f checkLinePrev;
f32 n2XZDist;
f32 n3XZDist;
- f32 nx3, nz3;
+ f32 nx3;
+ f32 nz3;
s32 bccFlags;
Vec3f posIntersect2;
s32 bgId2;
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index 91a1d6b06..7fac2a2b2 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -6777,8 +6777,9 @@ s32 Camera_Special5(Camera* camera) {
spA4 = BINANG_SUB(focalActorPosRot->rot.y, sp6C.yaw);
sp74.r = roData->eyeDist;
rand = Rand_ZeroOne();
- sp74.yaw = BINANG_ROT180(focalActorPosRot->rot.y) +
- (s16)(spA4 < 0 ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
+ sp74.yaw =
+ BINANG_ROT180(focalActorPosRot->rot.y) +
+ (s16)((spA4 < 0) ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
sp74.pitch = roData->pitch;
OLib_AddVecGeoToVec3f(eyeNext, &spA8.pos, &sp74);
*eye = *eyeNext;
diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c
index c9f014f4f..36528e467 100644
--- a/src/code/z_collision_btltbls.c
+++ b/src/code/z_collision_btltbls.c
@@ -790,7 +790,7 @@ DamageTable sDamageTablePresets[] = {
* is out of range.
*/
DamageTable* DamageTable_Get(s32 index) {
- if (index < 0 || index > ARRAY_COUNT(sDamageTablePresets) - 1) {
+ if ((index < 0) || (index >= ARRAY_COUNT(sDamageTablePresets))) {
return NULL;
}
diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c
index f25273279..370ca9481 100644
--- a/src/code/z_eff_blure.c
+++ b/src/code/z_eff_blure.c
@@ -753,7 +753,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
j = 0;
- for (i = 0; i < this->numElements - 1; i++) {
+ for (i = 0; i < this->numElements - 1; i++, j += 4) {
if (this->drawMode == 1) {
alphaRatio = (f32)this->elements[i].timer / (f32)this->elemDuration;
gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, this->altPrimColor.r, this->altPrimColor.g,
@@ -761,45 +761,43 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
gDPPipeSync(POLY_XLU_DISP++);
}
- if (1) {} // Necessary to match
-
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
- if (this->flags & 4) {
- sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) * 0.5f;
- sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) * 0.5f;
- sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) * 0.5f;
- sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) * 0.5f;
- sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) * 0.5f;
- sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) * 0.5f;
-
- Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
- scale = sqrtf(SQXYZ(sp198));
-
- if (fabsf(scale) > 0.0005f) {
- scale = 1.0f / scale;
- Math_Vec3f_Scale(&sp198, scale);
-
- SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
- SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
- SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
- SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
- SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
-
- mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
- if (mtx == NULL) {
- break;
- }
+ if (!(this->flags & 4)) {
+ continue;
+ }
+
+ sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) / 2.0f;
+ sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) / 2.0f;
+ sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) / 2.0f;
+ sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) / 2.0f;
+ sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) / 2.0f;
+ sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) / 2.0f;
+
+ Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
+ scale = sqrtf(SQXYZ(sp198));
- gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
- gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
- gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ if (fabsf(scale) > 0.0005f) {
+ scale = 1.0f / scale;
+ Math_Vec3f_Scale(&sp198, scale);
+
+ SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
+ SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
+ SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
+ SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
+ SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
+
+ mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
+ if (mtx == NULL) {
+ break;
}
- }
- j += 4;
+ gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
+ gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ }
}
}
diff --git a/src/code/z_effect.c b/src/code/z_effect.c
index b4a76380e..60a98c4d9 100644
--- a/src/code/z_effect.c
+++ b/src/code/z_effect.c
@@ -187,33 +187,31 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.sparks[i].status.active) {
- sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
+ if (!sEffectContext.sparks[i].status.active) {
+ continue;
}
+ sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
}
for (i = 0; i < BLURE_COUNT; i++) {
- if (1) {
- if (gfxCtx) {}
- } // necessary to match
- if (sEffectContext.blures[i].status.active) {
- sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
+ if (!sEffectContext.blures[i].status.active) {
+ continue;
}
+ sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.shieldParticles[i].status.active) {
- sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
+ if (!sEffectContext.shieldParticles[i].status.active) {
+ continue;
}
+ sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
}
- if (1) {} // necessary to match
for (i = 0; i < TIRE_MARK_COUNT; i++) {
- if (sEffectContext.tireMarks[i].status.active) {
- sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
+ if (!sEffectContext.tireMarks[i].status.active) {
+ continue;
}
+ sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
}
}
@@ -221,38 +219,38 @@ void Effect_UpdateAll(PlayState* play) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.sparks[i].status.active) {
- if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
- Effect_Destroy(play, i);
- }
+ if (!sEffectContext.sparks[i].status.active) {
+ continue;
+ }
+ if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
+ Effect_Destroy(play, i);
}
}
for (i = 0; i < BLURE_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.blures[i].status.active) {
- if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
- Effect_Destroy(play, i + SPARK_COUNT);
- }
+ if (!sEffectContext.blures[i].status.active) {
+ continue;
+ }
+ if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
+ Effect_Destroy(play, i + SPARK_COUNT);
}
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.shieldParticles[i].status.active) {
- if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
- Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
- }
+ if (!sEffectContext.shieldParticles[i].status.active) {
+ continue;
+ }
+ if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
+ Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
}
}
for (i = 0; i < TIRE_MARK_COUNT; i++) {
- if (1) {} // necessary to match
- if (sEffectContext.tireMarks[i].status.active) {
- if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
- Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
- }
+ if (!sEffectContext.tireMarks[i].status.active) {
+ continue;
+ }
+ if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
+ Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
}
}
}
diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c
index aec6fdbb0..e3defb402 100644
--- a/src/code/z_eventmgr.c
+++ b/src/code/z_eventmgr.c
@@ -371,7 +371,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
Camera* retCam;
s32 csType = 0;
- if ((csId < 0) || (sCutsceneMgr.csId != CS_ID_NONE)) {
+ if ((csId <= CS_ID_NONE) || (sCutsceneMgr.csId != CS_ID_NONE)) {
return csId;
}
@@ -437,7 +437,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
s16 CutsceneManager_Stop(s16 csId) {
ActorCutscene* csEntry;
- if (csId < 0) {
+ if (csId <= CS_ID_NONE) {
return csId;
}
@@ -468,28 +468,28 @@ ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) {
}
s16 CutsceneManager_GetAdditionalCsId(s16 csId) {
- if (csId < 0) {
+ if (csId <= CS_ID_NONE) {
return CS_ID_NONE;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->additionalCsId;
}
s16 CutsceneManager_GetLength(s16 csId) {
- if (csId < 0) {
+ if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->length;
}
s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId) {
- if (csId < 0) {
+ if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->scriptIndex;
}
s16 CutsceneManager_GetCutsceneCustomValue(s16 csId) {
- if (csId < 0) {
+ if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->customValue;
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 86b6d0107..25e6a26a5 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -3867,7 +3867,6 @@ void Interface_DrawItemButtons(PlayState* play) {
OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow(OVERLAY_DISP, gButtonBackgroundTex, 0x20, 0x20, D_801BF9D4[0],
D_801BF9DC[0], D_801BFAF4[0], D_801BFAF4[0], D_801BF9E4[0] * 2,
D_801BF9E4[0] * 2, 100, 255, 120, interfaceCtx->bAlpha);
- if (1) {}
gDPPipeSync(OVERLAY_DISP++);
// C-Left Button Color & Texture
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 26dc39507..623db6b24 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -89,7 +89,7 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
s32 i;
for (i = 0; i < objectCtx->num; i++) {
- if ((objectCtx->status[i].id < 0 ? -objectCtx->status[i].id : objectCtx->status[i].id) == objectId) {
+ if (ABS_ALT(objectCtx->status[i].id) == objectId) {
return i;
}
}
diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c
index c899b4d83..b4597a5c2 100644
--- a/src/code/z_scene_proc.c
+++ b/src/code/z_scene_proc.c
@@ -400,7 +400,7 @@ void AnimatedMat_DrawMain(PlayState* play, AnimatedMaterial* matAnim, f32 alphaR
if ((matAnim != NULL) && (matAnim->segment != 0)) {
do {
segment = matAnim->segment;
- segmentAbs = ((segment < 0) ? -segment : segment) + 7;
+ segmentAbs = ABS_ALT(segment) + 7;
matAnimDrawHandlers[matAnim->type](play, segmentAbs, Lib_SegmentedToVirtual(matAnim->params));
matAnim++;
} while (segment >= 0);
diff --git a/src/code/z_snap.c b/src/code/z_snap.c
index 9361cc1e0..3524fe3ab 100644
--- a/src/code/z_snap.c
+++ b/src/code/z_snap.c
@@ -42,9 +42,6 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
break;
}
- //! FAKE:
- if (1) {}
-
// Actors which may be pictographed anywhere
switch (actor->id) {
case ACTOR_EN_KAKASI:
@@ -71,15 +68,20 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
case ACTOR_EN_GE2:
seen |= PICTO_SEEN_ANYWHERE;
break;
+
+ default:
+ break;
+ }
+
+ if (!seen) {
+ continue;
}
// If actor is recordable, run its validity function and record if valid
- if (seen) {
- pictoActor = (PictoActor*)actor;
- if (pictoActor->validationFunc != NULL) {
- if ((pictoActor->validationFunc)(play, actor) == 0) {
- validCount++;
- }
+ pictoActor = (PictoActor*)actor;
+ if (pictoActor->validationFunc != NULL) {
+ if (pictoActor->validationFunc(play, actor) == 0) {
+ validCount++;
}
}
}
diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c
index ac68f0fac..f47a8e201 100644
--- a/src/code/z_sram_NES.c
+++ b/src/code/z_sram_NES.c
@@ -548,7 +548,7 @@ void Sram_GenerateRandomSaveFields(void) {
do {
randBombers = Rand_S16Offset(0, 6);
- } while (randBombers <= 0 || randBombers >= 6);
+ } while ((randBombers <= 0) || (randBombers >= 6));
gSaveContext.save.saveInfo.bomberCode[0] = randBombers;
@@ -558,7 +558,7 @@ void Sram_GenerateRandomSaveFields(void) {
do {
randBombers = Rand_S16Offset(0, 6);
- } while (randBombers <= 0 || randBombers >= 6);
+ } while ((randBombers <= 0) || (randBombers >= 6));
sp2A = 0;
do {