some define comment and replace number by const (#469)

This commit is contained in:
coco875
2023-10-19 20:06:12 +02:00
committed by GitHub
parent ac17d943be
commit 134e126cd9
14 changed files with 161 additions and 164 deletions
+6 -6
View File
@@ -2665,7 +2665,7 @@ s32 func_8029EEB8(Player *player, Vec3f pos, f32 arg2, f32 arg3, f32 arg4) {
s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
if (func_8029EEB8(player, marioRacewaySign->pos, 7.0f, 200.0f, 0.8f) == 1) {
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
if ((player->effects & 0x200) != 0) {
marioRacewaySign->flags |= 0x400;
func_800C98B8(player->pos, player->velocity, 0x19018010U);
@@ -2681,7 +2681,7 @@ s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) {
s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) {
if (func_8029EEB8(player, plant->pos, plant->boundingBoxSize, plant->boundingBoxSize, 2.5f) == 1) {
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
if ((player->effects & 0x200) != 0) {
plant->flags |= 0x400;
func_800C98B8(player->pos, player->velocity, 0x1901A24AU);
@@ -2732,7 +2732,7 @@ s32 func_8029F408(Player *player, struct YoshiValleyEgg *egg) {
if (totalBox < xz_dist) {
return 0;
}
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
if ((player->effects & 0x200) != 0) {
egg->flags |= 0x400;
egg->pathCenter[1] = 8.0f;
@@ -2797,7 +2797,7 @@ s32 func_8029F69C(Player *player, struct Actor *actor) {
}
sp48 = player->velocity[0];
sp44 = player->velocity[2];
if (player->type & 0x4000) {
if (player->type & PLAYER_HUMAN) {
if (player->effects & 0x200) {
actor->flags |= 0x400;
func_800C98B8(player->pos, player->velocity, 0x19018010U);
@@ -3294,7 +3294,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
actor->state = 3;
actor->flags = -0x8000;
actor->unk_04 = 0;
if (player->type & 0x4000) {
if (player->type & PLAYER_HUMAN) {
func_8007ABFC(player - gPlayerOne, 7);
}
} else if (actor->state == 0) {
@@ -3307,7 +3307,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
actor->state = 3;
actor->flags = -0x8000;
actor->unk_04 = 0;
if (player->type & 0x4000) {
if (player->type & PLAYER_HUMAN) {
func_8007ABFC(player - gPlayerOne, 0);
}
} else if (actor->state == 0) {
+8 -8
View File
@@ -292,7 +292,7 @@ void update_actor_banana_bunch(struct BananaBunchParent *banana_bunch) {
}
if (someCount == 0) {
destroy_actor((struct Actor *) banana_bunch);
owner->statusEffects &= ~0x40000;
owner->statusEffects &= ~HOLD_BANANA_EFFECT;
} else if ((owner->type & 0x4000) != 0) {
controller = &gControllers[banana_bunch->playerId];
if ((controller->buttonPressed & Z_TRIG) != 0) {
@@ -716,7 +716,7 @@ void update_actor_banana(struct BananaActor *banana) {
}
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
func_802B4E30((struct Actor *) banana);
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
if (gDemoMode) {
controller = gControllerOne;
} else {
@@ -726,7 +726,7 @@ void update_actor_banana(struct BananaActor *banana) {
controller->buttonDepressed &= ~Z_TRIG;
banana->state = 1;
banana->unk_04 = 0x00B4;
player->statusEffects &= ~0x40000;
player->statusEffects &= ~HOLD_BANANA_EFFECT;
func_800C9060(player - gPlayerOne, 0x19008012U);
pad3 = controller->rawStickY;
if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
@@ -925,7 +925,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
tempBanana->youngerIndex = actorIndex;
break;
}
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
func_800C9060(player - gPlayerOne, 0x19008012);
}
}
@@ -1030,7 +1030,7 @@ void use_thunder_item(Player *player) {
Player *otherPlayer;
func_8009E5BC();
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
// Play sound.
func_800CAB4C(player - gPlayerOne);
}
@@ -1119,7 +1119,7 @@ void func_802B30EC(void) {
}
}
if (((player->type & 0x4000) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if (((player->type & PLAYER_HUMAN) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
func_802B2FA0(player);
@@ -1173,7 +1173,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
} else {
shell->pos[1] = pad2;
}
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
controller = &gControllers[shell->playerId];
if ((controller->buttonDepressed & Z_TRIG) != 0) {
controller->buttonDepressed &= ~Z_TRIG;
@@ -1554,7 +1554,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
shell->pos[1] = pad7;
}
if ((player->type & 0x4000) != 0) {
if ((player->type & PLAYER_HUMAN) != 0) {
if (gDemoMode) {
controller = gControllerOne;
} else {