just cast g_lang into lua's language code

because magically I got the enum order right first try
This commit is contained in:
Marco Antonio J. Costa
2024-12-31 16:28:44 -03:00
parent b15c4ef96c
commit 70f09471c2
+2 -20
View File
@@ -96,6 +96,7 @@ extern "C" {
#include "Merc Contract.h" #include "Merc Contract.h"
#include "message.h" #include "message.h"
#include "Town Militia.h" #include "Town Militia.h"
#include <language.hpp>
extern UINT8 gubWaitingForAllMercsToExitCode; extern UINT8 gubWaitingForAllMercsToExitCode;
@@ -13208,26 +13209,7 @@ static int l_GetUsedLanguage( lua_State *L )
{ {
if ( lua_gettop( L ) ) if ( lua_gettop( L ) )
{ {
INT32 val = 0; INT32 val = static_cast<INT32>(g_lang);
#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
lua_pushinteger( L, val ); lua_pushinteger( L, val );
} }