From 4deff6f3f4e3cb7088b351bda24c75bf70525138 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:10:21 +1000 Subject: [PATCH] fix an oversight --- autogen/lua_definitions/structs.lua | 1 + docs/lua/structs.md | 1 + src/pc/lua/smlua_cobject_autogen.c | 3 ++- src/pc/network/packets/packet_network_players.c | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index bbb761c31..b9f0e26a4 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -1063,6 +1063,7 @@ --- @field public customBehaviorIndex integer --- @field public description string --- @field public enabled boolean +--- @field public fileCapacity integer --- @field public fileCount integer --- @field public ignoreScriptWarnings boolean --- @field public incompatible string diff --git a/docs/lua/structs.md b/docs/lua/structs.md index ea9e66cf9..f15b1b0ea 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -1439,6 +1439,7 @@ | customBehaviorIndex | `integer` | read-only | | description | `string` | read-only | | enabled | `boolean` | read-only | +| fileCapacity | `integer` | read-only | | fileCount | `integer` | read-only | | ignoreScriptWarnings | `boolean` | read-only | | incompatible | `string` | read-only | diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index eaece9f8b..b2ab63b8c 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -1188,12 +1188,13 @@ static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = { { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, }; -#define LUA_MOD_FIELD_COUNT 14 +#define LUA_MOD_FIELD_COUNT 15 static struct LuaObjectField sModFields[LUA_MOD_FIELD_COUNT] = { { "basePath", LVT_STRING, offsetof(struct Mod, basePath), true, LOT_NONE }, { "customBehaviorIndex", LVT_U8, offsetof(struct Mod, customBehaviorIndex), true, LOT_NONE }, { "description", LVT_STRING_P, offsetof(struct Mod, description), true, LOT_NONE }, { "enabled", LVT_BOOL, offsetof(struct Mod, enabled), true, LOT_NONE }, + { "fileCapacity", LVT_U16, offsetof(struct Mod, fileCapacity), true, LOT_NONE }, { "fileCount", LVT_U16, offsetof(struct Mod, fileCount), true, LOT_NONE }, { "ignoreScriptWarnings", LVT_BOOL, offsetof(struct Mod, ignoreScriptWarnings), true, LOT_NONE }, { "incompatible", LVT_STRING_P, offsetof(struct Mod, incompatible), true, LOT_NONE }, diff --git a/src/pc/network/packets/packet_network_players.c b/src/pc/network/packets/packet_network_players.c index eeb86566a..49f3d6beb 100644 --- a/src/pc/network/packets/packet_network_players.c +++ b/src/pc/network/packets/packet_network_players.c @@ -110,7 +110,7 @@ void network_receive_network_players(struct Packet *p) { packet_read(p, &playerName, sizeof(u8) * MAX_CONFIG_STRING); packet_read(p, &discordId, sizeof(u8) * 64); - if (globalIndex > MAX_PLAYERS) { continue; } + if (globalIndex >= MAX_PLAYERS) { continue; } u8 localIndex = network_player_connected(npType, globalIndex, modelIndex, &palette, playerName, discordId); LOG_INFO("received network player [%d == %d] (%d)", globalIndex, npType, localIndex);