Skip to content

Commit

Permalink
Make evaluate_collision_players_palm_tree better (#667)
Browse files Browse the repository at this point in the history
This matches just the same as before,	but using those two casts instead of
shifts seems more likely to be accurate to the original source code

Signed-off-by: Gabriel Ravier <[email protected]>
  • Loading branch information
GabrielRavier authored Aug 21, 2024
1 parent 14e099a commit 2c19ad9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/racing/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ void evaluate_collision_players_palm_trees(void) {
s32 index;

for (index = 0; index < 4; index++){
// wtf is up with the << 0x18 >> 0x18? is it some weird type conversion? just use & 0xFF have the same effect to keep 8 first bit
if (((gPlayers[index].type & 0xC000) != 0) && (((get_surface_type(gPlayers[index].collision.meshIndexZX) << 24) >> 24) == GRASS)) {
if (((gPlayers[index].type & 0xC000) != 0) && ((s8)(u8)get_surface_type(gPlayers[index].collision.meshIndexZX) == GRASS)) {
evaluate_collision_player_palm_trees(&gPlayers[index]);
}
}
Expand Down

0 comments on commit 2c19ad9

Please sign in to comment.