From db2d2a20fa9415837c6b29b2d3d64f49d46fcda2 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:27:01 -0500 Subject: [PATCH] Allow floats to be constants --- autogen/convert_constants.py | 1 + autogen/lua_definitions/constants.lua | 6 ++++++ docs/lua/constants.md | 2 ++ src/pc/lua/smlua_constants_autogen.c | 2 ++ 4 files changed, 11 insertions(+) diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py index 36a981c5..9a85e45a 100644 --- a/autogen/convert_constants.py +++ b/autogen/convert_constants.py @@ -163,6 +163,7 @@ def process_define(filename, line): val = val.replace('(u8)', '') val = val.replace('(u64)', '') + val = re.sub(r'\.\d+f', '', val) for p in val.split(' '): if p.startswith('0x'): diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index 31817918..45deb20e 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -5677,6 +5677,12 @@ PACKET_LENGTH = 3000 --- @type integer SYNC_DISTANCE_INFINITE = 0 +--- @type integer +SYNC_DISTANCE_ONLY_DEATH = -1 + +--- @type integer +SYNC_DISTANCE_ONLY_EVENTS = -2 + --- @class BouncyLevelBounds --- @type BouncyLevelBounds diff --git a/docs/lua/constants.md b/docs/lua/constants.md index 11ce4f2e..3404fde0 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -2035,6 +2035,8 @@ ## [network.h](#network.h) - PACKET_LENGTH - SYNC_DISTANCE_INFINITE +- SYNC_DISTANCE_ONLY_DEATH +- SYNC_DISTANCE_ONLY_EVENTS ### [enum BouncyLevelBounds](#BouncyLevelBounds) | Identifier | Value | diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index 965260b2..ac78c340 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -2093,6 +2093,8 @@ char gSmluaConstants[] = "" "GRAB_POS_BOWSER = 3\n" "MAX_KEYS = 512\n" "MAX_KEY_VALUE_LENGTH = 64\n" +"SYNC_DISTANCE_ONLY_DEATH = -1\n" +"SYNC_DISTANCE_ONLY_EVENTS = -2\n" "SYNC_DISTANCE_INFINITE = 0\n" "PACKET_LENGTH = 3000\n" "NS_SOCKET = 0\n"