mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Minor improvement for mini events (by rftr): town names are provided by the game for lua
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9142 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -41,6 +41,7 @@ to call into.
|
|||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
#include "Strategic Town Loyalty.h"
|
||||||
|
#include "Text.h"
|
||||||
#include "Town Militia.h"
|
#include "Town Militia.h"
|
||||||
#include "Vehicles.h"
|
#include "Vehicles.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -58,7 +59,7 @@ extern "C" {
|
|||||||
|
|
||||||
extern CHAR16 gzUserDefinedButton1[ 128 ];
|
extern CHAR16 gzUserDefinedButton1[ 128 ];
|
||||||
extern CHAR16 gzUserDefinedButton2[ 128 ];
|
extern CHAR16 gzUserDefinedButton2[ 128 ];
|
||||||
extern GROUP *gpGroupList;
|
extern CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT];
|
||||||
|
|
||||||
static size_t MAX_BUTTON_LENGTH = 60;
|
static size_t MAX_BUTTON_LENGTH = 60;
|
||||||
static size_t MAX_BODY_LENGTH = 450;
|
static size_t MAX_BODY_LENGTH = 450;
|
||||||
@@ -1183,9 +1184,12 @@ namespace MiniEventHelpers
|
|||||||
const INT16 y = lua_tointeger(LS, 2);
|
const INT16 y = lua_tointeger(LS, 2);
|
||||||
|
|
||||||
const UINT8 townId = GetTownIdForSector(x, y);
|
const UINT8 townId = GetTownIdForSector(x, y);
|
||||||
|
CHAR8 townName[MAX_TOWN_NAME_LENGHT];
|
||||||
|
sprintf( townName, "%ls", pTownNames[townId] );
|
||||||
|
|
||||||
lua_pushinteger(LS, townId);
|
lua_pushinteger(LS, townId);
|
||||||
return 1;
|
lua_pushstring( LS, townName );
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_SendMercOnMiniEvent(lua_State* LS)
|
static int l_SendMercOnMiniEvent(lua_State* LS)
|
||||||
|
|||||||
Reference in New Issue
Block a user