From 70f09471c21c9f7ceea931a1b143d9d8d5db0ee0 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Fri, 27 Dec 2024 09:22:06 -0300 Subject: [PATCH] just cast g_lang into lua's language code because magically I got the enum order right first try --- Strategic/LuaInitNPCs.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/Strategic/LuaInitNPCs.cpp b/Strategic/LuaInitNPCs.cpp index 519dc005..721a5a44 100644 --- a/Strategic/LuaInitNPCs.cpp +++ b/Strategic/LuaInitNPCs.cpp @@ -96,6 +96,7 @@ extern "C" { #include "Merc Contract.h" #include "message.h" #include "Town Militia.h" +#include extern UINT8 gubWaitingForAllMercsToExitCode; @@ -13208,26 +13209,7 @@ static int l_GetUsedLanguage( lua_State *L ) { if ( lua_gettop( L ) ) { - INT32 val = 0; - -#if defined(ENGLISH) - val = 0; -#elif defined(GERMAN) - val = 1; -#elif defined(RUSSIAN) - val = 2; -#elif defined(DUTCH) - val = 3; -#elif defined(POLISH) - val = 4; -#elif defined(FRENCH) - val = 5; -#elif defined(ITALIAN) - val = 6; -#elif defined(CHINESE) - val = 7; -#endif - + INT32 val = static_cast(g_lang); lua_pushinteger( L, val ); }