- Lua function HandleSectorLiberation(...) is called whenever we liberate a sector

- Lua function RecruitRPCAdditionalHandling(...) is called whenever we recruit a RPC

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7880 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-05-31 15:13:21 +00:00
parent 5c107cee7e
commit 7c69e12df8
4 changed files with 64 additions and 7 deletions
+4 -5
View File
@@ -29,6 +29,7 @@
#include "PopUpBox.h"
#include "CampaignStats.h" // added by Flugente
#include "Town Militia.h" // added by Flugente
#include "LuaInitNPCs.h" // added by Flugente
#endif
#include "postalservice.h"
@@ -387,11 +388,6 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
// Flugente: campaign stats
if ( !SectorInfo[ SECTOR( sMapX, sMapY ) ].fSurfaceWasEverPlayerControlled )
{
//UINT8 ubSector = (UINT8)SECTOR( sMapX, sMapY );
//UINT8 ubTraverseType = SectorInfo[ ubSector ].ubTraversability[ 4 ];
//if ( ubTraverseType == )
UINT8 townid = GetTownIdForSector( sMapX, sMapY );
if ( townid != BLANK_SECTOR )
{
@@ -407,6 +403,9 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
}
}
// Flugente: if we take the surface sector for the first time, script-defined actions might happen
LuaHandleSectorLiberation( sMapX, sMapY, bMapZ, !SectorInfo[SECTOR( sMapX, sMapY )].fSurfaceWasEverPlayerControlled );
if ( bMapZ == 0 )
{
SectorInfo[ SECTOR( sMapX, sMapY ) ].fSurfaceWasEverPlayerControlled = TRUE;