Skip to content

Commit

Permalink
v95
Browse files Browse the repository at this point in the history
  • Loading branch information
whoward69 committed Sep 3, 2019
1 parent 9cf5d1f commit 9cc605a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions CvGameCoreDLL_Expansion2/CustomMods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ int CustomMods::getOption(string sOption, int defValue) {
MOD_OPT_CACHE(EVENTS_RELIGION);
MOD_OPT_CACHE(EVENTS_ESPIONAGE);
MOD_OPT_CACHE(EVENTS_PLOT);
MOD_OPT_CACHE(EVENTS_PLAYER_TURN);
MOD_OPT_CACHE(EVENTS_GOLDEN_AGE);
MOD_OPT_CACHE(EVENTS_CITY);
MOD_OPT_CACHE(EVENTS_CITY_CAPITAL);
Expand Down
10 changes: 8 additions & 2 deletions CvGameCoreDLL_Expansion2/CustomMods.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
****************************************************************************/
#define MOD_DLL_GUID {0xcf7d28a8, 0x1684, 0x4420, { 0xaf, 0x45, 0x11, 0x7, 0xc, 0xb, 0x8c, 0x4a }} // {CF7D28A8-1684-4420-AF45-11070C0B8C4A}
#define MOD_DLL_NAME "Pick'N'Mix BNW DLL"
#define MOD_DLL_VERSION_NUMBER ((uint) 93)
#define MOD_DLL_VERSION_NUMBER ((uint) 94)
#define MOD_DLL_VERSION_STATUS "" // a (alpha), b (beta) or blank (released)
#define MOD_DLL_CUSTOM_BUILD_NAME ""

Expand Down Expand Up @@ -561,7 +561,11 @@
// GameEvents.PlayerBuilt.Add(function(iPlayer, iUnit, iX, iY, iBuild) end) (v46)
#define MOD_EVENTS_PLOT gCustomMods.isEVENTS_PLOT()

// Events sent by golden ages (v52)
// Event sent by ending turn (v94)
// GameEvents.PlayerDoneTurn.Add(function(iPlayer) end)
#define MOD_EVENTS_PLAYER_TURN gCustomMods.isEVENTS_PLAYER_TURN()

// Event sent by golden ages (v52)
// GameEvents.PlayerGoldenAge.Add(function(iPlayer, bStart, iTurns) end)
#define MOD_EVENTS_GOLDEN_AGE gCustomMods.isEVENTS_GOLDEN_AGE()

Expand Down Expand Up @@ -1011,6 +1015,7 @@ enum BattleTypeTypes
#define GAMEEVENT_PlayerCanRevoke "PlayerCanRevoke", "ii"
#define GAMEEVENT_PlayerCanSpreadReligion "PlayerCanSpreadReligion", "iiii"
#define GAMEEVENT_PlayerCanTransitMinorCity "PlayerCanTransitMinorCity", "iiiii"
#define GAMEEVENT_PlayerDoneTurn "PlayerDoneTurn", "i"
#define GAMEEVENT_PlayerGifted "PlayerGifted", "iiiiii"
#define GAMEEVENT_PlayerGoldenAge "PlayerGoldenAge", "ibi"
#define GAMEEVENT_PlayerLiberated "PlayerLiberated", "iii"
Expand Down Expand Up @@ -1286,6 +1291,7 @@ class CustomMods {
MOD_OPT_DECL(EVENTS_RELIGION);
MOD_OPT_DECL(EVENTS_ESPIONAGE);
MOD_OPT_DECL(EVENTS_PLOT);
MOD_OPT_DECL(EVENTS_PLAYER_TURN);
MOD_OPT_DECL(EVENTS_GOLDEN_AGE);
MOD_OPT_DECL(EVENTS_CITY);
MOD_OPT_DECL(EVENTS_CITY_CAPITAL);
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvDealClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,7 @@ bool CvGameDeals::FinalizeDeal(PlayerTypes eFromPlayer, PlayerTypes eToPlayer, b
return bFoundIt && bValid;
}

void CvGameDeals::FinalizeDealValidAndAccepted(PlayerTypes eFromPlayer, PlayerTypes eToPlayer, CvDeal& kDeal, bool bAccepted, CvWeightedVector<TeamTypes, MAX_CIV_TEAMS, true>& veNowAtPeacePairs)
void CvGameDeals::FinalizeDealValidAndAccepted(PlayerTypes eFromPlayer, PlayerTypes /* eToPlayer */, CvDeal& kDeal, bool bAccepted, CvWeightedVector<TeamTypes, MAX_CIV_TEAMS, true>& veNowAtPeacePairs)
{
// Determine total duration of the Deal
int iLatestItemLastTurn = 0;
Expand Down
6 changes: 6 additions & 0 deletions CvGameCoreDLL_Expansion2/CvPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17932,6 +17932,12 @@ void CvPlayer::setTurnActive(bool bNewValue, bool bDoTurn)

else
{
#if defined(MOD_EVENTS_PLAYER_TURN)
if (MOD_EVENTS_PLAYER_TURN) {
GAMEEVENTINVOKE_HOOK(GAMEEVENT_PlayerDoneTurn, GetID());
}
#endif

CvAssertFmt(GetEndTurnBlockingType() == NO_ENDTURN_BLOCKING_TYPE, "Expecting the end-turn blocking to be NO_ENDTURN_BLOCKING_TYPE, got %d", GetEndTurnBlockingType());
SetEndTurnBlocking(NO_ENDTURN_BLOCKING_TYPE, -1); // Make sure this is clear so the UI doesn't block when it is not our turn.

Expand Down
11 changes: 11 additions & 0 deletions CvGameCoreDLL_Expansion2/Lua/CvLuaPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ void CvLuaPlot::PushMethods(lua_State* L, int t)
Method(GetRouteType);
Method(SetRouteType);
Method(IsRoutePillaged);
#if defined(MOD_API_LUA_EXTENSIONS)
Method(SetRoutePillaged);
#endif

#if defined(MOD_API_LUA_EXTENSIONS)
Method(GetPlayerThatBuiltImprovement);
Expand Down Expand Up @@ -1511,6 +1514,14 @@ int CvLuaPlot::lIsRoutePillaged(lua_State* L)
}
#if defined(MOD_API_LUA_EXTENSIONS)
//------------------------------------------------------------------------------
//void setRoutePillaged(bool b);
int CvLuaPlot::lSetRoutePillaged(lua_State* L)
{
return BasicLuaMethod(L, &CvPlot::SetRoutePillaged);
}
#endif
#if defined(MOD_API_LUA_EXTENSIONS)
//------------------------------------------------------------------------------
int CvLuaPlot::lGetPlayerThatBuiltImprovement(lua_State* L)
{
return BasicLuaMethod(L, &CvPlot::GetPlayerThatBuiltImprovement);
Expand Down
3 changes: 3 additions & 0 deletions CvGameCoreDLL_Expansion2/Lua/CvLuaPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ class CvLuaPlot : public CvLuaScopedInstance<CvLuaPlot, CvPlot>
static int lGetRouteType(lua_State* L);
static int lSetRouteType(lua_State* L);
static int lIsRoutePillaged(lua_State* L);
#if defined(MOD_API_LUA_EXTENSIONS)
LUAAPIEXTN(SetRoutePillaged, void, bPillage);
#endif

#if defined(MOD_API_LUA_EXTENSIONS)
LUAAPIEXTN(GetPlayerThatBuiltImprovement, int);
Expand Down

0 comments on commit 9cc605a

Please sign in to comment.