Added a basic lua profiler
If the game is compiled with LUA_PROFILER=1, displays on screen the average execution time per frame of each active lua mod, in microseconds.
Added object functions
For some reasons, accessing the object fields obj.o* via lua is rather slow, and can drastically increase execution time of custom behaviors. For basic stuff like setting an object's velocity or moving it, some functions, missing from the original code, have been added:
s32 obj_is_valid_for_interaction(struct Object *o): returns 1 if an object is valid for interaction, i.e. active, tangible and not interacted.
s32 obj_check_hitbox_overlap(struct Object *o1, struct Object *o2): returns 1 if two objects hitboxes overlap. Doesn't check tangibility, only hitbox values.
void obj_set_vel(struct Object *o, f32 vx, f32 vy, f32 vz): sets an object's velocity.
void obj_move_xyz(struct Object *o, f32 dx, f32 dy, f32 dz): moves an object position by (dx, dy, dz).
Bug fixes:
Disable collisions with walls and ceilings after Mario exits a warp pipe to prevent softlocks in narrow places.
Make the koopa shell exclamation box respawn after some time.
Quicksand no longer downwarps and instant-kills Mario if he's shocked while being above it.
Red Coins will now properly play the cutscene for who collected the last red coin.
Secrets will now properly play the cutscene for who collected the last secret.
Treasure Chests will now only play the star cutscene for the person who opened the last chest.
Properly named some unknown Treasure Chest fields.
The Chain Chomp Chain should now properly be despawned for late joiners.
Improved the Big Boo's Haunt Merry-Go-Round checks for Mario.