From 465620a871e7da8d72d82a999eac8623570d13fd Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 13 Sep 2025 00:37:10 -0300 Subject: add `MAX_DEPOTS` constant + enable assertions in debug mode --- src/common.hh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/common.hh') diff --git a/src/common.hh b/src/common.hh index daf66ad..a8f1460 100644 --- a/src/common.hh +++ b/src/common.hh @@ -66,7 +66,7 @@ typedef size_t usize; #endif #define ASSERT_ALWAYS(expr) if(!(expr)) { TRAP(); } -#if BUILD_DEBUG +#if ENABLE_ASSERTIONS # define ASSERT(expr) ASSERT_ALWAYS(expr) #else # define ASSERT(expr) ((void)(expr)) @@ -86,6 +86,22 @@ STATIC_ASSERT(OS_LINUX); # define sigev_notify_thread_id _sigev_un._tid #endif +// Constants +// ============================================================================= +// TODO(fusion): There are many constants that are hardcoded as decompilation +// artifacts. We should define them here and use when appropriate. It is not +// as simple because I've been using `NARRAY` in some cases and they're used +// essentially everywhere. + +//#define MAX_NAME 30 // used with most short strings (should replace MAX_IDENT_LENGTH too) +//#define MAX_IPADDRESS 16 +//#define MAX_BUDDIES 100 +//#define MAX_SKILLS 25 +//#define MAX_SPELLS 256 +//#define MAX_QUESTS 500 +#define MAX_DEPOTS 9 +//#define MAX_OPEN_CONTAINERS 16 + // shm.cc // ============================================================================= void StartGame(void); -- cgit v1.2.3