make visibleToObjects a boolean

This commit is contained in:
PeachyPeachSM64 2026-05-21 20:20:23 +02:00
parent 8f105ea53d
commit 541874fdca
8 changed files with 8 additions and 8 deletions

View file

@ -8361,7 +8361,7 @@ end
--- @param z number
--- @param dist integer
--- @return integer
--- Checks if a point is within distance from any active Mario visible to enemies' graphical position
--- Checks if a point is within distance from any active Mario visible to objects' graphical position
function is_point_within_radius_of_mario(x, y, z, dist)
-- ...
end

View file

@ -1126,7 +1126,7 @@
--- @field public doubleJumpTimer integer
--- @field public specialTripleJump integer
--- @field public fadeWarpOpacity integer
--- @field public visibleToObjects integer
--- @field public visibleToObjects boolean
--- @field public wasNetworkVisible integer
--- @field public dialogId integer
--- @field public prevNumStarsForDialog integer

View file

@ -3199,7 +3199,7 @@ Moves `obj` based on a seemingly random mix of using either the current obj or `
## [is_point_within_radius_of_mario](#is_point_within_radius_of_mario)
### Description
Checks if a point is within distance from any active Mario visible to enemies' graphical position
Checks if a point is within distance from any active Mario visible to objects' graphical position
### Lua Example
`local integerValue = is_point_within_radius_of_mario(x, y, z, dist)`

View file

@ -1643,7 +1643,7 @@
| doubleJumpTimer | `integer` | |
| specialTripleJump | `integer` | |
| fadeWarpOpacity | `integer` | |
| visibleToObjects | `integer` | |
| visibleToObjects | `boolean` | |
| wasNetworkVisible | `integer` | |
| dialogId | `integer` | read-only |
| prevNumStarsForDialog | `integer` | |

View file

@ -505,7 +505,7 @@ struct MarioState
u8 specialTripleJump;
u8 fadeWarpOpacity;
u8 visibleToObjects;
bool visibleToObjects;
u8 wasNetworkVisible;
s32 dialogId;
s16 prevNumStarsForDialog;

View file

@ -2225,7 +2225,7 @@ void init_single_mario(struct MarioState* m) {
m->framesSinceB = 0xFF;
m->invincTimer = 0;
m->visibleToObjects = TRUE;
m->visibleToObjects = true;
if (m->cap & (SAVE_FLAG_CAP_ON_GROUND | SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI | SAVE_FLAG_CAP_ON_MR_BLIZZARD)) {
m->flags = 0;

View file

@ -266,7 +266,7 @@ void bhv_mario_update(void) {
gMarioState->particleFlags = 0;
}
gMarioState->visibleToObjects = TRUE;
gMarioState->visibleToObjects = true;
smlua_call_event_hooks(HOOK_BEFORE_MARIO_UPDATE, gMarioState);

View file

@ -1467,7 +1467,7 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = {
{ "unkC4", LVT_F32, offsetof(struct MarioState, unkC4), false, LOT_NONE },
{ "usedObj", LVT_COBJECT_P, offsetof(struct MarioState, usedObj), false, LOT_OBJECT },
{ "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F },
{ "visibleToObjects", LVT_U8, offsetof(struct MarioState, visibleToObjects), false, LOT_NONE },
{ "visibleToObjects", LVT_BOOL, offsetof(struct MarioState, visibleToObjects), false, LOT_NONE },
{ "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE },
{ "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE },
{ "wallNormal", LVT_COBJECT, offsetof(struct MarioState, wallNormal), true, LOT_VEC3F },