diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index a2457b6db..0c00b9227 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -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 diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 6b0c23f24..5e19d87a1 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -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 diff --git a/docs/lua/functions-5.md b/docs/lua/functions-5.md index a2a5a7598..fbf12edf3 100644 --- a/docs/lua/functions-5.md +++ b/docs/lua/functions-5.md @@ -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)` diff --git a/docs/lua/structs.md b/docs/lua/structs.md index be0ee3211..3da14cfe2 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -1643,7 +1643,7 @@ | doubleJumpTimer | `integer` | | | specialTripleJump | `integer` | | | fadeWarpOpacity | `integer` | | -| visibleToObjects | `integer` | | +| visibleToObjects | `boolean` | | | wasNetworkVisible | `integer` | | | dialogId | `integer` | read-only | | prevNumStarsForDialog | `integer` | | diff --git a/include/types.h b/include/types.h index 9b5c05367..b05b993e8 100644 --- a/include/types.h +++ b/include/types.h @@ -505,7 +505,7 @@ struct MarioState u8 specialTripleJump; u8 fadeWarpOpacity; - u8 visibleToObjects; + bool visibleToObjects; u8 wasNetworkVisible; s32 dialogId; s16 prevNumStarsForDialog; diff --git a/src/game/mario.c b/src/game/mario.c index a750f9ddd..3e7135352 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -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; diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 347c5c9ba..03d55193e 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -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); diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index e46999b7d..1fc2fe336 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -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 },