From 1f3cf6c570155c93a5d58eed797243f3672b114e Mon Sep 17 00:00:00 2001 From: axatin <95587882+axatin@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:48:51 +0100 Subject: [PATCH] CvAssert and PRECONDITION (#11444) * CvAssert and PRECONDITION * Remove dev names in assert msgs * Fixes * Replace CvAssert with ASSERT, merge macro variants * Use chat window in multiplayer * Replace CvAssert everywhere * remove test assertion --- CvGameCoreDLLUtil/include/CvAssert.h | 48 +- CvGameCoreDLLUtil/include/CvString.h | 2 +- CvGameCoreDLL_Expansion2/CustomMods.h | 10 +- CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp | 60 +- CvGameCoreDLL_Expansion2/CvArea.cpp | 12 +- CvGameCoreDLL_Expansion2/CvArmyAI.cpp | 6 +- CvGameCoreDLL_Expansion2/CvBeliefClasses.cpp | 290 ++-- .../CvBuilderTaskingAI.cpp | 2 +- .../CvBuildingClasses.cpp | 692 ++++---- .../CvBuildingProductionAI.cpp | 4 +- CvGameCoreDLL_Expansion2/CvCity.cpp | 1422 +++++++-------- CvGameCoreDLL_Expansion2/CvCityCitizens.cpp | 80 +- CvGameCoreDLL_Expansion2/CvCityManager.cpp | 4 +- .../CvCitySpecializationAI.cpp | 6 +- CvGameCoreDLL_Expansion2/CvCityStrategyAI.cpp | 12 +- .../CvContractClasses.cpp | 10 +- .../CvCorporationClasses.cpp | 64 +- CvGameCoreDLL_Expansion2/CvCultureClasses.cpp | 50 +- .../CvDatabaseUtility.cpp | 14 +- CvGameCoreDLL_Expansion2/CvDatabaseUtility.h | 8 +- CvGameCoreDLL_Expansion2/CvDealAI.cpp | 288 ++-- CvGameCoreDLL_Expansion2/CvDealClasses.cpp | 156 +- CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp | 446 ++--- .../CvDiplomacyRequests.cpp | 20 +- CvGameCoreDLL_Expansion2/CvDllBuildInfo.cpp | 2 +- .../CvDllCivilizationInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllColorInfo.cpp | 2 +- .../CvDllDatabaseUtility.cpp | 8 +- .../CvDllDatabaseUtility.h | 4 +- CvGameCoreDLL_Expansion2/CvDllEraInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllFeatureInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllGame.cpp | 2 +- .../CvDllGameOptionInfo.cpp | 2 +- .../CvDllGameSpeedInfo.cpp | 2 +- .../CvDllHandicapInfo.cpp | 2 +- .../CvDllInterfaceModeInfo.cpp | 2 +- .../CvDllLeaderheadInfo.cpp | 2 +- .../CvDllMinorCivInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllMissionInfo.cpp | 2 +- .../CvDllNetMessageHandler.cpp | 58 +- .../CvDllPlayerColorInfo.cpp | 2 +- .../CvDllPlayerOptionInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllPlot.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllPolicyInfo.cpp | 2 +- .../CvDllPromotionInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllRandom.cpp | 2 +- .../CvDllResourceInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllTerrainInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllUnit.cpp | 2 +- .../CvDllUnitCombatClassInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllVictoryInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvDllWorldInfo.cpp | 2 +- CvGameCoreDLL_Expansion2/CvEconomicAI.cpp | 28 +- .../CvEmphasisClasses.cpp | 24 +- CvGameCoreDLL_Expansion2/CvEnumMap.h | 28 +- .../CvEspionageClasses.cpp | 232 +-- CvGameCoreDLL_Expansion2/CvFlavorManager.cpp | 14 +- CvGameCoreDLL_Expansion2/CvFractal.cpp | 8 +- CvGameCoreDLL_Expansion2/CvGame.cpp | 372 ++-- CvGameCoreDLL_Expansion2/CvGameCoreDLL.cpp | 2 +- CvGameCoreDLL_Expansion2/CvGameCoreDLLPCH.h | 19 +- .../CvGameCoreStructs.cpp | 6 +- CvGameCoreDLL_Expansion2/CvGameCoreUtils.cpp | 164 +- CvGameCoreDLL_Expansion2/CvGameCoreUtils.h | 8 +- CvGameCoreDLL_Expansion2/CvGameQueries.cpp | 2 +- CvGameCoreDLL_Expansion2/CvGameTextMgr.cpp | 2 +- CvGameCoreDLL_Expansion2/CvGlobals.cpp | 332 ++-- CvGameCoreDLL_Expansion2/CvGlobals.h | 2 +- .../CvGrandStrategyAI.cpp | 18 +- CvGameCoreDLL_Expansion2/CvHomelandAI.cpp | 6 +- .../CvImprovementClasses.cpp | 258 +-- CvGameCoreDLL_Expansion2/CvInfos.cpp | 574 +++--- .../CvInfosSerializationHelper.cpp | 4 +- .../CvInfosSerializationHelper.h | 18 +- CvGameCoreDLL_Expansion2/CvLoggerCSV.cpp | 6 +- CvGameCoreDLL_Expansion2/CvMap.cpp | 44 +- CvGameCoreDLL_Expansion2/CvMapGenerator.cpp | 4 +- CvGameCoreDLL_Expansion2/CvMilitaryAI.cpp | 28 +- CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp | 464 ++--- CvGameCoreDLL_Expansion2/CvNotifications.cpp | 20 +- CvGameCoreDLL_Expansion2/CvPlayer.cpp | 1532 ++++++++--------- CvGameCoreDLL_Expansion2/CvPlayerAI.cpp | 18 +- CvGameCoreDLL_Expansion2/CvPlot.cpp | 238 +-- CvGameCoreDLL_Expansion2/CvPlot.h | 12 +- CvGameCoreDLL_Expansion2/CvPlotInfo.cpp | 16 +- CvGameCoreDLL_Expansion2/CvPolicyAI.cpp | 6 +- CvGameCoreDLL_Expansion2/CvPolicyClasses.cpp | 450 ++--- CvGameCoreDLL_Expansion2/CvPreGame.cpp | 24 +- .../CvProcessProductionAI.cpp | 6 +- CvGameCoreDLL_Expansion2/CvProjectClasses.cpp | 20 +- .../CvProjectProductionAI.cpp | 6 +- .../CvPromotionClasses.cpp | 236 +-- .../CvReligionClasses.cpp | 10 +- CvGameCoreDLL_Expansion2/CvSerialize.h | 10 +- .../CvSiteEvaluationClasses.cpp | 4 +- CvGameCoreDLL_Expansion2/CvSpan.h | 30 +- .../CvStartPositioner.cpp | 20 +- CvGameCoreDLL_Expansion2/CvTacticalAI.h | 2 +- CvGameCoreDLL_Expansion2/CvTeam.cpp | 540 +++--- CvGameCoreDLL_Expansion2/CvTechAI.cpp | 8 +- CvGameCoreDLL_Expansion2/CvTechClasses.cpp | 128 +- CvGameCoreDLL_Expansion2/CvTradeClasses.cpp | 88 +- CvGameCoreDLL_Expansion2/CvTraitClasses.cpp | 414 ++--- CvGameCoreDLL_Expansion2/CvTreasury.cpp | 4 +- CvGameCoreDLL_Expansion2/CvTypes.cpp | 4 +- CvGameCoreDLL_Expansion2/CvUnit.cpp | 428 ++--- CvGameCoreDLL_Expansion2/CvUnitClasses.cpp | 112 +- CvGameCoreDLL_Expansion2/CvUnitCombat.cpp | 64 +- CvGameCoreDLL_Expansion2/CvUnitCycler.cpp | 4 +- CvGameCoreDLL_Expansion2/CvUnitMission.cpp | 66 +- .../CvUnitProductionAI.cpp | 2 +- CvGameCoreDLL_Expansion2/CvVotingClasses.cpp | 496 +++--- .../CvWonderProductionAI.cpp | 2 +- .../CvWorldBuilderMapLoader.cpp | 54 +- CvGameCoreDLL_Expansion2/Lua/CvLuaCity.cpp | 12 +- CvGameCoreDLL_Expansion2/Lua/CvLuaGame.cpp | 6 +- CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp | 28 +- CvGameCoreDLL_Expansion2/Lua/CvLuaUnit.cpp | 2 +- CvGameCoreDLL_Expansion2/VoxPopuli.vcxproj | 4 +- FirePlace/include/FireWorks/FAssert.h | 20 +- build_vp_clang.py | 5 +- 121 files changed, 5861 insertions(+), 5783 deletions(-) diff --git a/CvGameCoreDLLUtil/include/CvAssert.h b/CvGameCoreDLLUtil/include/CvAssert.h index 9a22b72872..c23d5ea8d4 100644 --- a/CvGameCoreDLLUtil/include/CvAssert.h +++ b/CvGameCoreDLLUtil/include/CvAssert.h @@ -5,9 +5,7 @@ //! This file includes assertion macros used by Civilization. //! //! Key Macros: -//! - CvAssert(expr) - assertions w/ no message -//! - CvAssertFmt(expr, fmt, ...) - assertions w/ printf style messages -//! - CvAssertMsg(expr, msg) - assertions w/ constant messages +//! - CvAssert(expr, ...) - assertions w/ printf style messages //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #ifndef _CVASSERT_H #define _CVASSERT_H @@ -23,48 +21,35 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool #define CVASSERT_BREAKPOINT assert(0) #endif -// Only compile in FAssert's if CVASSERT_ENABLE is defined. By default, however, let's key off of -// _DEBUG. Sometimes, however, it's useful to enable asserts in release builds, and you can do that -// simply by changing the following lines to define CVASSERT_ENABLE or using project settings to override -#if !defined(FINAL_RELEASE) || defined(VPDEBUG) +// Only compile in CvAssertMsg's in debug configuration, or in release configuration (with a more user-friendly text) if VPRELEASE_ERRORMSG is defined +// Asserts can be disabled by defining DISABLE_CVASSERT in the project settings +#if !defined(CVASSERT_ENABLE) && !defined(DISABLE_CVASSERT) +#if !defined(FINAL_RELEASE) || defined(VPDEBUG) || defined(VPRELEASE_ERRORMSG) #define CVASSERT_ENABLE #endif // FINAL_RELEASE - +#endif // DISABLE_CVASSERT #ifdef CVASSERT_ENABLE -#define CvAssertMsg(expr, msg) \ +// shows a message dialog if expr is false and CVASSERT_ENABLE is defined. +// Unlike PRECONDITION, a failed assertion does not cause the game to crash +#define ASSERT(expr, ...) \ { \ static bool bIgnoreAlways = false; \ - if( !bIgnoreAlways && !(expr) ) \ - { \ - if(CvAssertDlg(#expr, __FILE__, __LINE__, bIgnoreAlways, msg)) \ - { CVASSERT_BREAKPOINT; } \ - } \ -} - -#define CvAssertFmt(expr, fmt, ...) \ -{ \ - static bool bIgnoreAlways = false; \ - if( !bIgnoreAlways && !(expr) ) \ + if( !bIgnoreAlways && !(expr) ) \ { \ CvString str; \ - CvString::format(str, fmt, __VA_ARGS__); \ - if(CvAssertDlg(#expr, __FILE__, __LINE__, \ - bIgnoreAlways, str.c_str())) \ - { CVASSERT_BREAKPOINT; } \ + CvString::format(str, __VA_ARGS__); \ + if(CvAssertDlg(#expr, __FILE__, __LINE__, bIgnoreAlways, str.c_str())) \ + { CVASSERT_BREAKPOINT; } \ } \ } -#define CvAssert( expr ) CvAssertMsg(expr, "") - // An assert that only happens in the when CVASSERT_ENABLE is true AND it is a debug build #ifdef _DEBUG -#define CvAssert_Debug( expr ) CvAssertMsg(expr, "") -#define CvAssertMsg_Debug(expr, msg) CvAssertMsg(expr, msg) +#define CvAssert_Debug( expr, ...) CvAssertMsg( expr, __VA_ARGS__) #else -#define CvAssert_Debug(expr) -#define CvAssertMsg_Debug(expr, msg) +#define CvAssert_Debug(expr, ...) #endif #if 0 // disabling Object Validation @@ -106,11 +91,8 @@ struct ObjectValidator #else //CVASSERT_ENABLE == FALSE -#define CvAssertFmt(expr, fmt, ...) -#define CvAssertMsg(expr, msg) #define CvAssert(expr) #define CvAssert_Debug(expr) -#define CvAssertMsg_Debug(expr, msg) #define OBJECT_VALIDATE_DEFINITION(ObjectType) #define OBJECT_ALLOCATED diff --git a/CvGameCoreDLLUtil/include/CvString.h b/CvGameCoreDLLUtil/include/CvString.h index 906f7331bd..73b16666c8 100644 --- a/CvGameCoreDLLUtil/include/CvString.h +++ b/CvGameCoreDLLUtil/include/CvString.h @@ -22,7 +22,7 @@ class CvString : public std::string public: CvString() {} CvString(int iLen) { reserve(iLen); } - CvString(const char* s) : std::string(s ? s : "") {CvAssertMsg(s != NULL, "Passing NULL to std::string; possible heap corruption!");} + CvString(const char* s) : std::string(s ? s : "") {ASSERT(s != NULL, "Passing NULL to std::string; possible heap corruption!");} CvString(const std::string& s): std::string(s) {} ~CvString() {} diff --git a/CvGameCoreDLL_Expansion2/CustomMods.h b/CvGameCoreDLL_Expansion2/CustomMods.h index 4eea11fcf4..fb8abfde8f 100644 --- a/CvGameCoreDLL_Expansion2/CustomMods.h +++ b/CvGameCoreDLL_Expansion2/CustomMods.h @@ -1213,11 +1213,11 @@ void CheckSentinel(uint); #define MOD_SERIALIZE_INIT_WRITE_NO_SENTINEL(stream) uint uiDllSaveVersion = MOD_DLL_VERSION_NUMBER; (stream) << uiDllSaveVersion; #define MOD_SERIALIZE_INIT_WRITE(stream) uint uiDllSaveVersion = MOD_DLL_VERSION_NUMBER; (stream) << uiDllSaveVersion; (stream) << 0xDEADBEEF; -#define MOD_SERIALIZE_WRITE(stream, member) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member -#define MOD_SERIALIZE_WRITE_AUTO(stream, member) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member -#define MOD_SERIALIZE_WRITE_ARRAY(stream, member, type, size) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapper(size, member) -#define MOD_SERIALIZE_WRITE_CONSTARRAY(stream, member, type, size) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapperConst(size, member) -#define MOD_SERIALIZE_WRITE_HASH(stream, member, type, size, obj) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); CvInfosSerializationHelper::WriteHashedDataArray(stream, member, size) +#define MOD_SERIALIZE_WRITE(stream, member) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member +#define MOD_SERIALIZE_WRITE_AUTO(stream, member) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member +#define MOD_SERIALIZE_WRITE_ARRAY(stream, member, type, size) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapper(size, member) +#define MOD_SERIALIZE_WRITE_CONSTARRAY(stream, member, type, size) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapperConst(size, member) +#define MOD_SERIALIZE_WRITE_HASH(stream, member, type, size, obj) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); CvInfosSerializationHelper::WriteHashedDataArray(stream, member, size) #else #define MOD_SERIALIZE_INIT_READ(stream) __noop #define MOD_SERIALIZE_READ(version, stream, member, def) __noop diff --git a/CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp b/CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp index b85e063f21..0f1b0ae98c 100644 --- a/CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp +++ b/CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp @@ -86,22 +86,22 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = false; strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_ECONOMIC"); bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_ECONOMIC, strLoc.toUTF8(), 99); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_MILITARY"); bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 99); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_SCIENCE"); bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 99); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_FOREIGN"); bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_FOREIGN, strLoc.toUTF8(), 99); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; std::stable_sort(&m_aCounsel[0], &m_aCounsel[0] + m_aCounsel.size(), CounselSort); @@ -123,7 +123,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) { strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText()); bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance()); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -143,7 +143,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) if(pMilitaryAI->IsUsingStrategy(eStrategy)) { CvMilitaryAIStrategyXMLEntry* pStrategy = pMilitaryAI->GetMilitaryAIStrategies()->GetEntry(iStrategiesLoop); - CvAssert(pStrategy != NULL); + ASSERT(pStrategy != NULL); if(pStrategy) { // if this strategy has an advisor set, then try to add it to the list @@ -151,7 +151,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) { strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText()); bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance()); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -181,7 +181,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText()); strLoc << pLoopCity->getNameKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance()); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -228,7 +228,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -244,7 +244,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getBuildingInfo(pPlayerTechs->GetCivTechUniqueBuilding(eTech))->GetTextKey(); strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -260,7 +260,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getImprovementInfo(pPlayerTechs->GetCivTechUniqueImprovement(eTech))->GetTextKey(); strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -276,7 +276,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << pPlayerTechs->GetTechs()->GetEntry(eTech)->GetTextKey(); strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -300,7 +300,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << pPlayerTechs->GetTechs()->GetEntry(eTech)->GetTextKey(); strLoc << GC.getResourceInfo(eResource)->GetTextKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 60); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if (!bSuccess) { break; @@ -368,7 +368,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) } bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 15); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -443,7 +443,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 15); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } } @@ -459,7 +459,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 15); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } } @@ -512,7 +512,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), iRating); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } @@ -974,7 +974,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) if(eAdvisor != NO_ADVISOR_TYPE) { bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -1096,7 +1096,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) if(eAdvisor != NO_ADVISOR_TYPE) { bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -1308,7 +1308,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) { bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } } @@ -1380,7 +1380,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -1449,7 +1449,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey(); break; default: - CvAssertMsg(false, "No entry for this quest type!"); + ASSERT(false, "No entry for this quest type!"); break; } } @@ -1520,7 +1520,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey(); break; default: - CvAssertMsg(false, "No entry for this quest type!"); + ASSERT(false, "No entry for this quest type!"); break; } } @@ -1590,7 +1590,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey(); break; default: - CvAssertMsg(false, "No entry for this quest type!"); + ASSERT(false, "No entry for this quest type!"); break; } } @@ -1614,7 +1614,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) if(iMessageRating > 0) { bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -1706,7 +1706,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) strLoc << GC.getBuildingInfo(eRecommendedResearchBuilding)->GetTextKey(); bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 20); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); if(!bSuccess) { break; @@ -1832,7 +1832,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_ECONOMIC, strLoc.toUTF8(), 20); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } @@ -1934,7 +1934,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) } else { - CvAssertMsg(false, "Can't trade a bonus resource"); + ASSERT(false, "Can't trade a bonus resource"); } strLoc << GC.getResourceInfo(eTradableResource)->GetTextKey(); @@ -1942,7 +1942,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_FOREIGN, strLoc.toUTF8(), 20); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } @@ -1987,7 +1987,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer) bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisorTypes, strLoc.toUTF8(), 0); DEBUG_VARIABLE(bSuccess); - CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); + ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once"); uiCounselIndex++; } } diff --git a/CvGameCoreDLL_Expansion2/CvArea.cpp b/CvGameCoreDLL_Expansion2/CvArea.cpp index b21046f90a..3c533cf209 100644 --- a/CvGameCoreDLL_Expansion2/CvArea.cpp +++ b/CvGameCoreDLL_Expansion2/CvArea.cpp @@ -184,7 +184,7 @@ int CvArea::getNumTiles() const void CvArea::changeNumTiles(int iChange) { m_iNumTiles = (m_iNumTiles + iChange); - CvAssert(m_iNumTiles >= 0); + ASSERT(m_iNumTiles >= 0); } @@ -206,8 +206,8 @@ int CvArea::getNumUnownedTiles() const void CvArea::changeNumOwnedTiles(int iChange) { m_iNumOwnedTiles = (m_iNumOwnedTiles + iChange); - CvAssert(getNumOwnedTiles() >= 0); - CvAssert(getNumUnownedTiles() >= 0); + ASSERT(getNumOwnedTiles() >= 0); + ASSERT(getNumUnownedTiles() >= 0); } @@ -222,7 +222,7 @@ int CvArea::getNumRiverEdges() const void CvArea::changeNumRiverEdges(int iChange) { m_iNumRiverEdges = (m_iNumRiverEdges + iChange); - CvAssert(getNumRiverEdges() >= 0); + ASSERT(getNumRiverEdges() >= 0); } @@ -257,7 +257,7 @@ int CvArea::getNumStartingPlots() const void CvArea::changeNumStartingPlots(int iChange) { m_iNumStartingPlots = m_iNumStartingPlots + iChange; - CvAssert(getNumStartingPlots() >= 0); + ASSERT(getNumStartingPlots() >= 0); } #if defined(MOD_BALANCE_CORE) @@ -584,7 +584,7 @@ void CvArea::setTotalFoundValue(int iNewValue) { //avoid overflow m_iTotalFoundValue = min(INT_MAX/2,max(0,iNewValue)); - CvAssert(m_iTotalFoundValue >= 0); + ASSERT(m_iTotalFoundValue >= 0); } // -------------------------------------------------------------------------------- diff --git a/CvGameCoreDLL_Expansion2/CvArmyAI.cpp b/CvGameCoreDLL_Expansion2/CvArmyAI.cpp index 546c526a1a..4854819d39 100644 --- a/CvGameCoreDLL_Expansion2/CvArmyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvArmyAI.cpp @@ -71,8 +71,8 @@ void CvArmyAI::Reset(int iID, PlayerTypes eOwner, int iOperationID) /// Delete the army void CvArmyAI::Kill() { - CvAssert(GetOwner() != NO_PLAYER); - CvAssertMsg(GetID() != -1, "GetID() is not expected to be equal with -1"); + ASSERT(GetOwner() != NO_PLAYER); + ASSERT(GetID() != -1, "GetID() is not expected to be equal with -1"); ReleaseAllUnits(); @@ -550,7 +550,7 @@ CvPlot* CvArmyAI::GetGoalPlot() const /// Set target plot for army movement void CvArmyAI::SetGoalPlot(CvPlot* pGoalPlot) { - CvAssertMsg(pGoalPlot, "Setting army goal to a NULL plot - please show Ed and send save."); + ASSERT(pGoalPlot, "Setting army goal to a NULL plot."); if(pGoalPlot) { diff --git a/CvGameCoreDLL_Expansion2/CvBeliefClasses.cpp b/CvGameCoreDLL_Expansion2/CvBeliefClasses.cpp index 7a611ea6fc..9c12910ab6 100644 --- a/CvGameCoreDLL_Expansion2/CvBeliefClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvBeliefClasses.cpp @@ -544,8 +544,8 @@ int CvBeliefEntry::GetPressureChangeTradeRoute() const /// Accessor:: Yield Per Pop int CvBeliefEntry::GetYieldPerActiveTR(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerActiveTR ? m_piYieldPerActiveTR[i] : -1; } @@ -560,29 +560,29 @@ int CvBeliefEntry::GetYieldPerWorldWonderConstruction(int i) const int CvBeliefEntry::GetYieldPerPop(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerPop ? m_piYieldPerPop[i] : -1; } /// Accessor:: Yield Per GPT int CvBeliefEntry::GetYieldPerGPT(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerGPT ? m_piYieldPerGPT[i] : -1; } /// Accessor:: Yield Per Luxury int CvBeliefEntry::GetYieldPerLux(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerLux ? m_piYieldPerLux[i] : -1; } /// Accessor:: Yield Per Border Growth int CvBeliefEntry::GetYieldPerBorderGrowth (YieldTypes eYield, bool bEraScaling) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldPerBorderGrowth.find((int)eYield); if (itYield != m_pbiYieldPerBorderGrowth.end()) @@ -598,8 +598,8 @@ int CvBeliefEntry::GetYieldPerBorderGrowth (YieldTypes eYield, bool bEraScaling) /// Accessor:: Yield Per Heal int CvBeliefEntry::GetYieldPerHeal (int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerHeal ? m_piYieldPerHeal[i] : -1; } /// Accessor:: Yield Per Birth @@ -616,64 +616,64 @@ int CvBeliefEntry::GetYieldPerHolyCityBirth(int i) const /// Accessor:: Yield Per Science int CvBeliefEntry::GetYieldPerScience(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerScience ? m_piYieldPerScience[i] : -1; } /// Accessor:: Yield Per GP Use int CvBeliefEntry::GetYieldFromGPUse(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromGPUse ? m_piYieldFromGPUse[i] : -1; } /// Accessor:: Yield Bonus GA int CvBeliefEntry::GetYieldBonusGoldenAge(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldBonusGoldenAge ? m_piYieldBonusGoldenAge[i] : -1; } /// Accessor:: Yield From Spread int CvBeliefEntry::GetYieldFromSpread(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpread ? m_piYieldFromSpread[i] : -1; } /// Accessor:: Yield From Foreign Spread int CvBeliefEntry::GetYieldFromForeignSpread(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromForeignSpread ? m_piYieldFromForeignSpread[i] : -1; } /// Accessor:: Yield Conquest int CvBeliefEntry::GetYieldFromConquest(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromConquest ? m_piYieldFromConquest[i] : -1; } /// Accessor:: Yield Policy Unlock int CvBeliefEntry::GetYieldFromPolicyUnlock(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPolicyUnlock ? m_piYieldFromPolicyUnlock[i] : -1; } /// Accessor:: Yield Era Unlock int CvBeliefEntry::GetYieldFromEraUnlock(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromEraUnlock ? m_piYieldFromEraUnlock[i] : -1; } /// Accessor:: Yield Tech Unlock int CvBeliefEntry::GetYieldFromTechUnlock(YieldTypes eYield, bool bEraScaling) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromTechUnlock.find((int)eYield); if (itYield != m_pbiYieldFromTechUnlock.end()) @@ -689,64 +689,64 @@ int CvBeliefEntry::GetYieldFromTechUnlock(YieldTypes eYield, bool bEraScaling) c /// Accessor:: Yield from Conversion int CvBeliefEntry::GetYieldFromConversion(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromConversion ? m_piYieldFromConversion[i] : -1; } int CvBeliefEntry::GetYieldFromConversionExpo(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromConversionExpo ? m_piYieldFromConversionExpo[i] : -1; } /// Accessor:: Yield from WTLKD int CvBeliefEntry::GetYieldFromWLTKD(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromWLTKD ? m_piYieldFromWLTKD[i] : -1; } /// Accessor:: Yield from Proposal int CvBeliefEntry::GetYieldFromProposal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromProposal ? m_piYieldFromProposal[i] : -1; } /// Accessor:: Yield from Vote int CvBeliefEntry::GetYieldFromHost(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromHost ? m_piYieldFromHost[i] : -1; } int CvBeliefEntry::GetYieldFromFaithPurchase(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromFaithPurchase ? m_piYieldFromFaithPurchase[i] : -1; } /// Accessor:: Yield from Known Pantheons int CvBeliefEntry::GetYieldFromKnownPantheons(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromKnownPantheons ? m_piYieldFromKnownPantheons[i] : -1; } /// Accessor:: Yield from Followers int CvBeliefEntry::GetMaxYieldPerFollower(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piMaxYieldPerFollower ? m_piMaxYieldPerFollower[i] : -1; } /// Accessor:: Yield from Followers Halved int CvBeliefEntry::GetMaxYieldPerFollowerPercent(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piMaxYieldPerFollowerPercent ? m_piMaxYieldPerFollowerPercent[i] : -1; } @@ -762,8 +762,8 @@ int CvBeliefEntry::GetCSYieldBonus() const /// Accessor:: Extra yield from an improvement int CvBeliefEntry::GetImprovementVoteChange(ImprovementTypes eIndex1) const { - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); return m_piImprovementVoteChange ? m_piImprovementVoteChange[eIndex1] : 0; } @@ -910,88 +910,88 @@ int CvBeliefEntry::GetYieldPerOtherReligionFollower(int i) const /// Accessor:: Additional quantity of a specific resource int CvBeliefEntry::GetResourceQuantityModifier(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityModifiers ? m_piResourceQuantityModifiers[i] : -1; } /// Accessor:: Extra yield from an improvement int CvBeliefEntry::GetImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiImprovementYieldChanges ? m_ppiImprovementYieldChanges[eIndex1][eIndex2] : 0; } /// Yield change for a specific BuildingClass by yield type int CvBeliefEntry::GetBuildingClassYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldChanges[i][j]; } /// Amount of extra Happiness per turn a BuildingClass provides int CvBeliefEntry::GetBuildingClassHappiness(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassHappiness ? m_paiBuildingClassHappiness[i] : -1; } /// Amount of extra Tourism per turn a BuildingClass provides int CvBeliefEntry::GetBuildingClassTourism(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassTourism ? m_paiBuildingClassTourism[i] : -1; } /// Change to Feature yield by type int CvBeliefEntry::GetFeatureYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiFeatureYieldChange ? m_ppaiFeatureYieldChange[i][j] : -1; } int CvBeliefEntry::GetYieldPerXTerrainTimes100(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiYieldPerXTerrain ? m_ppiYieldPerXTerrain[i][j] : 0; } int CvBeliefEntry::GetYieldPerXFeatureTimes100(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiYieldPerXFeature ? m_ppiYieldPerXFeature[i][j] : 0; } int CvBeliefEntry::GetCityYieldFromUnimprovedFeature(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiCityYieldFromUnimprovedFeature ? m_ppiCityYieldFromUnimprovedFeature[i][j] : 0; } int CvBeliefEntry::GetUnimprovedFeatureYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiUnimprovedFeatureYieldChanges ? m_ppiUnimprovedFeatureYieldChanges[i][j] : 0; } int CvBeliefEntry::GetLakePlotYieldChange(int i) const @@ -1002,54 +1002,54 @@ int CvBeliefEntry::GetLakePlotYieldChange(int i) const /// Change to Resource yield by type int CvBeliefEntry::GetResourceYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiResourceYieldChange ? m_ppaiResourceYieldChange[i][j] : -1; } /// Change to yield by terrain int CvBeliefEntry::GetTerrainYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiTerrainYieldChange ? m_ppaiTerrainYieldChange[i][j] : -1; } int CvBeliefEntry::GetTradeRouteYieldChange(int i, int j) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTradeRouteYieldChange ? m_ppiTradeRouteYieldChange[i][j] : 0; } int CvBeliefEntry::GetSpecialistYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiSpecialistYieldChange ? m_ppiSpecialistYieldChange[i][j] : 0; } int CvBeliefEntry::GetGreatPersonExpendedYield(int i, int j) const { - CvAssertMsg(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiGreatPersonExpendedYield ? m_ppiGreatPersonExpendedYield[i][j] : 0; } int CvBeliefEntry::GetGoldenAgeGreatPersonRateModifier(int i) const { - CvAssertMsg(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoldenAgeGreatPersonRateModifier ? m_piGoldenAgeGreatPersonRateModifier[i] : 0; } @@ -1071,40 +1071,40 @@ int CvBeliefEntry::GetGreatWorkYieldChange(int i) const /// Do we get one of our yields from defeating an enemy? int CvBeliefEntry::GetYieldFromKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromKills[(int)eYield]; } int CvBeliefEntry::GetYieldFromRemoveHeresy(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromRemoveHeresy[(int)eYield]; } /// Do we get one of our yields from defeating a barbarian? int CvBeliefEntry::GetYieldFromBarbarianKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromBarbarianKills[(int)eYield]; } int CvBeliefEntry::GetGreatPersonPoints(GreatPersonTypes i) const { - CvAssertMsg(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGreatPersonPoints ? m_piGreatPersonPoints[i] : 0; } /// Change to yield by plot int CvBeliefEntry::GetPlotYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumPlotInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPlotInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiPlotYieldChange ? m_ppiPlotYieldChange[i][j] : -1; } @@ -1118,8 +1118,8 @@ std::vector CvBeliefEntry::GetFreePromotions() const /// Instant yield when finishing an improvement build (roads are not improvements) int CvBeliefEntry::GetYieldFromImprovementBuild(YieldTypes eYield, bool bEraScaling) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromImprovementBuild.find((int)eYield); if (itYield != m_pbiYieldFromImprovementBuild.end()) @@ -1136,8 +1136,8 @@ int CvBeliefEntry::GetYieldFromImprovementBuild(YieldTypes eYield, bool bEraScal /// Instant yield when pillaging int CvBeliefEntry::GetYieldFromPillageGlobal(YieldTypes eYield, bool bEraScaling) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromPillageGlobal.find((int)eYield); if (itYield != m_pbiYieldFromPillageGlobal.end()) @@ -1155,86 +1155,86 @@ int CvBeliefEntry::GetYieldFromPillageGlobal(YieldTypes eYield, bool bEraScaling /// Happiness from a resource int CvBeliefEntry::GetResourceHappiness(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceHappiness ? m_piResourceHappiness[i] : -1; } /// Yield boost from having a specialist of any type in city int CvBeliefEntry::GetYieldChangeAnySpecialist(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeAnySpecialist ? m_piYieldChangeAnySpecialist[i] : -1; } /// Yield boost from a trade route int CvBeliefEntry::GetYieldChangeTradeRoute(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeTradeRoute ? m_piYieldChangeTradeRoute[i] : -1; } /// Yield boost from a natural wonder int CvBeliefEntry::GetYieldChangeNaturalWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeNaturalWonder ? m_piYieldChangeNaturalWonder[i] : -1; } /// Yield boost from a world wonder int CvBeliefEntry::GetYieldChangeWorldWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeWorldWonder ? m_piYieldChangeWorldWonder[i] : -1; } /// Yield percentage boost from a natural wonder int CvBeliefEntry::GetYieldModifierNaturalWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifierNaturalWonder ? m_piYieldModifierNaturalWonder[i] : -1; } /// Do we get a yield modifier int CvBeliefEntry::GetMaxYieldModifierPerFollower(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piMaxYieldModifierPerFollower ? m_piMaxYieldModifierPerFollower[i] : -1; } int CvBeliefEntry::GetMaxYieldModifierPerFollowerPercent(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piMaxYieldModifierPerFollowerPercent ? m_piMaxYieldModifierPerFollowerPercent[i] : -1; } /// Can we buy units of this era with faith? bool CvBeliefEntry::IsFaithUnitPurchaseEra(int i) const { - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(i < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumEraInfos(), "Index out of bounds"); return m_pbFaithPurchaseUnitEraEnabled ? m_pbFaithPurchaseUnitEraEnabled[i] : false; } #if defined(MOD_BALANCE_CORE) /// Can we buy units of this type with faith? bool CvBeliefEntry::IsFaithUnitPurchaseSpecific(int i) const { - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); return m_pbFaithPurchaseUnitSpecificEnabled ? m_pbFaithPurchaseUnitSpecificEnabled[i] : false; } #endif /// Can we buy units of this era with faith? bool CvBeliefEntry::IsBuildingClassEnabled(int i) const { - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); return m_pbBuildingClassEnabled ? m_pbBuildingClassEnabled[i] : false; } @@ -4695,7 +4695,7 @@ bool CvBeliefHelpers::ConvertBarbarianUnit(const CvUnit *pByUnit, CvUnit* pUnit) // Convert the barbarian into our unit pNewUnit = pPlayer->initUnit(pUnit->getUnitType(), pUnit->getX(), pUnit->getY(), pUnit->AI_getUnitAIType(), REASON_CONVERT, true /*bNoMove*/, false); - CvAssertMsg(pNewUnit, "pNewUnit is not assigned a valid value"); + ASSERT(pNewUnit, "pNewUnit is not assigned a valid value"); pNewUnit->convert(pUnit, false); pNewUnit->setupGraphical(); pNewUnit->finishMoves(); // No move first turn diff --git a/CvGameCoreDLL_Expansion2/CvBuilderTaskingAI.cpp b/CvGameCoreDLL_Expansion2/CvBuilderTaskingAI.cpp index b76f3b0a72..0da0a80830 100644 --- a/CvGameCoreDLL_Expansion2/CvBuilderTaskingAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvBuilderTaskingAI.cpp @@ -1423,7 +1423,7 @@ bool CvBuilderTaskingAI::ExecuteWorkerMove(CvUnit* pUnit, BuilderDirective aDire { pUnit->PushMission(CvTypes::getMISSION_BUILD(), aDirective.m_eBuild, aDirective.m_eDirectiveType, 0, false, false, MISSIONAI_BUILD, pPlot); - CvAssertMsg(!pUnit->ReadyToMove(), "Worker did not do their mission this turn. Could cause game to hang."); + ASSERT(!pUnit->ReadyToMove(), "Worker did not do their mission this turn. Could cause game to hang."); bSuccessful = true; } diff --git a/CvGameCoreDLL_Expansion2/CvBuildingClasses.cpp b/CvGameCoreDLL_Expansion2/CvBuildingClasses.cpp index 6d90cd3db2..eb80050c83 100644 --- a/CvGameCoreDLL_Expansion2/CvBuildingClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvBuildingClasses.cpp @@ -832,7 +832,7 @@ bool CvBuildingEntry::CacheResults(Database::Results& kResults, CvDatabaseUtilit //This may need to be deferred to a routine that is called AFTER pre-fetch has been called for all infos. m_pkBuildingClassInfo = GC.getBuildingClassInfo(static_cast(m_iBuildingClassType)); - CvAssertMsg(m_pkBuildingClassInfo, "Could not find BuildingClassInfo for BuildingType. Have BuildingClasses been prefetched yet?"); + ASSERT(m_pkBuildingClassInfo, "Could not find BuildingClassInfo for BuildingType. Have BuildingClasses been prefetched yet?"); szTextVal = kResults.GetText("ArtDefineTag"); SetArtDefineTag(szTextVal); @@ -1703,7 +1703,7 @@ const CvBuildingClassInfo& CvBuildingEntry::GetBuildingClassInfo() const { const char* szError = "ERROR: Building does not contain valid BuildingClass type!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } else @@ -2800,8 +2800,8 @@ bool CvBuildingEntry::IsSecondaryPantheon() const /// Change to Great Work yield by type int CvBuildingEntry::GetGreatWorkYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGreatWorkYieldChange ? m_piGreatWorkYieldChange[i] : -1; } /// Array of yield changes to Great Works @@ -2813,8 +2813,8 @@ int* CvBuildingEntry::GetGreatWorkYieldChangeArray() const /// Change to Great Work yield by type int CvBuildingEntry::GetGreatWorkYieldChangeLocal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGreatWorkYieldChangeLocal ? m_piGreatWorkYieldChangeLocal[i] : -1; } /// Array of yield changes to Great Works @@ -3192,8 +3192,8 @@ int CvBuildingEntry::GetBasePressureModGlobal() const /// Change to yield by type int CvBuildingEntry::GetGrowthExtraYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGrowthExtraYield ? m_piGrowthExtraYield[i] : -1; } @@ -3213,8 +3213,8 @@ int CvBuildingEntry::GetNeedBuildingThisCity() const /// Change to yield by type if unit defeated in battle int CvBuildingEntry::GetYieldFromDeath(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromDeath ? m_piYieldFromDeath[i] : -1; } /// Array of yield changes @@ -3227,8 +3227,8 @@ int* CvBuildingEntry::GetYieldFromDeathArray() const /// Change to yield if victorious in battle. int CvBuildingEntry::GetYieldFromVictory(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictory ? m_piYieldFromVictory[i] : -1; } /// Array of yield changes @@ -3240,8 +3240,8 @@ int* CvBuildingEntry::GetYieldFromVictoryArray() const /// Change to yield if victorious in battle. int CvBuildingEntry::GetYieldFromVictoryGlobal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictoryGlobal ? m_piYieldFromVictoryGlobal[i] : -1; } /// Array of yield changes @@ -3253,8 +3253,8 @@ int* CvBuildingEntry::GetYieldFromVictoryGlobalArray() const /// Change to yield if victorious in battle, scaling with era. int CvBuildingEntry::GetYieldFromVictoryGlobalEraScaling(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictoryGlobalEraScaling ? m_piYieldFromVictoryGlobalEraScaling[i] : -1; } /// Array of yield changes @@ -3266,8 +3266,8 @@ int* CvBuildingEntry::GetYieldFromVictoryGlobalEraScalingArray() const /// Change to yield if victorious in battle while in a golden age int CvBuildingEntry::GetYieldFromVictoryGlobalInGoldenAge(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictoryGlobalInGoldenAge ? m_piYieldFromVictoryGlobalInGoldenAge[i] : -1; } /// Array of yield changes @@ -3279,8 +3279,8 @@ int* CvBuildingEntry::GetYieldFromVictoryGlobalInGoldenAgeArray() const /// Change to yield if victorious in battle while in a golden age, scaling with era. int CvBuildingEntry::GetYieldFromVictoryGlobalInGoldenAgeEraScaling(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictoryGlobalInGoldenAgeEraScaling ? m_piYieldFromVictoryGlobalInGoldenAgeEraScaling[i] : -1; } /// Array of yield changes @@ -3294,8 +3294,8 @@ int* CvBuildingEntry::GetYieldFromVictoryGlobalInGoldenAgeEraScalingArray() cons /// Change to yield if victorious in battle. int CvBuildingEntry::GetYieldFromVictoryGlobalPlayer(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromVictoryGlobalPlayer ? m_piYieldFromVictoryGlobalPlayer[i] : -1; } /// Array of yield changes @@ -3307,8 +3307,8 @@ int* CvBuildingEntry::GetYieldFromVictoryGlobalPlayerArray() const /// Change to yield if pillaging int CvBuildingEntry::GetYieldFromPillage(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPillage ? m_piYieldFromPillage[i] : -1; } /// Array of yield changes @@ -3320,8 +3320,8 @@ int* CvBuildingEntry::GetYieldFromPillageArray() const /// Change to yield if pillaging int CvBuildingEntry::GetYieldFromPillageGlobal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPillageGlobal ? m_piYieldFromPillageGlobal[i] : -1; } /// Array of yield changes @@ -3333,8 +3333,8 @@ int* CvBuildingEntry::GetYieldFromPillageGlobalArray() const /// Change to yield if pillaging int CvBuildingEntry::GetYieldFromPillageGlobalPlayer(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPillageGlobalPlayer ? m_piYieldFromPillageGlobalPlayer[i] : -1; } /// Array of yield changes @@ -3347,8 +3347,8 @@ int* CvBuildingEntry::GetYieldFromPillageGlobalPlayerArray() const /// Instant yield when starting a golden age int CvBuildingEntry::GetYieldFromGoldenAgeStart(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromGoldenAgeStart ? m_piYieldFromGoldenAgeStart[i] : -1; } /// Array of yield changes @@ -3360,8 +3360,8 @@ int* CvBuildingEntry::GetYieldFromGoldenAgeStartArray() const /// Yields permamently added whenever a golden age starts int CvBuildingEntry::GetYieldChangePerGoldenAge(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangePerGoldenAge ? m_piYieldChangePerGoldenAge[i] : -1; } /// Array of yield changes @@ -3373,8 +3373,8 @@ int* CvBuildingEntry::GetYieldChangePerGoldenAgeArray() const /// cap to the values in GetYieldChangesPerGoldenAge int CvBuildingEntry::GetYieldChangePerGoldenAgeCap(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangePerGoldenAgeCap ? m_piYieldChangePerGoldenAgeCap[i] : -1; } /// Array of yield changes @@ -3386,8 +3386,8 @@ int* CvBuildingEntry::GetYieldChangePerGoldenAgeCapArray() const /// Change to yield during golden ages int CvBuildingEntry::GetGoldenAgeYieldMod(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoldenAgeYieldMod ? m_piGoldenAgeYieldMod[i] : -1; } /// Array of yield changes @@ -3399,8 +3399,8 @@ int* CvBuildingEntry::GetGoldenAgeYieldModArray() const /// Change to yield during WLTKD int CvBuildingEntry::GetYieldFromWLTKD(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromWLTKD ? m_piYieldFromWLTKD[i] : -1; } /// Array of yield changes @@ -3412,8 +3412,8 @@ int* CvBuildingEntry::GetYieldFromWLTKDArray() const /// Free Yield from GP Expend int CvBuildingEntry::GetYieldFromGPExpend(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromGPExpend ? m_piYieldFromGPExpend[i] : -1; } /// Array of yield changes @@ -3424,8 +3424,8 @@ int* CvBuildingEntry::GetYieldFromGPExpendArray() const /// Free Yield from Tech unlocked int CvBuildingEntry::GetYieldFromTech(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromTech ? m_piYieldFromTech[i] : -1; } /// Array of yield changes @@ -3436,8 +3436,8 @@ int* CvBuildingEntry::GetYieldFromTechArray() const /// Does this Policy grant yields from constructing buildings? int CvBuildingEntry::GetYieldFromConstruction(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromConstruction[i]; } /// Array of yield changes @@ -3448,8 +3448,8 @@ int* CvBuildingEntry::GetYieldFromConstructionArray() const int CvBuildingEntry::GetYieldFromBirth(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirth[i]; } /// Array of yield changes @@ -3459,8 +3459,8 @@ int* CvBuildingEntry::GetYieldFromBirthArray() const } int CvBuildingEntry::GetYieldFromBirthEraScaling(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirthEraScaling[i]; } /// Array of yield changes @@ -3470,8 +3470,8 @@ int* CvBuildingEntry::GetYieldFromBirthEraScalingArray() const } int CvBuildingEntry::GetYieldFromBirthRetroactive(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirthRetroactive[i]; } /// Array of yield changes @@ -3481,8 +3481,8 @@ int* CvBuildingEntry::GetYieldFromBirthRetroactiveArray() const } int CvBuildingEntry::GetYieldFromUnitProduction(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromUnitProduction[i]; } /// Array of yield changes @@ -3493,8 +3493,8 @@ int* CvBuildingEntry::GetYieldFromUnitProductionArray() const int CvBuildingEntry::GetYieldFromBorderGrowth(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBorderGrowth[i]; } /// Array of yield changes @@ -3505,8 +3505,8 @@ int* CvBuildingEntry::GetYieldFromBorderGrowthArray() const int CvBuildingEntry::GetYieldFromPolicyUnlock(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPolicyUnlock[i]; } /// Array of yield changes @@ -3517,8 +3517,8 @@ int* CvBuildingEntry::GetYieldFromPolicyUnlockArray() const int CvBuildingEntry::GetYieldFromUnitLevelUp(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromUnitLevelUp[i]; } /// Array of yield changes @@ -3529,8 +3529,8 @@ int* CvBuildingEntry::GetYieldFromUnitLevelUpArray() const int CvBuildingEntry::GetYieldFromCombatExperienceTimes100(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromCombatExperienceTimes100[i]; } /// Array of yield changes @@ -3542,8 +3542,8 @@ int* CvBuildingEntry::GetYieldFromCombatExperienceTimes100Array() const int CvBuildingEntry::GetYieldFromPurchase(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPurchase[i]; } /// Array of yield changes @@ -3554,8 +3554,8 @@ int* CvBuildingEntry::GetYieldFromPurchaseArray() const int CvBuildingEntry::GetYieldFromPurchaseGlobal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromPurchaseGlobal[i]; } /// Array of yield changes @@ -3566,8 +3566,8 @@ int* CvBuildingEntry::GetYieldFromPurchaseGlobalArray() const int CvBuildingEntry::GetYieldFromFaithPurchase(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromFaithPurchase[i]; } /// Array of yield changes @@ -3579,8 +3579,8 @@ int* CvBuildingEntry::GetYieldFromFaithPurchaseArray() const /// Does this Policy grant yields from constructing buildings? int CvBuildingEntry::GetYieldFromInternalTREnd(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromInternalTREnd[i]; } /// Array of yield changes @@ -3593,8 +3593,8 @@ int* CvBuildingEntry::GetYieldFromInternalTREndArray() const /// Does this Policy grant yields from constructing buildings? int CvBuildingEntry::GetYieldFromInternal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromInternal[i]; } /// Array of yield changes @@ -3607,8 +3607,8 @@ int* CvBuildingEntry::GetYieldFromInternalArray() const /// Does this Policy grant yields from constructing buildings? int CvBuildingEntry::GetYieldFromProcessModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromProcessModifier[i]; } /// Array of yield changes @@ -3620,8 +3620,8 @@ int* CvBuildingEntry::GetYieldFromProcessModifierArray() const /// Array of yield changes int CvBuildingEntry::GetThemingYieldBonus(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piThemingYieldBonus ? m_piThemingYieldBonus[i] : -1; } /// Array of yield changes @@ -3633,8 +3633,8 @@ int* CvBuildingEntry::GetThemingYieldBonusArray() const /// Array of yield changes int CvBuildingEntry::GetYieldFromSpyAttack(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpyAttack ? m_piYieldFromSpyAttack[i] : -1; } /// Array of yield changes @@ -3646,8 +3646,8 @@ int* CvBuildingEntry::GetYieldFromSpyAttackArray() const /// Array of yield changes int CvBuildingEntry::GetYieldFromSpyDefense(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpyDefense ? m_piYieldFromSpyDefense[i] : -1; } /// Array of yield changes @@ -3659,8 +3659,8 @@ int* CvBuildingEntry::GetYieldFromSpyDefenseArray() const /// Array of yield changes int CvBuildingEntry::GetYieldFromSpyIdentify(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpyIdentify ? m_piYieldFromSpyIdentify[i] : -1; } /// Array of yield changes @@ -3672,8 +3672,8 @@ int* CvBuildingEntry::GetYieldFromSpyIdentifyArray() const /// Array of yield changes int CvBuildingEntry::GetYieldFromSpyDefenseOrID(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpyDefenseOrID ? m_piYieldFromSpyDefenseOrID[i] : -1; } /// Array of yield changes @@ -3685,8 +3685,8 @@ int* CvBuildingEntry::GetYieldFromSpyDefenseOrIDArray() const /// Array of yield changes int CvBuildingEntry::GetYieldFromSpyRigElection(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromSpyRigElection ? m_piYieldFromSpyRigElection[i] : -1; } /// Array of yield changes @@ -3700,8 +3700,8 @@ int* CvBuildingEntry::GetYieldFromSpyRigElectionArray() const /// Change to yield by type int CvBuildingEntry::GetYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } @@ -3714,8 +3714,8 @@ int* CvBuildingEntry::GetYieldChangeArray() const /// Change to yield by type int CvBuildingEntry::GetYieldChangePerPop(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangePerPop ? m_piYieldChangePerPop[i] : -1; } @@ -3729,8 +3729,8 @@ int* CvBuildingEntry::GetYieldChangePerPopArray() const /// Change to yield by type int CvBuildingEntry::GetYieldChangePerPopInEmpire(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); std::map::const_iterator it = m_piYieldChangePerPopInEmpire.find(i); if (it != m_piYieldChangePerPopInEmpire.end()) // find returns the iterator to map::end if the key i is not present in the map @@ -3745,8 +3745,8 @@ int CvBuildingEntry::GetYieldChangePerPopInEmpire(int i) const /// Change to yield by type int CvBuildingEntry::GetYieldChangePerReligion(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangePerReligion ? m_piYieldChangePerReligion[i] : -1; } @@ -3769,8 +3769,8 @@ set> CvBuildingEntry::GetResourceClaim() const /// Modifier to yield by type int CvBuildingEntry::GetYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifier ? m_piYieldModifier[i] : -1; } @@ -3783,8 +3783,8 @@ int* CvBuildingEntry::GetYieldModifierArray() const /// Modifier to yield by type in area int CvBuildingEntry::GetAreaYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piAreaYieldModifier ? m_piAreaYieldModifier[i] : -1; } @@ -3797,8 +3797,8 @@ int* CvBuildingEntry::GetAreaYieldModifierArray() const /// Global modifier to yield by type int CvBuildingEntry::GetGlobalYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGlobalYieldModifier ? m_piGlobalYieldModifier[i] : -1; } @@ -3811,8 +3811,8 @@ int* CvBuildingEntry::GetGlobalYieldModifierArray() const /// Change to yield based on earning a tech int CvBuildingEntry::GetTechEnhancedYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piTechEnhancedYieldChange ? m_piTechEnhancedYieldChange[i] : -1; } @@ -3825,8 +3825,8 @@ int* CvBuildingEntry::GetTechEnhancedYieldChangeArray() const /// Sea plot yield changes by type int CvBuildingEntry::GetSeaPlotYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piSeaPlotYieldChange ? m_piSeaPlotYieldChange[i] : -1; } @@ -3839,8 +3839,8 @@ int* CvBuildingEntry::GetSeaPlotYieldChangeArray() const /// River plot yield changes by type int CvBuildingEntry::GetRiverPlotYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piRiverPlotYieldChange ? m_piRiverPlotYieldChange[i] : -1; } @@ -3853,8 +3853,8 @@ int* CvBuildingEntry::GetRiverPlotYieldChangeArray() const /// Lake plot yield changes by type int CvBuildingEntry::GetLakePlotYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLakePlotYieldChange ? m_piLakePlotYieldChange[i] : -1; } @@ -3867,8 +3867,8 @@ int* CvBuildingEntry::GetLakePlotYieldChangeArray() const /// Global lake plot yield changes by type int CvBuildingEntry::GetLakePlotYieldChangeGlobal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLakePlotYieldChangeGlobal ? m_piLakePlotYieldChangeGlobal[i] : -1; } @@ -3881,8 +3881,8 @@ int* CvBuildingEntry::GetLakePlotYieldChangeGlobalArray() const /// Sea resource yield changes by type int CvBuildingEntry::GetSeaResourceYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piSeaResourceYieldChange ? m_piSeaResourceYieldChange[i] : -1; } @@ -3895,56 +3895,56 @@ int* CvBuildingEntry::GetSeaResourceYieldChangeArray() const /// Free combat experience by unit combat type int CvBuildingEntry::GetUnitCombatFreeExperience(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piUnitCombatFreeExperience ? m_piUnitCombatFreeExperience[i] : -1; } /// Extra Production towards a unit combat type in this city int CvBuildingEntry::GetUnitCombatProductionModifier(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piUnitCombatProductionModifiers ? m_piUnitCombatProductionModifiers[i] : -1; } /// Extra Production towards a unit combat type in all cities int CvBuildingEntry::GetUnitCombatProductionModifierGlobal(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piUnitCombatProductionModifiersGlobal ? m_piUnitCombatProductionModifiersGlobal[i] : -1; } /// Free experience gained for units in this domain int CvBuildingEntry::GetDomainFreeExperience(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piDomainFreeExperience ? m_piDomainFreeExperience[i] : -1; } /// Free experience gained for units in this domain for each Great Work in this building int CvBuildingEntry::GetDomainFreeExperiencePerGreatWork(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piDomainFreeExperiencePerGreatWork ? m_piDomainFreeExperiencePerGreatWork[i] : -1; } #if defined(MOD_BALANCE_CORE) /// Free experience gained for units in this domain for each Great Work in this building int CvBuildingEntry::GetDomainFreeExperiencePerGreatWorkGlobal(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piDomainFreeExperiencePerGreatWorkGlobal ? m_piDomainFreeExperiencePerGreatWorkGlobal[i] : -1; } /// Free experience gained for units in this domain (global) int CvBuildingEntry::GetDomainFreeExperienceGlobal(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); std::map::const_iterator it = m_piDomainFreeExperienceGlobal.find(i); if (it != m_piDomainFreeExperienceGlobal.end()) // find returns the iterator to map::end if the key i is not present in the map @@ -3959,80 +3959,80 @@ int CvBuildingEntry::GetDomainFreeExperienceGlobal(int i) const /// Production modifier in this domain int CvBuildingEntry::GetDomainProductionModifier(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piDomainProductionModifier ? m_piDomainProductionModifier[i] : -1; } /// BuildingClasses that may no longer be constructed after this Building is built in a City int CvBuildingEntry::GetLockedBuildingClasses(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLockedBuildingClasses ? m_piLockedBuildingClasses[i] : -1; } /// Prerequisite techs with AND int CvBuildingEntry::GetPrereqAndTechs(int i) const { - CvAssertMsg(i < /*3*/ GD_INT_GET(NUM_BUILDING_AND_TECH_PREREQS), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < /*3*/ GD_INT_GET(NUM_BUILDING_AND_TECH_PREREQS), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPrereqAndTechs ? m_piPrereqAndTechs[i] : -1; } /// Resources consumed to construct int CvBuildingEntry::GetResourceQuantityRequirement(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityRequirements ? m_piResourceQuantityRequirements[i] : -1; } /// Resources provided once constructed int CvBuildingEntry::GetResourceQuantity(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantity ? m_piResourceQuantity[i] : -1; } /// Boost in Culture for each of these Resources int CvBuildingEntry::GetResourceCultureChange(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceCultureChanges ? m_piResourceCultureChanges[i] : -1; } /// Boost in Faith for each of these Resources int CvBuildingEntry::GetResourceFaithChange(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceFaithChanges ? m_piResourceFaithChanges[i] : -1; } /// Boost in production for leader with this trait int CvBuildingEntry::GetProductionTraits(int i) const { - CvAssertMsg(i < GC.getNumTraitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTraitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piProductionTraits ? m_piProductionTraits[i] : 0; } /// Number of prerequisite buildings of a particular class int CvBuildingEntry::GetPrereqNumOfBuildingClass(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPrereqNumOfBuildingClass ? m_piPrereqNumOfBuildingClass[i] : -1; } /// Find value of flavors associated with this building int CvBuildingEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : 0; } @@ -4043,7 +4043,7 @@ uint CvBuildingEntry::GetLocalResourceAndSize() const } int CvBuildingEntry::GetLocalResourceAnd(uint ui) const { - CvAssertMsg(ui < m_viLocalResourceAnds.size(), "Index out of bounds"); + ASSERT(ui < m_viLocalResourceAnds.size(), "Index out of bounds"); return m_viLocalResourceAnds[ui]; } @@ -4054,7 +4054,7 @@ uint CvBuildingEntry::GetLocalResourceOrSize() const } int CvBuildingEntry::GetLocalResourceOr(uint ui) const { - CvAssertMsg(ui < m_viLocalResourceOrs.size(), "Index out of bounds"); + ASSERT(ui < m_viLocalResourceOrs.size(), "Index out of bounds"); return m_viLocalResourceOrs[ui]; } @@ -4062,15 +4062,15 @@ int CvBuildingEntry::GetLocalResourceOr(uint ui) const /// Prerequisite resources with AND int CvBuildingEntry::GetFeatureAnd(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLocalFeatureAnds ? m_piLocalFeatureAnds[i] : -1; } /// Prerequisite resources with AND int CvBuildingEntry::GetFeatureOr(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLocalFeatureOrs ? m_piLocalFeatureOrs[i] : -1; } /// Prerequisite resources with AND @@ -4080,7 +4080,7 @@ uint CvBuildingEntry::GetResourceMonopolyAndSize() const } int CvBuildingEntry::GetResourceMonopolyAnd(uint ui) const { - CvAssertMsg(ui < m_viResourceMonopolyAnds.size(), "Index out of bounds"); + ASSERT(ui < m_viResourceMonopolyAnds.size(), "Index out of bounds"); return m_viResourceMonopolyAnds[ui]; } @@ -4091,7 +4091,7 @@ uint CvBuildingEntry::GetResourceMonopolyOrSize() const } int CvBuildingEntry::GetResourceMonopolyOr(uint ui) const { - CvAssertMsg(ui < m_viResourceMonopolyOrs.size(), "Index out of bounds"); + ASSERT(ui < m_viResourceMonopolyOrs.size(), "Index out of bounds"); return m_viResourceMonopolyOrs[ui]; } //Coroporation Stuff @@ -4102,37 +4102,37 @@ int CvBuildingEntry::GetGPRateModifierPerXFranchises() const /// Resources provided once constructed int CvBuildingEntry::GetResourceQuantityPerXFranchises(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityPerXFranchises ? m_piResourceQuantityPerXFranchises[i] : -1; } int CvBuildingEntry::GetYieldPerFranchise(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerFranchise ? m_piYieldPerFranchise[i] : -1; } #endif // Resource provided by Population int CvBuildingEntry::GetResourceQuantityFromPOP(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityFromPOP ? m_piResourceQuantityFromPOP[i] : -1; } /// Modifier to Hurry cost int CvBuildingEntry::GetHurryModifier(int i) const { - CvAssertMsg(i < GC.getNumHurryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumHurryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiHurryModifier ? m_paiHurryModifier[i] : -1; } #if defined(MOD_BALANCE_CORE) /// Local Modifier to Hurry cost int CvBuildingEntry::GetHurryModifierLocal(int i) const { - CvAssertMsg(i < GC.getNumHurryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumHurryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiHurryModifierLocal ? m_paiHurryModifierLocal[i] : -1; } #endif @@ -4140,37 +4140,37 @@ int CvBuildingEntry::GetHurryModifierLocal(int i) const /// Can it only built if there is a building of this class in the city? bool CvBuildingEntry::IsBuildingClassNeededInCity(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildingClassNeededInCity ? m_pbBuildingClassNeededInCity[i] : false; } #if defined(MOD_BALANCE_CORE) /// Can it only built if there is a building of this class in any owned city? bool CvBuildingEntry::IsBuildingClassNeededAnywhere(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildingClassNeededAnywhere ? m_pbBuildingClassNeededAnywhere[i] : false; } /// Can it only built if there is NOT a building of this class in any owned city? bool CvBuildingEntry::IsBuildingClassNeededNowhere(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildingClassNeededNowhere ? m_pbBuildingClassNeededNowhere[i] : false; } // Free units which appear near the capital, can be any UnitType of other civs or not int CvBuildingEntry::GetNumFreeSpecialUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumSpecFreeUnits ? m_piNumSpecFreeUnits[i] : -1; } /// Building grants resource plots when built std::map CvBuildingEntry::GetResourcePlotsToPlace(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); std::map>::const_iterator it = m_ppiResourcePlotsToPlace.find(i); if (it != m_ppiResourcePlotsToPlace.end()) // find returns the iterator to map::end if the key bInternationalOnly is not present @@ -4189,46 +4189,46 @@ bool CvBuildingEntry::IsResourcePlotsToPlace() const } int CvBuildingEntry::GetYieldPerFriend(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerFriend ? m_piYieldPerFriend[i] : -1; } int CvBuildingEntry::GetYieldPerAlly(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerAlly ? m_piYieldPerAlly[i] : -1; } int CvBuildingEntry::GetYieldChangeWorldWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeWorldWonder ? m_piYieldChangeWorldWonder[i] : 0; } int CvBuildingEntry::GetYieldChangeWorldWonderGlobal(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeWorldWonderGlobal ? m_piYieldChangeWorldWonderGlobal[i] : 0; } #endif /// Free units which appear near the capital int CvBuildingEntry::GetNumFreeUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeUnits ? m_piNumFreeUnits[i] : -1; } /// Does this building generate yields from other yields? int CvBuildingEntry::GetYieldFromYield(int i, int j) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); if (m_paYieldFromYield == NULL || m_paYieldFromYield[0].GetValue() == 0) { @@ -4256,10 +4256,10 @@ int CvBuildingEntry::GetYieldFromYield(int i, int j) const /// Does this building generate yields from other yields globally? int CvBuildingEntry::GetYieldFromYieldGlobal(int i, int j) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); if (m_paYieldFromYieldGlobal == NULL || m_paYieldFromYieldGlobal[0].GetValue() == 0) { @@ -4287,18 +4287,18 @@ int CvBuildingEntry::GetYieldFromYieldGlobal(int i, int j) const /// Change to Resource yield by type int CvBuildingEntry::GetResourceYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiResourceYieldChange ? m_ppaiResourceYieldChange[i][j] : -1; } /// Array of changes to Resource yield int* CvBuildingEntry::GetResourceYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiResourceYieldChange[i]; } @@ -4306,10 +4306,10 @@ int* CvBuildingEntry::GetResourceYieldChangeArray(int i) const /// Change to Resource yield by type int CvBuildingEntry::GetResourceYieldChangeGlobal(int iResource, int iYieldType) const { - CvAssertMsg(iResource < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(iResource > -1, "Index out of bounds"); - CvAssertMsg(iYieldType < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(iYieldType > -1, "Index out of bounds"); + ASSERT(iResource < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(iResource > -1, "Index out of bounds"); + ASSERT(iYieldType < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(iYieldType > -1, "Index out of bounds"); std::map>::const_iterator itResource = m_ppiResourceYieldChangeGlobal.find(iResource); if (itResource != m_ppiResourceYieldChangeGlobal.end()) // find returns the iterator to map::end if the key iResource is not present in the map { @@ -4327,18 +4327,18 @@ int CvBuildingEntry::GetResourceYieldChangeGlobal(int iResource, int iYieldType) /// Change to Feature yield by type int CvBuildingEntry::GetFeatureYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiFeatureYieldChange ? m_ppaiFeatureYieldChange[i][j] : -1; } /// Array of changes to Feature yield int* CvBuildingEntry::GetFeatureYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiFeatureYieldChange[i]; } @@ -4346,51 +4346,51 @@ int* CvBuildingEntry::GetFeatureYieldChangeArray(int i) const /// Change to Improvement yield by type int CvBuildingEntry::GetImprovementYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiImprovementYieldChange ? m_ppaiImprovementYieldChange[i][j] : -1; } /// Array of changes to Improvement yield int* CvBuildingEntry::GetImprovementYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiImprovementYieldChange[i]; } /// Change to Improvement yield by type int CvBuildingEntry::GetImprovementYieldChangeGlobal(int i, int j) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiImprovementYieldChangeGlobal ? m_ppaiImprovementYieldChangeGlobal[i][j] : -1; } /// Array of changes to Improvement yield int* CvBuildingEntry::GetImprovementYieldChangeGlobalArray(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiImprovementYieldChangeGlobal[i]; } /// Change to specialist yield by type int CvBuildingEntry::GetSpecialistYieldChangeLocal(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChangeLocal ? m_ppaiSpecialistYieldChangeLocal[i][j] : -1; } /// Array of changes to specialist yield int* CvBuildingEntry::GetSpecialistYieldChangeLocalArray(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChangeLocal[i]; } #endif @@ -4398,165 +4398,165 @@ int* CvBuildingEntry::GetSpecialistYieldChangeLocalArray(int i) const /// Change to specialist yield by type int CvBuildingEntry::GetSpecialistYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChange ? m_ppaiSpecialistYieldChange[i][j] : -1; } /// Array of changes to specialist yield int* CvBuildingEntry::GetSpecialistYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChange[i]; } /// Modifier to resource yield int CvBuildingEntry::GetResourceYieldModifier(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiResourceYieldModifier ? m_ppaiResourceYieldModifier[i][j] : -1; } /// Array of modifiers to resource yield int* CvBuildingEntry::GetResourceYieldModifierArray(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiResourceYieldModifier[i]; } /// Change to Terrain yield by type int CvBuildingEntry::GetTerrainYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiTerrainYieldChange ? m_ppaiTerrainYieldChange[i][j] : -1; } /// Array of changes to Feature yield int* CvBuildingEntry::GetTerrainYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiTerrainYieldChange[i]; } /// Change to Terrain yield by type int CvBuildingEntry::GetYieldPerXTerrain(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiYieldPerXTerrain ? m_ppaiYieldPerXTerrain[i][j] : -1; } /// Array of changes to Feature yield int* CvBuildingEntry::GetYieldPerXTerrainArray(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiYieldPerXTerrain[i]; } int CvBuildingEntry::GetYieldPerXFeature(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiYieldPerXFeature ? m_ppaiYieldPerXFeature[i][j] : -1; } /// Array of changes to Feature yield int* CvBuildingEntry::GetYieldPerXFeatureArray(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiYieldPerXFeature[i]; } /// Change to Plot yield by type int CvBuildingEntry::GetPlotYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumPlotInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPlotInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiPlotYieldChange ? m_ppaiPlotYieldChange[i][j] : -1; } /// Array of changes to Plot yield int* CvBuildingEntry::GetPlotYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumPlotInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPlotInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiPlotYieldChange[i]; } /// Yield change for a specific BuildingClass by yield type int CvBuildingEntry::GetBuildingClassYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldChanges[i][j]; } /// Yield change for a specific BuildingClass by yield type int CvBuildingEntry::GetBuildingClassYieldModifier(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldModifiers[i][j]; } #if defined(MOD_BALANCE_CORE) /// Yield change for a specific BuildingClass by yield type int CvBuildingEntry::GetBuildingClassLocalYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassLocalYieldChanges[i][j]; } /// Amount of extra Happiness per turn a BuildingClass provides int CvBuildingEntry::GetBuildingClassLocalHappiness(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassLocalHappiness ? m_paiBuildingClassLocalHappiness[i] : -1; } int CvBuildingEntry::GetSpecificGreatPersonRateModifier(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiSpecificGreatPersonRateModifier ? m_paiSpecificGreatPersonRateModifier[i] : -1; } int CvBuildingEntry::GetResourceHappiness(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiResourceHappinessChange ? m_paiResourceHappinessChange[i] : -1; } #endif /// Amount of extra Happiness per turn a BuildingClass provides int CvBuildingEntry::GetBuildingClassHappiness(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassHappiness ? m_paiBuildingClassHappiness[i] : -1; } #if defined(MOD_BALANCE_CORE) @@ -4669,8 +4669,8 @@ int CvBuildingEntry::GetGlobalFollowerPopRequired() const /// Instant yield int CvBuildingEntry::GetInstantYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piInstantYield ? m_piInstantYield[i] : -1; } @@ -4683,8 +4683,8 @@ int* CvBuildingEntry::GetInstantYieldArray() const CvThemingBonusInfo *CvBuildingEntry::GetThemingBonusInfo(int i) const { - CvAssertMsg(i < MAX_THEMING_BONUSES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < MAX_THEMING_BONUSES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paThemingBonusInfo[0].m_iBonus == 0) { @@ -4808,31 +4808,31 @@ void CvCityBuildings::Init(CvBuildingXMLEntries* pPossibleBuildings, CvCity* pCi int iNumBuildings = pPossibleBuildings->GetNumBuildings(); - CvAssertMsg((0 < iNumBuildings), "m_pBuildings->GetNumBuildings() is not greater than zero but an array is being allocated in CvCityBuildings::Init"); + ASSERT((0 < iNumBuildings), "m_pBuildings->GetNumBuildings() is not greater than zero but an array is being allocated in CvCityBuildings::Init"); - CvAssertMsg(m_paiBuildingProduction==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingProduction"); + ASSERT(m_paiBuildingProduction==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingProduction"); m_paiBuildingProduction = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiBuildingProductionTime==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingProductionTime"); + ASSERT(m_paiBuildingProductionTime==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingProductionTime"); m_paiBuildingProductionTime = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiBuildingOriginalOwner==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingOriginalOwner"); + ASSERT(m_paiBuildingOriginalOwner==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingOriginalOwner"); m_paiBuildingOriginalOwner = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiBuildingOriginalTime==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingOriginalTime"); + ASSERT(m_paiBuildingOriginalTime==NULL, "about to leak memory, CvCityBuildings::m_paiBuildingOriginalTime"); m_paiBuildingOriginalTime = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiNumRealBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiNumRealBuilding"); + ASSERT(m_paiNumRealBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiNumRealBuilding"); m_paiNumRealBuilding = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiNumFreeBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiNumFreeBuilding"); + ASSERT(m_paiNumFreeBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiNumFreeBuilding"); m_paiNumFreeBuilding = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); #if defined(MOD_BALANCE_CORE) - CvAssertMsg(m_paiFirstTimeBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiFirstTimeBuilding"); + ASSERT(m_paiFirstTimeBuilding==NULL, "about to leak memory, CvCityBuildings::m_paiFirstTimeBuilding"); m_paiFirstTimeBuilding = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiThemingBonusIndex == NULL, "about to leak memory, CvCityBuildings::m_paiThemingBonusIndex"); + ASSERT(m_paiThemingBonusIndex == NULL, "about to leak memory, CvCityBuildings::m_paiThemingBonusIndex"); m_paiThemingBonusIndex = FNEW(int[iNumBuildings], c_eCiv5GameplayDLL, 0); #endif @@ -4953,7 +4953,7 @@ void CvCityBuildings::Serialize(CityBuildings& cityBuildings, Visitor& visitor) /// Serialization read void CvCityBuildings::Read(FDataStream& kStream) { - CvAssertMsg(GC.getNumBuildingInfos() > 0, "Number of buildings to serialize is expected to greater than 0"); + ASSERT(GC.getNumBuildingInfos() > 0, "Number of buildings to serialize is expected to greater than 0"); CvStreamLoadVisitor serialVisitor(kStream); Serialize(*this, serialVisitor); @@ -4968,7 +4968,7 @@ void CvCityBuildings::Read(FDataStream& kStream) /// Serialization write void CvCityBuildings::Write(FDataStream& kStream) const { - CvAssertMsg(GC.getNumBuildingInfos() > 0, "Number of buildings to serialize is expected to greater than 0"); + ASSERT(GC.getNumBuildingInfos() > 0, "Number of buildings to serialize is expected to greater than 0"); CvStreamSaveVisitor serialVisitor(kStream); Serialize(*this, serialVisitor); @@ -5001,7 +5001,7 @@ int CvCityBuildings::GetNumBuildings() const void CvCityBuildings::ChangeNumBuildings(int iChange) { m_iNumBuildings = (m_iNumBuildings + iChange); - CvAssert(GetNumBuildings() >= 0); + ASSERT(GetNumBuildings() >= 0); // GET_PLAYER(m_pCity->getOwner()).updateNumResourceUsed(); } @@ -5009,7 +5009,7 @@ void CvCityBuildings::ChangeNumBuildings(int iChange) /// Accessor: How many of these buildings in the city? int CvCityBuildings::GetNumBuilding(BuildingTypes eIndex) const { - CvAssertMsg(eIndex != NO_BUILDING, "BuildingType eIndex is expected to not be NO_BUILDING"); + ASSERT(eIndex != NO_BUILDING, "BuildingType eIndex is expected to not be NO_BUILDING"); if (/*1*/ GD_INT_GET(CITY_MAX_NUM_BUILDINGS) <= 1) { @@ -5024,7 +5024,7 @@ int CvCityBuildings::GetNumBuilding(BuildingTypes eIndex) const /// Accessor: How many of these building classes in the city? int CvCityBuildings::GetNumBuildingClass(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); + ASSERT(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); int iValue = 0; for (std::vector::const_iterator iI=m_buildingsThatExistAtLeastOnce.begin(); iI!=m_buildingsThatExistAtLeastOnce.end(); ++iI) @@ -5042,7 +5042,7 @@ int CvCityBuildings::GetNumBuildingClass(BuildingClassTypes eIndex) const /// Accessor: Is there at least one building of the class in the city? Potentially faster function than the above. bool CvCityBuildings::HasBuildingClass(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); + ASSERT(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); for (std::vector::const_iterator iI = m_buildingsThatExistAtLeastOnce.begin(); iI != m_buildingsThatExistAtLeastOnce.end(); ++iI) { @@ -5058,7 +5058,7 @@ bool CvCityBuildings::HasBuildingClass(BuildingClassTypes eIndex) const /// Accessor: What BuildingType do we have in our city for the specified class? This function assumes at most 1 building type will exist in a city for each class. BuildingTypes CvCityBuildings::GetBuildingTypeFromClass(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); + ASSERT(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); CacheBuildingTypeByClass(); std::map::iterator it = m_buildingTypeByClass.find(eIndex); @@ -5073,7 +5073,7 @@ BuildingTypes CvCityBuildings::GetBuildingTypeFromClass(BuildingClassTypes eInde /// Accessor: Removes all real buildings which belong to the specified building class. void CvCityBuildings::RemoveAllRealBuildingsOfClass(BuildingClassTypes eIndex) { - CvAssertMsg(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); + ASSERT(eIndex != NO_BUILDINGCLASS, "BuildingClassTypes eIndex is expected to not be NO_BUILDINGCLASS"); // Shortcut if (!MOD_BUILDINGS_THOROUGH_PREREQUISITES) @@ -5102,7 +5102,7 @@ void CvCityBuildings::RemoveAllRealBuildingsOfClass(BuildingClassTypes eIndex) /// Accessor: How many of these buildings are not obsolete? int CvCityBuildings::GetNumActiveBuilding(BuildingTypes eIndex) const { - CvAssertMsg(eIndex != NO_BUILDING, "BuildingType eIndex is expected to not be NO_BUILDING"); + ASSERT(eIndex != NO_BUILDING, "BuildingType eIndex is expected to not be NO_BUILDING"); if(GET_TEAM(m_pCity->getTeam()).isObsoleteBuilding(eIndex)) { @@ -5212,8 +5212,8 @@ bool CvCityBuildings::IsBuildingSellable(const CvBuildingEntry& kBuilding) const /// Sell eIndex~! void CvCityBuildings::DoSellBuilding(BuildingTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); CvBuildingEntry* pkBuildingEntry = GC.getBuildingInfo(eIndex); if(!pkBuildingEntry) @@ -5238,8 +5238,8 @@ void CvCityBuildings::DoSellBuilding(BuildingTypes eIndex) /// How much of a refund will the player get from selling eIndex? int CvCityBuildings::GetSellBuildingRefund(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); int iRefund = GET_PLAYER(m_pCity->getOwner()).getProductionNeeded(eIndex); iRefund /= /*4*/ GD_INT_GET(BUILDING_SALE_DIVISOR); @@ -5294,16 +5294,16 @@ int CvCityBuildings::GetTotalBaseBuildingMaintenance() const /// Accessor: How far is construction of this building? int CvCityBuildings::GetBuildingProduction(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiBuildingProduction[eIndex] / 100; } /// Accessor: How far is construction of this building? (in hundredths) int CvCityBuildings::GetBuildingProductionTimes100(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiBuildingProduction[eIndex]; } @@ -5316,8 +5316,8 @@ void CvCityBuildings::SetBuildingProduction(BuildingTypes eIndex, int iNewValue) /// Accessor: Set how much construction is complete for this building (in hundredths) void CvCityBuildings::SetBuildingProductionTimes100(BuildingTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos())"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos())"); if(GetBuildingProductionTimes100(eIndex) != iNewValue) { @@ -5327,7 +5327,7 @@ void CvCityBuildings::SetBuildingProductionTimes100(BuildingTypes eIndex, int iN } m_paiBuildingProduction[eIndex] = max(0,iNewValue); - CvAssert(GetBuildingProductionTimes100(eIndex) >= 0); + ASSERT(GetBuildingProductionTimes100(eIndex) >= 0); if((m_pCity->getOwner() == GC.getGame().getActivePlayer()) && m_pCity->isCitySelected()) { @@ -5355,18 +5355,18 @@ void CvCityBuildings::ChangeBuildingProductionTimes100(BuildingTypes eIndex, int /// Accessor: How many turns has this building been under production? int CvCityBuildings::GetBuildingProductionTime(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiBuildingProductionTime[eIndex]; } /// Accessor: Set number of turns this building been under production void CvCityBuildings::SetBuildingProductionTime(BuildingTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); m_paiBuildingProductionTime[eIndex] = iNewValue; - CvAssert(GetBuildingProductionTime(eIndex) >= 0); + ASSERT(GetBuildingProductionTime(eIndex) >= 0); } /// Accessor: Change number of turns this building been under production @@ -5378,40 +5378,40 @@ void CvCityBuildings::ChangeBuildingProductionTime(BuildingTypes eIndex, int iCh /// Accessor: Who owned the city when this building was built? int CvCityBuildings::GetBuildingOriginalOwner(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiBuildingOriginalOwner[eIndex]; } /// Accessor: Set who owned the city when this building was built void CvCityBuildings::SetBuildingOriginalOwner(BuildingTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); m_paiBuildingOriginalOwner[eIndex] = iNewValue; } /// Accessor: What year was this building built? int CvCityBuildings::GetBuildingOriginalTime(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiBuildingOriginalTime[eIndex]; } /// Accessor: Set year building was built void CvCityBuildings::SetBuildingOriginalTime(BuildingTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); m_paiBuildingOriginalTime[eIndex] = iNewValue; } /// Accessor: How many of these buildings have been constructed in the city? int CvCityBuildings::GetNumRealBuilding(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiNumRealBuilding[eIndex]; } @@ -5426,8 +5426,8 @@ void CvCityBuildings::SetNumRealBuildingTimed(BuildingTypes eIndex, int iNewValu { CvPlayer& kPlayer = GET_PLAYER(m_pCity->getOwner()); - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); int iChangeNumRealBuilding = iNewValue - GetNumRealBuilding(eIndex); if (iChangeNumRealBuilding == 0) @@ -5682,16 +5682,16 @@ void CvCityBuildings::SetNumRealBuildingTimed(BuildingTypes eIndex, int iNewValu /// Accessor: Get number of free buildings of this type in city int CvCityBuildings::GetNumFreeBuilding(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiNumFreeBuilding[eIndex]; } /// Accessor: Set number of free buildings of this type in city void CvCityBuildings::SetNumFreeBuilding(BuildingTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); if(GetNumFreeBuilding(eIndex) != iNewValue) { @@ -5737,14 +5737,14 @@ void CvCityBuildings::SetNumFreeBuilding(BuildingTypes eIndex, int iNewValue) #if defined(MOD_BALANCE_CORE) int CvCityBuildings::IsFirstTimeBuilding(BuildingTypes eBuilding) { - CvAssertMsg(eBuilding >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eBuilding >= 0, "eIndex expected to be >= 0"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); return m_paiFirstTimeBuilding[eBuilding]; } void CvCityBuildings::SetFirstTimeBuilding(BuildingTypes eBuilding, int iValue) { - CvAssertMsg(eBuilding >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eBuilding >= 0, "eIndex expected to be >= 0"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); if(IsFirstTimeBuilding(eBuilding) != iValue) { m_paiFirstTimeBuilding[eBuilding] = iValue; @@ -6264,8 +6264,8 @@ int CvCityBuildings::GetThemingBonusIndex(BuildingTypes eBuilding) const void CvCityBuildings::SetThemingBonusIndex(BuildingTypes eBuilding, int iIndex) { - CvAssertMsg(eBuilding >= 0, "eBuilding expected to be >= 0"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); + ASSERT(eBuilding >= 0, "eBuilding expected to be >= 0"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex expected to be < getNumBuildingInfos()"); m_paiThemingBonusIndex[eBuilding] = iIndex; } @@ -6281,7 +6281,7 @@ void CvCityBuildings::ChangeLandmarksTourismPercent(int iChange) if(iChange != 0) { m_iLandmarksTourismPercent = (m_iLandmarksTourismPercent + iChange); - CvAssert(m_iLandmarksTourismPercent >= 0); + ASSERT(m_iLandmarksTourismPercent >= 0); } } @@ -6297,7 +6297,7 @@ void CvCityBuildings::ChangeGreatWorksTourismModifier(int iChange) if(iChange != 0) { m_iGreatWorksTourismModifier = (m_iGreatWorksTourismModifier + iChange); - CvAssert(m_iGreatWorksTourismModifier >= 0); + ASSERT(m_iGreatWorksTourismModifier >= 0); } } @@ -6401,7 +6401,7 @@ int CvCityBuildings::GetBuildingProductionModifier() const void CvCityBuildings::ChangeBuildingProductionModifier(int iChange) { m_iBuildingProductionModifier += iChange; - CvAssert(GetBuildingProductionModifier() >= 0); + ASSERT(GetBuildingProductionModifier() >= 0); } /// Accessor: Get current defense boost from buildings @@ -6416,7 +6416,7 @@ void CvCityBuildings::ChangeBuildingDefense(int iChange) if(iChange != 0) { m_iBuildingDefense = (m_iBuildingDefense + iChange); - CvAssert(GetBuildingDefense() >= 0); + ASSERT(GetBuildingDefense() >= 0); m_pCity->plot()->plotAction(PUF_makeInfoBarDirty); } @@ -6434,7 +6434,7 @@ void CvCityBuildings::ChangeBuildingDefenseMod(int iChange) if(iChange != 0) { m_iBuildingDefenseMod = (m_iBuildingDefenseMod + iChange); - CvAssert(m_iBuildingDefenseMod >= 0); + ASSERT(m_iBuildingDefenseMod >= 0); m_pCity->plot()->plotAction(PUF_makeInfoBarDirty); } @@ -6766,7 +6766,7 @@ void BuildingArrayHelpers::Read(FDataStream& kStream, int* paiBuildingArray) CvString szError; szError.Format("LOAD ERROR: Building Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; // Skip it. } diff --git a/CvGameCoreDLL_Expansion2/CvBuildingProductionAI.cpp b/CvGameCoreDLL_Expansion2/CvBuildingProductionAI.cpp index ff42d6d1d0..58dae0dd1d 100644 --- a/CvGameCoreDLL_Expansion2/CvBuildingProductionAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvBuildingProductionAI.cpp @@ -35,7 +35,7 @@ CvBuildingProductionAI::~CvBuildingProductionAI(void) /// Clear out AI local variables void CvBuildingProductionAI::Reset() { - CvAssertMsg(m_pCityBuildings != NULL, "Building Production AI init failure: city buildings are NULL"); + ASSERT(m_pCityBuildings != NULL, "Building Production AI init failure: city buildings are NULL"); m_BuildingAIWeights.clear(); @@ -65,7 +65,7 @@ void CvBuildingProductionAI::Read(FDataStream& kStream) /// Serialization write void CvBuildingProductionAI::Write(FDataStream& kStream) const { - CvAssertMsg(m_pCityBuildings != NULL, "Building Production AI init failure: city buildings are NULL"); + ASSERT(m_pCityBuildings != NULL, "Building Production AI init failure: city buildings are NULL"); CvStreamSaveVisitor serialVisitor(kStream); Serialize(*this, serialVisitor); diff --git a/CvGameCoreDLL_Expansion2/CvCity.cpp b/CvGameCoreDLL_Expansion2/CvCity.cpp index 43fa6890be..e02370e1c3 100644 --- a/CvGameCoreDLL_Expansion2/CvCity.cpp +++ b/CvGameCoreDLL_Expansion2/CvCity.cpp @@ -1669,7 +1669,7 @@ void CvCity::reset(int iID, PlayerTypes eOwner, int iX, int iY, bool bConstructo if (!bConstructorCall) { int iNumResources = GC.getNumResourceInfos(); - CvAssertMsg((0 < iNumResources), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvCity::reset"); + ASSERT((0 < iNumResources), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvCity::reset"); m_paiNoResource.clear(); m_paiNoResource.resize(iNumResources); m_paiFreeResource.clear(); @@ -1713,7 +1713,7 @@ void CvCity::reset(int iID, PlayerTypes eOwner, int iX, int iY, bool bConstructo m_pCityBuildings->Init(GC.GetGameBuildings(), this); int iNumUnitInfos = GC.getNumUnitInfos(); - CvAssertMsg((0 < iNumUnitInfos), "GC.getNumUnitInfos() is not greater than zero but an array is being allocated in CvCity::reset"); + ASSERT((0 < iNumUnitInfos), "GC.getNumUnitInfos() is not greater than zero but an array is being allocated in CvCity::reset"); m_paiUnitProduction.clear(); m_paiUnitProduction.resize(iNumUnitInfos); m_paiUnitProductionTime.clear(); @@ -1725,7 +1725,7 @@ void CvCity::reset(int iID, PlayerTypes eOwner, int iX, int iY, bool bConstructo } int iNumUnitCombatClassInfos = GC.getNumUnitCombatClassInfos(); - CvAssertMsg((0 < iNumUnitCombatClassInfos), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvCity::reset"); + ASSERT((0 < iNumUnitCombatClassInfos), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvCity::reset"); m_paiUnitCombatFreeExperience.clear(); m_paiUnitCombatFreeExperience.resize(iNumUnitCombatClassInfos); m_paiUnitCombatProductionModifier.clear(); @@ -1740,7 +1740,7 @@ void CvCity::reset(int iID, PlayerTypes eOwner, int iX, int iY, bool bConstructo #if defined(MOD_BALANCE_CORE_POLICIES) int iNumBuildingClassInfos = GC.getNumBuildingClassInfos(); - CvAssertMsg((0 < iNumBuildingClassInfos), "GC.getNumBuildingClassInfos() is not greater than zero but an array is being allocated in CvCity::reset"); + ASSERT((0 < iNumBuildingClassInfos), "GC.getNumBuildingClassInfos() is not greater than zero but an array is being allocated in CvCity::reset"); m_paiBuildingClassCulture.clear(); m_paiBuildingClassCulture.resize(iNumBuildingClassInfos); for (iI = 0; iI < iNumBuildingClassInfos; iI++) @@ -1749,7 +1749,7 @@ void CvCity::reset(int iID, PlayerTypes eOwner, int iX, int iY, bool bConstructo } int iNumHurryInfos = GC.getNumHurryInfos(); - CvAssertMsg((0 < iNumHurryInfos), "GC.getNumHurryInfos() is not greater than zero but an array is being allocated in CvCity::reset"); + ASSERT((0 < iNumHurryInfos), "GC.getNumHurryInfos() is not greater than zero but an array is being allocated in CvCity::reset"); m_paiHurryModifier.clear(); m_paiHurryModifier.resize(iNumHurryInfos); for (iI = 0; iI < iNumHurryInfos; iI++) @@ -2069,7 +2069,7 @@ void CvCity::PreKill() // Killing a city while in combat is not something we really expect to happen. // It is *mostly* safe for it to happen, but combat systems must be able to gracefully handle the disapperance of a city. - CvAssertMsg_Debug(!isFighting(), "isFighting did not return false as expected"); + CvAssert_Debug(!isFighting(), "isFighting did not return false as expected"); clearCombat(); @@ -2120,7 +2120,7 @@ void CvCity::PreKill() GC.getGame().changeNumCities(-1); - CvAssertMsg(!isProduction(), "isProduction is expected to be false"); + ASSERT(!isProduction(), "isProduction is expected to be false"); eOwner = getOwner(); @@ -2616,7 +2616,7 @@ void CvCity::doTurn() if (pNotifications) { CvCity* pPlayerCapital = GET_PLAYER(m_eOwner).getCapitalCity(); - CvAssertMsg(pPlayerCapital, "No capital city?"); + ASSERT(pPlayerCapital, "No capital city?"); if (m_bRouteToCapitalConnectedLastTurn != m_bRouteToCapitalConnectedThisTurn && pPlayerCapital) { @@ -2661,8 +2661,8 @@ void CvCity::doTurn() { for (int iI = 0; iI < NUM_YIELD_TYPES; iI++) { - CvAssert(getBaseYieldRate((YieldTypes)iI) >= 0); - CvAssert(getYieldRate((YieldTypes)iI, false) >= 0); + ASSERT(getBaseYieldRate((YieldTypes)iI) >= 0); + ASSERT(getYieldRate((YieldTypes)iI, false) >= 0); int iCount = 0; for (int iJ = 0; iJ < GetNumWorkablePlots(); iJ++) @@ -2698,7 +2698,7 @@ void CvCity::doTurn() iCount += getPopulation() * /*1 in CP, 0 in VP*/ GD_INT_GET(SCIENCE_PER_POPULATION); } - CvAssert(iCount == getBaseYieldRate((YieldTypes)iI)); + ASSERT(iCount == getBaseYieldRate((YieldTypes)iI)); } } #endif @@ -2791,8 +2791,8 @@ void CvCity::UpdateCityYields(YieldTypes eYield) void CvCity::SetStaticYield(YieldTypes eYield, int iValue) { - CvAssertMsg(eYield >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eIndex expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); m_aiStaticCityYield[eYield] = iValue; } @@ -2858,8 +2858,8 @@ int CvCity::GetLongestPotentialTradeRoute(DomainTypes eDomain) const void CvCity::SetLongestPotentialTradeRoute(int iValue, DomainTypes eDomain) { VALIDATE_OBJECT - CvAssertMsg(eDomain >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eDomain >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); GC.getGame().GetGameTrade()->SetLongestPotentialTradeRoute(iValue, GetID(), eDomain); } @@ -3025,15 +3025,15 @@ int CvCity::GetUnhappinessFromEmpire() const int CvCity::GetEventChoiceDuration(CityEventChoiceTypes eEventChoice) const { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventChoiceDuration[eEventChoice]; } void CvCity::ChangeEventChoiceDuration(CityEventChoiceTypes eEventChoice, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if (iValue != 0) { m_aiEventChoiceDuration[eEventChoice] = m_aiEventChoiceDuration[eEventChoice] + iValue; @@ -3042,22 +3042,22 @@ void CvCity::ChangeEventChoiceDuration(CityEventChoiceTypes eEventChoice, int iV void CvCity::SetEventChoiceDuration(CityEventChoiceTypes eEventChoice, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_aiEventChoiceDuration[eEventChoice] = iValue; } int CvCity::GetEventIncrement(CityEventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventIncrement[eEvent]; } void CvCity::IncrementEvent(CityEventTypes eEvent, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if (iValue != 0) { m_aiEventIncrement[eEvent] = m_aiEventIncrement[eEvent] + iValue; @@ -3079,8 +3079,8 @@ void CvCity::ChangeCityEventCooldown(int iValue) void CvCity::ChangeEventCityYield(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); if (iValue != 0) { m_aiEventCityYield[eYield] = m_aiEventCityYield[eYield] + iValue; @@ -3090,16 +3090,16 @@ void CvCity::ChangeEventCityYield(YieldTypes eYield, int iValue) int CvCity::GetEventCityYield(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_aiEventCityYield[eYield]; } void CvCity::ChangeEventCityYieldModifier(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); if (iValue != 0) { m_aiEventCityYieldModifier[eYield] = m_aiEventCityYieldModifier[eYield] + iValue; @@ -3109,8 +3109,8 @@ void CvCity::ChangeEventCityYieldModifier(YieldTypes eYield, int iValue) int CvCity::GetEventCityYieldModifier(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_aiEventCityYieldModifier[eYield]; } @@ -3118,19 +3118,19 @@ int CvCity::GetEventCityYieldModifier(YieldTypes eYield) const // -------------------------------------------------------------------------------- int CvCity::GetEventBuildingClassCityYield(BuildingClassTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forBuilding, eIndex1); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventBuildingClassYield(BuildingClassTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forBuilding, eIndex1, iChange, true)) @@ -3139,19 +3139,19 @@ void CvCity::ChangeEventBuildingClassYield(BuildingClassTypes eIndex1, YieldType // -------------------------------------------------------------------------------- int CvCity::GetEventBuildingClassCityYieldModifier(BuildingClassTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forBuildingModifier, eIndex1); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventBuildingClassYieldModifier(BuildingClassTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumBuildingClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forBuildingModifier, eIndex1, iChange, true)) @@ -3161,19 +3161,19 @@ void CvCity::ChangeEventBuildingClassYieldModifier(BuildingClassTypes eIndex1, Y // -------------------------------------------------------------------------------- int CvCity::GetEventImprovementYield(ImprovementTypes eImprovement, YieldTypes eIndex2) const { - CvAssertMsg(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forImprovement, eImprovement); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventImprovementYield(ImprovementTypes eImprovement, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forImprovement, eImprovement, iChange, true)) @@ -3182,19 +3182,19 @@ void CvCity::ChangeEventImprovementYield(ImprovementTypes eImprovement, YieldTyp // -------------------------------------------------------------------------------- int CvCity::GetEventResourceYield(ResourceTypes eResource, YieldTypes eIndex2) const { - CvAssertMsg(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); + ASSERT(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forResource, eResource); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventResourceYield(ResourceTypes eResource, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); + ASSERT(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forResource, eResource, iChange, true)) @@ -3204,19 +3204,19 @@ void CvCity::ChangeEventResourceYield(ResourceTypes eResource, YieldTypes eIndex // -------------------------------------------------------------------------------- int CvCity::GetEventSpecialistYield(SpecialistTypes eSpecialist, YieldTypes eIndex2) const { - CvAssertMsg(eSpecialist >= 0, "eSpecialist is expected to be non-negative (invalid Index)"); - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "eSpecialist is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eSpecialist >= 0, "eSpecialist is expected to be non-negative (invalid Index)"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "eSpecialist is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forSpecialist, eSpecialist); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventSpecialistYield(SpecialistTypes eSpecialist, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eSpecialist >= 0, "eSpecialist is expected to be non-negative (invalid Index)"); - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "eSpecialist is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eSpecialist >= 0, "eSpecialist is expected to be non-negative (invalid Index)"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "eSpecialist is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forSpecialist, eSpecialist, iChange, true)) @@ -3226,19 +3226,19 @@ void CvCity::ChangeEventSpecialistYield(SpecialistTypes eSpecialist, YieldTypes // -------------------------------------------------------------------------------- int CvCity::GetEventTerrainYield(TerrainTypes eTerrain, YieldTypes eIndex2) const { - CvAssertMsg(eTerrain >= 0, "eImprovement is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eImprovement is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forTerrain, eTerrain); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventTerrainYield(TerrainTypes eTerrain, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forTerrain, eTerrain, iChange, true)) @@ -3247,19 +3247,19 @@ void CvCity::ChangeEventTerrainYield(TerrainTypes eTerrain, YieldTypes eIndex2, // -------------------------------------------------------------------------------- int CvCity::GetEventFeatureYield(FeatureTypes eFeature, YieldTypes eIndex2) const { - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_eventYields[eIndex2].forFeature, eFeature); } // -------------------------------------------------------------------------------- void CvCity::ChangeEventFeatureYield(FeatureTypes eFeature, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); SCityEventYields& y = m_eventYields[eIndex2]; if (ModifierUpdateInsertRemove(y.forFeature, eFeature, iChange, true)) @@ -7383,32 +7383,32 @@ void CvCity::DoEventChoice(CityEventChoiceTypes eEventChoice, CityEventTypes eCi void CvCity::SetEventActive(CityEventTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventActive[eEvent] = bValue; } bool CvCity::IsEventActive(CityEventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventActive[eEvent]; } void CvCity::SetEventChoiceActive(CityEventChoiceTypes eEventChoice, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEventChoice is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEventChoice is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEventChoice is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEventChoice is expected to be within maximum bounds (invalid Index)"); m_abEventChoiceActive[eEventChoice] = bValue; } bool CvCity::IsEventChoiceActive(CityEventChoiceTypes eEventChoice) const { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEventChoice is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEventChoice is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventChoiceActive[eEventChoice]; } @@ -7416,47 +7416,47 @@ bool CvCity::IsEventChoiceActive(CityEventChoiceTypes eEventChoice) const void CvCity::SetEventChoiceFired(CityEventChoiceTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventChoiceFired[eEvent] = bValue; } bool CvCity::IsEventChoiceFired(CityEventChoiceTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventChoiceFired[eEvent]; } void CvCity::SetEventFired(CityEventTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventFired[eEvent] = bValue; } bool CvCity::IsEventFired(CityEventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventFired[eEvent]; } int CvCity::GetEventCooldown(CityEventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventCooldown[eEvent]; } void CvCity::ChangeEventCooldown(CityEventTypes eEvent, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if (iValue != 0) { m_aiEventCooldown[eEvent] = m_aiEventCooldown[eEvent] + iValue; @@ -7465,8 +7465,8 @@ void CvCity::ChangeEventCooldown(CityEventTypes eEvent, int iValue) void CvCity::SetEventCooldown(CityEventTypes eEvent, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumCityEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_aiEventCooldown[eEvent] = iValue; } int CvCity::GetEventHappiness() const @@ -7498,7 +7498,7 @@ void CvCity::CheckActivePlayerEvents() // Apply the non-instant effects of ongoing eEventChoice to this city void CvCity::ApplyPlayerEventChoice(const EventChoiceTypes eEventChoice) { - CvAssert(eEventChoice != NO_EVENT_CHOICE); + ASSERT(eEventChoice != NO_EVENT_CHOICE); CvModEventChoiceInfo* pkEventChoiceInfo = GC.getEventChoiceInfo(eEventChoice); if (!pkEventChoiceInfo) @@ -7791,7 +7791,7 @@ CityTaskResult CvCity::doTask(TaskTypes eTask, int iData1, int iData2, bool bOpt break; default: - CvAssertMsg(false, "eTask failed to match a valid option"); + ASSERT(false, "eTask failed to match a valid option"); break; } @@ -7973,8 +7973,8 @@ int CvCity::getEconomicValue(PlayerTypes ePossibleOwner) void CvCity::setEconomicValue(PlayerTypes ePossibleOwner, int iValue) { VALIDATE_OBJECT - CvAssertMsg(ePossibleOwner >= 0, "ePossibleOwner expected to be >= 0"); - CvAssertMsg(ePossibleOwner < MAX_CIV_PLAYERS, "ePossibleOwner expected to be < MAX_CIV_PLAYERS"); + ASSERT(ePossibleOwner >= 0, "ePossibleOwner expected to be >= 0"); + ASSERT(ePossibleOwner < MAX_CIV_PLAYERS, "ePossibleOwner expected to be < MAX_CIV_PLAYERS"); m_aiEconomicValue[ePossibleOwner] = iValue; } @@ -8409,7 +8409,7 @@ UnitTypes CvCity::allUpgradesAvailable(UnitTypes eUnit, int iUpgradeCount) const bool bUpgradeAvailable = false; bool bUpgradeUnavailable = false; - CvAssertMsg(eUnit != NO_UNIT, "eUnit is expected to be assigned (not NO_UNIT)"); + ASSERT(eUnit != NO_UNIT, "eUnit is expected to be assigned (not NO_UNIT)"); CvUnitEntry* pkUnitInfo = GC.getUnitInfo(eUnit); if (pkUnitInfo == NULL) @@ -8478,7 +8478,7 @@ UnitTypes CvCity::allUpgradesAvailable(UnitTypes eUnit, int iUpgradeCount) const { if (bUpgradeFound && bUpgradeAvailable) { - CvAssertMsg(eUpgradeUnit != NO_UNIT, "eUpgradeUnit is expected to be assigned (not NO_UNIT)"); + ASSERT(eUpgradeUnit != NO_UNIT, "eUpgradeUnit is expected to be assigned (not NO_UNIT)"); return eUpgradeUnit; } @@ -9364,8 +9364,8 @@ void CvCity::UpdateTerrainImprovementNeed() int CvCity::GetResourceExtraYield(ResourceTypes eResource, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forResource, eResource); } @@ -9374,8 +9374,8 @@ int CvCity::GetResourceExtraYield(ResourceTypes eResource, YieldTypes eYield) co void CvCity::ChangeResourceExtraYield(ResourceTypes eResource, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forResource, eResource, iChange, true)) @@ -9387,8 +9387,8 @@ void CvCity::ChangeResourceExtraYield(ResourceTypes eResource, YieldTypes eYield int CvCity::GetFeatureExtraYield(FeatureTypes eFeature, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forFeature, eFeature); } @@ -9397,8 +9397,8 @@ int CvCity::GetFeatureExtraYield(FeatureTypes eFeature, YieldTypes eYield) const void CvCity::ChangeFeatureExtraYield(FeatureTypes eFeature, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forFeature, eFeature, iChange, true)) @@ -9411,8 +9411,8 @@ void CvCity::ChangeFeatureExtraYield(FeatureTypes eFeature, YieldTypes eYield, i int CvCity::GetImprovementExtraYield(ImprovementTypes eImprovement, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eImprovement > -1 && eImprovement < GC.getNumImprovementInfos(), "Invalid Improvement index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eImprovement > -1 && eImprovement < GC.getNumImprovementInfos(), "Invalid Improvement index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forImprovement, eImprovement); } @@ -9420,8 +9420,8 @@ int CvCity::GetImprovementExtraYield(ImprovementTypes eImprovement, YieldTypes e void CvCity::ChangeImprovementExtraYield(ImprovementTypes eImprovement, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eImprovement > -1 && eImprovement < GC.getNumImprovementInfos(), "Invalid Improvement index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eImprovement > -1 && eImprovement < GC.getNumImprovementInfos(), "Invalid Improvement index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forImprovement, eImprovement, iChange, true)) @@ -9447,8 +9447,8 @@ void CvCity::SetExtraBuildingMaintenance(int iChange) int CvCity::GetTerrainExtraYield(TerrainTypes eTerrain, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forTerrain, eTerrain); } @@ -9457,8 +9457,8 @@ int CvCity::GetTerrainExtraYield(TerrainTypes eTerrain, YieldTypes eYield) const void CvCity::ChangeTerrainExtraYield(TerrainTypes eTerrain, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forTerrain, eTerrain, iChange, true)) @@ -9485,7 +9485,7 @@ void CvCity::ChangePlotExtraYield(PlotTypes ePlot, YieldTypes eYield, int iChang bool CvCity::IsHasFeatureLocal(FeatureTypes eFeature) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid resource index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid resource index."); // See if we have the resource linked to this city, but not connected yet bool bFoundFeature = false; @@ -9522,7 +9522,7 @@ bool CvCity::IsHasFeatureLocal(FeatureTypes eFeature) const bool CvCity::IsHasResourceLocal(ResourceTypes eResource, bool bTestVisible) const { VALIDATE_OBJECT - CvAssertMsg(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); + ASSERT(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); // Actually check to see if we have this Resource to use right now if (!bTestVisible) @@ -9539,7 +9539,7 @@ bool CvCity::IsHasResourceLocal(ResourceTypes eResource, bool bTestVisible) cons int CvCity::GetNumResourceLocal(ResourceTypes eResource, bool bImproved) { VALIDATE_OBJECT - CvAssertMsg(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); + ASSERT(eResource > -1 && eResource < GC.getNumResourceInfos(), "Invalid resource index."); return bImproved ? m_paiNumResourcesLocal[eResource] : m_paiNumUnimprovedResourcesLocal[eResource]; } #endif @@ -9554,8 +9554,8 @@ void CvCity::ChangeNumResourceLocal(ResourceTypes eResource, int iChange, bool b { VALIDATE_OBJECT - CvAssertMsg(eResource >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); + ASSERT(eResource >= 0, "eIndex expected to be >= 0"); + ASSERT(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); if (iChange != 0) { @@ -10551,7 +10551,7 @@ bool CvCity::isProductionLimited() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10641,7 +10641,7 @@ bool CvCity::canContinueProduction(OrderData order) break; default: - CvAssertMsg(false, "order.eOrderType failed to match a valid option"); + ASSERT(false, "order.eOrderType failed to match a valid option"); break; } @@ -10772,7 +10772,7 @@ UnitTypes CvCity::getProductionUnit() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10802,7 +10802,7 @@ UnitAITypes CvCity::getProductionUnitAI() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10833,7 +10833,7 @@ BuildingTypes CvCity::getProductionBuilding() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10864,7 +10864,7 @@ ProjectTypes CvCity::getProductionProject() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10892,7 +10892,7 @@ ProcessTypes CvCity::getProductionProcess() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10952,7 +10952,7 @@ const char* CvCity::getProductionName() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -10988,7 +10988,7 @@ int CvCity::getGeneralProductionTurnsLeft() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11048,7 +11048,7 @@ const char* CvCity::getProductionNameKey() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11116,7 +11116,7 @@ bool CvCity::isFoodProduction() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11274,7 +11274,7 @@ int CvCity::getProduction() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11312,7 +11312,7 @@ int CvCity::getProductionTimes100() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11350,7 +11350,7 @@ int CvCity::getProductionNeeded() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -11516,7 +11516,7 @@ int CvCity::getProductionTurnsLeft() const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -12807,7 +12807,7 @@ int CvCity::getProductionModifier(CvString* toolTipSink) const break; default: - CvAssertMsg(false, "pOrderNode->eOrderType failed to match a valid option"); + ASSERT(false, "pOrderNode->eOrderType failed to match a valid option"); break; } } @@ -14479,7 +14479,7 @@ void CvCity::processBuilding(BuildingTypes eBuilding, int iChange, bool bFirst, CvPlot* pPlotClaimed = GC.getMap().plot(iX, iY); ResourceTypes eResource = pPlotClaimed->getResourceType(getTeam()); CvResourceInfo* pResourceInfo = GC.getResourceInfo(eResource); - CvAssert(pResourceInfo); + ASSERT(pResourceInfo); NotificationTypes eNotificationType = NO_NOTIFICATION_TYPE; CvString strBuffer; @@ -14569,7 +14569,7 @@ void CvCity::processBuilding(BuildingTypes eBuilding, int iChange, bool bFirst, { CvString strBuffer; CvResourceInfo* pResourceInfo = GC.getResourceInfo(eResource); - CvAssert(pResourceInfo); + ASSERT(pResourceInfo); NotificationTypes eNotificationType = NO_NOTIFICATION_TYPE; strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_FOUND_RESOURCE", pResourceInfo->GetTextKey()); @@ -15126,7 +15126,7 @@ void CvCity::processProcess(ProcessTypes eProcess, int iChange) { VALIDATE_OBJECT const CvProcessInfo* pkProcessInfo = GC.getProcessInfo(eProcess); - CvAssertFmt(pkProcessInfo != NULL, "Process type %d is invalid", eProcess); + ASSERT(pkProcessInfo != NULL, "Process type %d is invalid", eProcess); if (pkProcessInfo != NULL) { // Convert to another yield @@ -15469,30 +15469,30 @@ void CvCity::UpdateReligion(ReligionTypes eNewMajority, bool bRecalcPlotYields) bool CvCity::HasPaidAdoptionBonus(ReligionTypes eReligion) const { VALIDATE_OBJECT - CvAssertMsg(eReligion >= 0, "eReligion expected to be >= 0"); - CvAssertMsg(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); + ASSERT(eReligion >= 0, "eReligion expected to be >= 0"); + ASSERT(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); return m_abPaidAdoptionBonus[eReligion]; } void CvCity::SetPaidAdoptionBonus(ReligionTypes eReligion, bool bNewValue) { VALIDATE_OBJECT - CvAssertMsg(eReligion >= 0, "eReligion expected to be >= 0"); - CvAssertMsg(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); + ASSERT(eReligion >= 0, "eReligion expected to be >= 0"); + ASSERT(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); m_abPaidAdoptionBonus[eReligion] = bNewValue; } int CvCity::GetReligiousPressureModifier(ReligionTypes eReligion) const { VALIDATE_OBJECT - CvAssertMsg(eReligion >= 0, "eReligion expected to be >= 0"); - CvAssertMsg(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); + ASSERT(eReligion >= 0, "eReligion expected to be >= 0"); + ASSERT(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); return m_aiReligiousPressureModifier[eReligion]; } void CvCity::SetReligiousPressureModifier(ReligionTypes eReligion, int iNewValue) { VALIDATE_OBJECT - CvAssertMsg(eReligion >= 0, "eReligion expected to be >= 0"); - CvAssertMsg(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); + ASSERT(eReligion >= 0, "eReligion expected to be >= 0"); + ASSERT(eReligion < GC.getNumReligionInfos(), "eReligion expected to be < getNumReligionInfos"); m_aiReligiousPressureModifier[eReligion] = iNewValue; } void CvCity::ChangeReligiousPressureModifier(ReligionTypes eReligion, int iNewValue) @@ -15851,15 +15851,15 @@ void CvCity::DoSellBuilding() void CvCity::SetTraded(PlayerTypes ePlayer, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); m_abTraded[ePlayer] = bValue; } bool CvCity::IsTraded(PlayerTypes ePlayer) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); return m_abTraded[ePlayer]; } @@ -16888,7 +16888,7 @@ void CvCity::setGameTurnFounded(int iNewValue) if (m_iGameTurnFounded != iNewValue) { m_iGameTurnFounded = iNewValue; - CvAssert(getGameTurnFounded() >= 0); + ASSERT(getGameTurnFounded() >= 0); } } @@ -16906,7 +16906,7 @@ void CvCity::setGameTurnAcquired(int iNewValue) { VALIDATE_OBJECT m_iGameTurnAcquired = iNewValue; - CvAssert(getGameTurnAcquired() >= 0); + ASSERT(getGameTurnAcquired() >= 0); } @@ -16925,7 +16925,7 @@ void CvCity::setGameTurnLastExpanded(int iNewValue) if (m_iGameTurnLastExpanded != iNewValue) { m_iGameTurnLastExpanded = iNewValue; - CvAssert(m_iGameTurnLastExpanded >= 0); + ASSERT(m_iGameTurnLastExpanded >= 0); } } @@ -16979,7 +16979,7 @@ void CvCity::setPopulation(int iNewValue, bool bReassignPop /* = true */, bool b // Fixup the unassigned workers int iUnassignedWorkers = GetCityCitizens()->GetNumUnassignedCitizens(); - CvAssert(iUnassignedWorkers >= -iPopChange); + ASSERT(iUnassignedWorkers >= -iPopChange); GetCityCitizens()->ChangeNumUnassignedCitizens(std::max(iPopChange, -iUnassignedWorkers)); } } @@ -17174,11 +17174,11 @@ void CvCity::setAutomatons(int iNewValue, bool bReassignPop /* = true */) } // Fixup the unassigned workers int iUnassignedWorkers = GetCityCitizens()->GetNumUnassignedCitizens(); - CvAssert(iUnassignedWorkers >= -iChange); + ASSERT(iUnassignedWorkers >= -iChange); GetCityCitizens()->ChangeNumUnassignedCitizens(std::max(iChange, -iUnassignedWorkers)); } m_iAutomatons = iNewValue; - CvAssert(getAutomatons() >= 0); + ASSERT(getAutomatons() >= 0); if (bReassignPop && iChange > 0) { // Give new automatons something to do in the City GetCityCitizens()->ChangeNumUnassignedCitizens(iChange); @@ -17226,7 +17226,7 @@ void CvCity::setHighestPopulation(int iNewValue) { VALIDATE_OBJECT m_iHighestPopulation = iNewValue; - CvAssert(getHighestPopulation() >= 0); + ASSERT(getHighestPopulation() >= 0); } // -------------------------------------------------------------------------------- @@ -17265,7 +17265,7 @@ void CvCity::changeBaseGreatPeopleRate(int iChange) { VALIDATE_OBJECT m_iBaseGreatPeopleRate = (m_iBaseGreatPeopleRate + iChange); - CvAssert(getBaseGreatPeopleRate() >= 0); + ASSERT(getBaseGreatPeopleRate() >= 0); } @@ -17928,8 +17928,8 @@ int CvCity::GetJONSCulturePerTurnFromTraits() const void CvCity::ChangeYieldFromTraits(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -18368,17 +18368,17 @@ void CvCity::UpdateYieldPerXTerrainFromReligion(YieldTypes eYield, TerrainTypes // -------------------------------------------------------------------------------- int CvCity::GetNumTerrainWorked(TerrainTypes eTerrain) { - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); return m_paiNumTerrainWorked[eTerrain]; } // -------------------------------------------------------------------------------- void CvCity::ChangeNumTerrainWorked(TerrainTypes eTerrain, int iChange) { - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); m_paiNumTerrainWorked[eTerrain] = m_paiNumTerrainWorked[eTerrain] + iChange; - CvAssert(GetNumTerrainWorked(eTerrain) >= 0); + ASSERT(GetNumTerrainWorked(eTerrain) >= 0); //Update yields for (int iI = 0; iI < NUM_YIELD_TYPES; iI++) @@ -18394,17 +18394,17 @@ void CvCity::ChangeNumTerrainWorked(TerrainTypes eTerrain, int iChange) int CvCity::GetNumFeaturelessTerrainWorked(TerrainTypes eTerrain) { - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); return m_paiNumFeaturelessTerrainWorked[eTerrain]; } // -------------------------------------------------------------------------------- void CvCity::ChangeNumFeaturelessTerrainWorked(TerrainTypes eTerrain, int iChange) { - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); m_paiNumFeaturelessTerrainWorked[eTerrain] = m_paiNumFeaturelessTerrainWorked[eTerrain] + iChange; - CvAssert(GetNumFeaturelessTerrainWorked(eTerrain) >= 0); + ASSERT(GetNumFeaturelessTerrainWorked(eTerrain) >= 0); //Update yields for (int iI = 0; iI < NUM_YIELD_TYPES; iI++) @@ -18420,17 +18420,17 @@ void CvCity::ChangeNumFeaturelessTerrainWorked(TerrainTypes eTerrain, int iChang // -------------------------------------------------------------------------------- int CvCity::GetNumFeatureWorked(FeatureTypes eFeature) { - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); return m_paiNumFeatureWorked[eFeature]; } // -------------------------------------------------------------------------------- void CvCity::ChangeNumFeatureWorked(FeatureTypes eFeature, int iChange) { - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); m_paiNumFeatureWorked[eFeature] = m_paiNumFeatureWorked[eFeature] + iChange; - CvAssert(GetNumFeatureWorked(eFeature) >= 0); + ASSERT(GetNumFeatureWorked(eFeature) >= 0); //Update yields for (int iI = 0; iI < NUM_YIELD_TYPES; iI++) @@ -18445,40 +18445,40 @@ void CvCity::ChangeNumFeatureWorked(FeatureTypes eFeature, int iChange) // -------------------------------------------------------------------------------- int CvCity::GetNumResourceWorked(ResourceTypes eResource) { - CvAssertMsg(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); + ASSERT(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); + ASSERT(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); return m_paiNumResourceWorked[eResource]; } // -------------------------------------------------------------------------------- void CvCity::ChangeNumResourceWorked(ResourceTypes eResource, int iChange) { - CvAssertMsg(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); + ASSERT(eResource >= 0, "eResource is expected to be non-negative (invalid Index)"); + ASSERT(eResource < GC.getNumResourceInfos(), "eResource is expected to be within maximum bounds (invalid Index)"); m_paiNumResourceWorked[eResource] = m_paiNumResourceWorked[eResource] + iChange; - CvAssert(GetNumResourceWorked(eResource) >= 0); + ASSERT(GetNumResourceWorked(eResource) >= 0); } // -------------------------------------------------------------------------------- int CvCity::GetNumImprovementWorked(ImprovementTypes eImprovement) { - CvAssertMsg(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); return m_paiNumImprovementWorked[eImprovement]; } // -------------------------------------------------------------------------------- void CvCity::ChangeNumImprovementWorked(ImprovementTypes eImprovement, int iChange) { - CvAssertMsg(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eImprovement is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eImprovement is expected to be within maximum bounds (invalid Index)"); m_paiNumImprovementWorked[eImprovement] = m_paiNumImprovementWorked[eImprovement] + iChange; - CvAssert(GetNumImprovementWorked(eImprovement) >= 0); + ASSERT(GetNumImprovementWorked(eImprovement) >= 0); } // -------------------------------------------------------------------------------- void CvCity::SetYieldPerXTerrain(TerrainTypes eTerrain, YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forXTerrain, eTerrain, iValue, false)) @@ -18488,8 +18488,8 @@ void CvCity::SetYieldPerXTerrain(TerrainTypes eTerrain, YieldTypes eYield, int i void CvCity::SetYieldPerXTerrainFromReligion(TerrainTypes eTerrain, YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forTerrainFromReligion, eTerrain, iValue, false)) @@ -18500,8 +18500,8 @@ void CvCity::SetYieldPerXTerrainFromReligion(TerrainTypes eTerrain, YieldTypes e int CvCity::GetYieldPerXTerrain(TerrainTypes eTerrain, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forXTerrain, eTerrain); } @@ -18510,8 +18510,8 @@ int CvCity::GetYieldPerXTerrain(TerrainTypes eTerrain, YieldTypes eYield) const int CvCity::GetYieldPerXTerrainFromReligion(TerrainTypes eTerrain, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forTerrainFromReligion, eTerrain); } @@ -18520,8 +18520,8 @@ int CvCity::GetYieldPerXTerrainFromReligion(TerrainTypes eTerrain, YieldTypes eY int CvCity::GetYieldPerXTerrainFromBuildingsTimes100(TerrainTypes eTerrain, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forTerrainFromBuildings, eTerrain); } @@ -18530,8 +18530,8 @@ int CvCity::GetYieldPerXTerrainFromBuildingsTimes100(TerrainTypes eTerrain, Yiel void CvCity::ChangeYieldPerXTerrainFromBuildingsTimes100(TerrainTypes eTerrain, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eTerrain > -1 && eTerrain < GC.getNumTerrainInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forTerrainFromBuildings, eTerrain, iChange, true)) @@ -18543,8 +18543,8 @@ void CvCity::ChangeYieldPerXTerrainFromBuildingsTimes100(TerrainTypes eTerrain, int CvCity::GetYieldPerXFeatureFromBuildingsTimes100(FeatureTypes eFeature, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forFeatureFromBuildings, eFeature); } @@ -18553,8 +18553,8 @@ int CvCity::GetYieldPerXFeatureFromBuildingsTimes100(FeatureTypes eFeature, Yiel void CvCity::ChangeYieldPerXFeatureFromBuildingsTimes100(FeatureTypes eFeature, YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forFeatureFromBuildings, eFeature, iChange, true)) @@ -18569,8 +18569,8 @@ void CvCity::ChangeYieldPerXFeatureFromBuildingsTimes100(FeatureTypes eFeature, int CvCity::GetYieldPerXFeature(FeatureTypes eFeature, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forXFeature, eFeature); } @@ -18578,8 +18578,8 @@ int CvCity::GetYieldPerXFeature(FeatureTypes eFeature, YieldTypes eYield) const int CvCity::GetYieldPerXFeatureFromReligion(FeatureTypes eFeature, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forFeatureFromReligion, eFeature); } @@ -18589,8 +18589,8 @@ int CvCity::GetYieldPerXFeatureFromReligion(FeatureTypes eFeature, YieldTypes eY int CvCity::GetYieldPerTurnFromUnimprovedFeatures(FeatureTypes eFeature, YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Terrain index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); return ModifierLookup(m_yieldChanges[eYield].forFeatureUnimproved, eFeature); } @@ -18598,8 +18598,8 @@ int CvCity::GetYieldPerTurnFromUnimprovedFeatures(FeatureTypes eFeature, YieldTy void CvCity::SetYieldPerXFeature(FeatureTypes eFeature, YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forXFeature, eFeature, iValue, false)) @@ -18610,8 +18610,8 @@ void CvCity::SetYieldPerXFeature(FeatureTypes eFeature, YieldTypes eYield, int i void CvCity::SetYieldPerXFeatureFromReligion(FeatureTypes eFeature, YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forFeatureFromReligion, eFeature, iValue, false)) @@ -18621,8 +18621,8 @@ void CvCity::SetYieldPerXFeatureFromReligion(FeatureTypes eFeature, YieldTypes e void CvCity::SetYieldPerXUnimprovedFeature(FeatureTypes eFeature, YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); - CvAssertMsg(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); + ASSERT(eFeature > -1 && eFeature < GC.getNumFeatureInfos(), "Invalid Feature index."); + ASSERT(eYield > -1 && eYield < NUM_YIELD_TYPES, "Invalid yield index."); SCityExtraYields& y = m_yieldChanges[eYield]; if (ModifierUpdateInsertRemove(y.forFeatureUnimproved, eFeature, iValue, false)) @@ -18801,8 +18801,8 @@ void CvCity::UpdateYieldPerXFeature(YieldTypes eYield, FeatureTypes eFeature) // -------------------------------------------------------------------------------- int CvCity::getHurryModifier(HurryTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiHurryModifier[eIndex]; } @@ -18811,8 +18811,8 @@ void CvCity::changeHurryModifier(HurryTypes eIndex, int iChange) { if (iChange != 0) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiHurryModifier[eIndex] = m_paiHurryModifier[eIndex] + iChange; } } @@ -18820,10 +18820,10 @@ void CvCity::changeHurryModifier(HurryTypes eIndex, int iChange) // -------------------------------------------------------------------------------- int CvCity::getSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); return ModifierLookup(m_yieldChanges[eIndex2].forSpecialist, eIndex1); } @@ -18831,10 +18831,10 @@ int CvCity::getSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eIndex2) // -------------------------------------------------------------------------------- void CvCity::changeSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); SCityExtraYields& y = m_yieldChanges[eIndex2]; if (ModifierUpdateInsertRemove(y.forSpecialist, eIndex1, iChange, true)) @@ -18868,17 +18868,17 @@ void CvCity::changeCultureRateModifier(int iChange) // -------------------------------------------------------------------------------- int CvCity::getBuildingClassCultureChange(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassCulture[eIndex]; } // -------------------------------------------------------------------------------- void CvCity::changeBuildingClassCultureChange(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCulture[eIndex] += iChange; - CvAssert(m_paiBuildingClassCulture[eIndex] >= 0); + ASSERT(m_paiBuildingClassCulture[eIndex] >= 0); } // -------------------------------------------------------------------------------- @@ -18940,7 +18940,7 @@ void CvCity::changeNumWorldWonders(int iChange) if (iChange != 0) { m_iNumWorldWonders = (m_iNumWorldWonders + iChange); - CvAssert(getNumWorldWonders() >= 0); + ASSERT(getNumWorldWonders() >= 0); // Extra culture for Wonders (Policies, etc.) ChangeJONSCulturePerTurnFromPolicies(GET_PLAYER(getOwner()).GetCulturePerWonder() * iChange); @@ -18961,7 +18961,7 @@ void CvCity::changeNumTeamWonders(int iChange) { VALIDATE_OBJECT m_iNumTeamWonders = (m_iNumTeamWonders + iChange); - CvAssert(getNumTeamWonders() >= 0); + ASSERT(getNumTeamWonders() >= 0); } @@ -18978,7 +18978,7 @@ void CvCity::changeNumNationalWonders(int iChange) { VALIDATE_OBJECT m_iNumNationalWonders = (m_iNumNationalWonders + iChange); - CvAssert(getNumNationalWonders() >= 0); + ASSERT(getNumNationalWonders() >= 0); } @@ -18995,7 +18995,7 @@ void CvCity::ChangeWonderProductionModifier(int iChange) { VALIDATE_OBJECT m_iWonderProductionModifier = (m_iWonderProductionModifier + iChange); - CvAssert(GetWonderProductionModifier() >= 0); + ASSERT(GetWonderProductionModifier() >= 0); } // -------------------------------------------------------------------------------- @@ -19004,7 +19004,7 @@ int CvCity::GetLocalResourceWonderProductionMod(BuildingTypes eBuilding, CvStrin VALIDATE_OBJECT int iMultiplier = 0; - CvAssertMsg(eBuilding > -1 && eBuilding < GC.getNumBuildingInfos(), "Invalid building index. Please show Jon."); + ASSERT(eBuilding > -1 && eBuilding < GC.getNumBuildingInfos(), "Invalid building index."); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); if (pkBuildingInfo) { @@ -19128,7 +19128,7 @@ void CvCity::changeCapturePlunderModifier(int iChange) { VALIDATE_OBJECT m_iCapturePlunderModifier = (m_iCapturePlunderModifier + iChange); - CvAssert(m_iCapturePlunderModifier >= 0); + ASSERT(m_iCapturePlunderModifier >= 0); } // -------------------------------------------------------------------------------- @@ -19306,7 +19306,7 @@ void CvCity::changeHealRate(int iChange) { VALIDATE_OBJECT m_iHealRate = (m_iHealRate + iChange); - CvAssert(getHealRate() >= 0); + ASSERT(getHealRate() >= 0); } // -------------------------------------------------------------------------------- @@ -19490,7 +19490,7 @@ void CvCity::changeMaxFoodKeptPercent(int iChange) { VALIDATE_OBJECT m_iMaxFoodKeptPercent = (m_iMaxFoodKeptPercent + iChange); - CvAssert(getMaxFoodKeptPercent() >= 0); + ASSERT(getMaxFoodKeptPercent() >= 0); } @@ -19514,8 +19514,8 @@ void CvCity::setOverflowProduction(int iNewValue) void CvCity::changeOverflowProduction(int iChange) { VALIDATE_OBJECT - CvAssertMsg(iChange >= 0, "Production overflow is too low. Please send a save to Ed."); - CvAssertMsg(iChange < 250, "Production overflow is too high. Please send a save to Ed."); + ASSERT(iChange >= 0, "Production overflow is too low."); + ASSERT(iChange < 250, "Production overflow is too high."); changeOverflowProductionTimes100(iChange * 100); } @@ -19533,7 +19533,7 @@ void CvCity::setOverflowProductionTimes100(int iNewValue) { VALIDATE_OBJECT m_iOverflowProduction = iNewValue; - CvAssert(getOverflowProductionTimes100() >= 0); + ASSERT(getOverflowProductionTimes100() >= 0); } @@ -19541,8 +19541,8 @@ void CvCity::setOverflowProductionTimes100(int iNewValue) void CvCity::changeOverflowProductionTimes100(int iChange) { VALIDATE_OBJECT - CvAssertMsg(iChange >= 0, "Production overflow is too low. Please send a save to Ed."); - CvAssertMsg(iChange < 25000, "Production overflow is too high. Please send a save to Ed."); + ASSERT(iChange >= 0, "Production overflow is too low."); + ASSERT(iChange < 25000, "Production overflow is too high."); setOverflowProductionTimes100(getOverflowProductionTimes100() + iChange); } @@ -19560,7 +19560,7 @@ void CvCity::setFeatureProduction(int iNewValue) { VALIDATE_OBJECT m_iFeatureProduction = iNewValue; - CvAssert(getFeatureProduction() >= 0); + ASSERT(getFeatureProduction() >= 0); } @@ -19617,7 +19617,7 @@ void CvCity::changeFreeExperience(int iChange) { VALIDATE_OBJECT m_iFreeExperience = (m_iFreeExperience + iChange); - CvAssert(getFreeExperience() >= 0); + ASSERT(getFreeExperience() >= 0); } // -------------------------------------------------------------------------------- @@ -22709,14 +22709,14 @@ int CvCity::GetNumTimesOwned(PlayerTypes ePlayer) const } void CvCity::SetNumTimesOwned(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); m_aiNumTimesOwned[ePlayer] = iValue; } void CvCity::ChangeNumTimesOwned(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); SetNumTimesOwned(ePlayer, (GetNumTimesOwned(ePlayer) + iValue)); } bool CvCity::isEverOwned(PlayerTypes ePlayer) const @@ -22736,8 +22736,8 @@ TeamTypes CvCity::getTeam() const int CvCity::getSeaPlotYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiSeaPlotYield[eIndex]; } @@ -22746,13 +22746,13 @@ int CvCity::getSeaPlotYield(YieldTypes eIndex) const void CvCity::changeSeaPlotYield(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiSeaPlotYield[eIndex] = m_aiSeaPlotYield[eIndex] + iChange; - CvAssert(getSeaPlotYield(eIndex) >= 0); + ASSERT(getSeaPlotYield(eIndex) >= 0); updateYield(); } @@ -22762,8 +22762,8 @@ void CvCity::changeSeaPlotYield(YieldTypes eIndex, int iChange) int CvCity::getRiverPlotYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiRiverPlotYield[eIndex]; } @@ -22771,13 +22771,13 @@ int CvCity::getRiverPlotYield(YieldTypes eIndex) const void CvCity::changeRiverPlotYield(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiRiverPlotYield[eIndex] = m_aiRiverPlotYield[eIndex] + iChange; - CvAssert(getRiverPlotYield(eIndex) >= 0); + ASSERT(getRiverPlotYield(eIndex) >= 0); updateYield(); } @@ -22787,8 +22787,8 @@ void CvCity::changeRiverPlotYield(YieldTypes eIndex, int iChange) int CvCity::getLakePlotYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiLakePlotYield[eIndex]; } @@ -22797,13 +22797,13 @@ int CvCity::getLakePlotYield(YieldTypes eIndex) const void CvCity::changeLakePlotYield(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiLakePlotYield[eIndex] = m_aiLakePlotYield[eIndex] + iChange; - CvAssert(getLakePlotYield(eIndex) >= 0); + ASSERT(getLakePlotYield(eIndex) >= 0); updateYield(); } @@ -22813,8 +22813,8 @@ void CvCity::changeLakePlotYield(YieldTypes eIndex, int iChange) int CvCity::getSeaResourceYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiSeaResourceYield[eIndex]; } @@ -22823,13 +22823,13 @@ int CvCity::getSeaResourceYield(YieldTypes eIndex) const void CvCity::changeSeaResourceYield(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiSeaResourceYield[eIndex] = m_aiSeaResourceYield[eIndex] + iChange; - CvAssert(getSeaResourceYield(eIndex) >= 0); + ASSERT(getSeaResourceYield(eIndex) >= 0); updateYield(); } @@ -23017,8 +23017,8 @@ void CvCity::UpdateSpecialReligionYields(YieldTypes eYield) int CvCity::GetSpecialReligionYields(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromKnownPantheons[eIndex]; } @@ -23027,13 +23027,13 @@ int CvCity::GetSpecialReligionYields(YieldTypes eIndex) const void CvCity::SetSpecialReligionYields(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != m_aiYieldFromKnownPantheons[eIndex]) { m_aiYieldFromKnownPantheons[eIndex] = iChange; - CvAssert(GetSpecialReligionYields(eIndex) >= 0); + ASSERT(GetSpecialReligionYields(eIndex) >= 0); } } @@ -23625,8 +23625,8 @@ void CvCity::UpdateCityYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2, in int CvCity::getBaseYieldRate(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); int iValue = 0; iValue += GetBaseYieldRateFromGreatWorks(eIndex); @@ -23720,8 +23720,8 @@ int CvCity::GetBaseScienceFromArt() const int CvCity::GetBaseYieldRateFromGreatWorks(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (m_GwYieldCache[eIndex] == -1) m_GwYieldCache[eIndex] = GetCityBuildings()->GetYieldFromGreatWorks(eIndex); @@ -23734,8 +23734,8 @@ int CvCity::GetBaseYieldRateFromGreatWorks(YieldTypes eIndex) const int CvCity::GetBaseYieldRateFromTerrain(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiBaseYieldRateFromTerrain[eIndex]; } @@ -23745,8 +23745,8 @@ int CvCity::GetBaseYieldRateFromTerrain(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromTerrain(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -23769,8 +23769,8 @@ void CvCity::ChangeBaseYieldRateFromTerrain(YieldTypes eIndex, int iChange) void CvCity::SetBaseYieldRateFromTerrain(YieldTypes eIndex, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iValue != m_aiBaseYieldRateFromTerrain[eIndex]) { @@ -23791,8 +23791,8 @@ void CvCity::SetBaseYieldRateFromTerrain(YieldTypes eIndex, int iValue) int CvCity::GetBaseYieldRateFromBuildings(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiBaseYieldRateFromBuildings[eIndex]; } @@ -23801,8 +23801,8 @@ int CvCity::GetBaseYieldRateFromBuildings(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromBuildings(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -23823,8 +23823,8 @@ void CvCity::ChangeBaseYieldRateFromBuildings(YieldTypes eIndex, int iChange) int CvCity::GetBaseYieldRateFromSpecialists(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiBaseYieldRateFromSpecialists[eIndex]; } @@ -23834,8 +23834,8 @@ int CvCity::GetBaseYieldRateFromSpecialists(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromSpecialists(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -23856,8 +23856,8 @@ void CvCity::ChangeBaseYieldRateFromSpecialists(YieldTypes eIndex, int iChange) int CvCity::GetBaseYieldRateFromMisc(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiBaseYieldRateFromMisc[eIndex]; } @@ -23867,8 +23867,8 @@ int CvCity::GetBaseYieldRateFromMisc(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromMisc(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -23888,8 +23888,8 @@ void CvCity::ChangeBaseYieldRateFromMisc(YieldTypes eIndex, int iChange) int CvCity::GetBaseYieldRateFromProcess(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); // Process production into specific yield int iTradeRouteBonus = GET_PLAYER(m_eOwner).GetTrade()->GetTradeValuesAtCityTimes100(this, YIELD_PRODUCTION); @@ -23900,8 +23900,8 @@ int CvCity::GetBaseYieldRateFromProcess(YieldTypes eIndex) const int CvCity::GetBaseYieldRateFromLeague(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiBaseYieldRateFromLeague[eIndex]; } @@ -23911,8 +23911,8 @@ int CvCity::GetBaseYieldRateFromLeague(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromLeague(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -23967,8 +23967,8 @@ void CvCity::SetTotalArtsyAid(int iValue) int CvCity::GetGrowthExtraYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiChangeGrowthExtraYield[eIndex]; } @@ -23977,13 +23977,13 @@ int CvCity::GetGrowthExtraYield(YieldTypes eIndex) const void CvCity::ChangeGrowthExtraYield(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiChangeGrowthExtraYield[eIndex] = m_aiChangeGrowthExtraYield[eIndex] + iChange; - CvAssert(GetGrowthExtraYield(eIndex) >= 0); + ASSERT(GetGrowthExtraYield(eIndex) >= 0); } } #endif @@ -23993,8 +23993,8 @@ void CvCity::ChangeGrowthExtraYield(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromVictory(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictory[eIndex]; } @@ -24003,13 +24003,13 @@ int CvCity::GetYieldFromVictory(YieldTypes eIndex) const void CvCity::ChangeYieldFromVictory(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromVictory[eIndex] = m_aiYieldFromVictory[eIndex] + iChange; - CvAssert(GetYieldFromVictory(eIndex) >= 0); + ASSERT(GetYieldFromVictory(eIndex) >= 0); } } @@ -24018,21 +24018,21 @@ void CvCity::ChangeYieldFromVictory(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromVictoryGlobal(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictoryGlobal[eIndex]; } void CvCity::ChangeYieldFromVictoryGlobal(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromVictoryGlobal[eIndex] = m_aiYieldFromVictoryGlobal[eIndex] + iChange; - CvAssert(GetYieldFromVictoryGlobal(eIndex) >= 0); + ASSERT(GetYieldFromVictoryGlobal(eIndex) >= 0); } } @@ -24041,21 +24041,21 @@ void CvCity::ChangeYieldFromVictoryGlobal(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromVictoryGlobalEraScaling(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictoryGlobalEraScaling[eIndex]; } void CvCity::ChangeYieldFromVictoryGlobalEraScaling(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromVictoryGlobalEraScaling[eIndex] = m_aiYieldFromVictoryGlobalEraScaling[eIndex] + iChange; - CvAssert(GetYieldFromVictoryGlobalEraScaling(eIndex) >= 0); + ASSERT(GetYieldFromVictoryGlobalEraScaling(eIndex) >= 0); } } @@ -24064,21 +24064,21 @@ void CvCity::ChangeYieldFromVictoryGlobalEraScaling(YieldTypes eIndex, int iChan int CvCity::GetYieldFromVictoryGlobalInGoldenAge(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictoryGlobalInGoldenAge[eIndex]; } void CvCity::ChangeYieldFromVictoryGlobalInGoldenAge(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromVictoryGlobalInGoldenAge[eIndex] = m_aiYieldFromVictoryGlobalInGoldenAge[eIndex] + iChange; - CvAssert(GetYieldFromVictoryGlobalInGoldenAge(eIndex) >= 0); + ASSERT(GetYieldFromVictoryGlobalInGoldenAge(eIndex) >= 0); } } @@ -24087,21 +24087,21 @@ void CvCity::ChangeYieldFromVictoryGlobalInGoldenAge(YieldTypes eIndex, int iCha int CvCity::GetYieldFromVictoryGlobalInGoldenAgeEraScaling(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictoryGlobalInGoldenAgeEraScaling[eIndex]; } void CvCity::ChangeYieldFromVictoryGlobalInGoldenAgeEraScaling(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromVictoryGlobalInGoldenAgeEraScaling[eIndex] = m_aiYieldFromVictoryGlobalInGoldenAgeEraScaling[eIndex] + iChange; - CvAssert(GetYieldFromVictoryGlobalInGoldenAgeEraScaling(eIndex) >= 0); + ASSERT(GetYieldFromVictoryGlobalInGoldenAgeEraScaling(eIndex) >= 0); } } @@ -24110,8 +24110,8 @@ void CvCity::ChangeYieldFromVictoryGlobalInGoldenAgeEraScaling(YieldTypes eIndex int CvCity::GetYieldFromPillage(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPillage[eIndex]; } @@ -24120,21 +24120,21 @@ int CvCity::GetYieldFromPillage(YieldTypes eIndex) const void CvCity::ChangeYieldFromPillage(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPillage[eIndex] = m_aiYieldFromPillage[eIndex] + iChange; - CvAssert(GetYieldFromPillage(eIndex) >= 0); + ASSERT(GetYieldFromPillage(eIndex) >= 0); } } int CvCity::GetYieldFromPillageGlobal(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPillageGlobal[eIndex]; } @@ -24143,13 +24143,13 @@ int CvCity::GetYieldFromPillageGlobal(YieldTypes eIndex) const void CvCity::ChangeYieldFromPillageGlobal(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPillageGlobal[eIndex] = m_aiYieldFromPillageGlobal[eIndex] + iChange; - CvAssert(GetYieldFromPillageGlobal(eIndex) >= 0); + ASSERT(GetYieldFromPillageGlobal(eIndex) >= 0); } } @@ -24158,8 +24158,8 @@ void CvCity::ChangeYieldFromPillageGlobal(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromGoldenAgeStart(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromGoldenAgeStart[eIndex]; } @@ -24168,13 +24168,13 @@ int CvCity::GetYieldFromGoldenAgeStart(YieldTypes eIndex) const void CvCity::ChangeYieldFromGoldenAgeStart(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromGoldenAgeStart[eIndex] = m_aiYieldFromGoldenAgeStart[eIndex] + iChange; - CvAssert(GetYieldFromGoldenAgeStart(eIndex) >= 0); + ASSERT(GetYieldFromGoldenAgeStart(eIndex) >= 0); } } @@ -24183,8 +24183,8 @@ void CvCity::ChangeYieldFromGoldenAgeStart(YieldTypes eIndex, int iChange) int CvCity::GetYieldChangePerGoldenAge(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldChangePerGoldenAge[eIndex]; } @@ -24193,13 +24193,13 @@ int CvCity::GetYieldChangePerGoldenAge(YieldTypes eIndex) const void CvCity::ChangeYieldChangePerGoldenAge(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldChangePerGoldenAge[eIndex] = m_aiYieldChangePerGoldenAge[eIndex] + iChange; - CvAssert(GetYieldChangePerGoldenAge(eIndex) >= 0); + ASSERT(GetYieldChangePerGoldenAge(eIndex) >= 0); } } @@ -24208,8 +24208,8 @@ void CvCity::ChangeYieldChangePerGoldenAge(YieldTypes eIndex, int iChange) int CvCity::GetYieldChangePerGoldenAgeCap(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldChangePerGoldenAgeCap[eIndex]; } @@ -24218,13 +24218,13 @@ int CvCity::GetYieldChangePerGoldenAgeCap(YieldTypes eIndex) const void CvCity::ChangeYieldChangePerGoldenAgeCap(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldChangePerGoldenAgeCap[eIndex] = m_aiYieldChangePerGoldenAgeCap[eIndex] + iChange; - CvAssert(GetYieldChangePerGoldenAgeCap(eIndex) >= 0); + ASSERT(GetYieldChangePerGoldenAgeCap(eIndex) >= 0); } } @@ -24233,8 +24233,8 @@ void CvCity::ChangeYieldChangePerGoldenAgeCap(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromPreviousGoldenAges(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPreviousGoldenAges[eIndex]; } @@ -24243,13 +24243,13 @@ int CvCity::GetYieldFromPreviousGoldenAges(YieldTypes eIndex) const void CvCity::ChangeYieldFromPreviousGoldenAges(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPreviousGoldenAges[eIndex] = m_aiYieldFromPreviousGoldenAges[eIndex] + iChange; - CvAssert(GetYieldFromPreviousGoldenAges(eIndex) >= 0); + ASSERT(GetYieldFromPreviousGoldenAges(eIndex) >= 0); ChangeBaseYieldRateFromMisc(eIndex, iChange); UpdateAllNonPlotYields(false); @@ -24261,8 +24261,8 @@ void CvCity::ChangeYieldFromPreviousGoldenAges(YieldTypes eIndex, int iChange) int CvCity::GetGoldenAgeYieldMod(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiGoldenAgeYieldMod[eIndex]; } @@ -24271,13 +24271,13 @@ int CvCity::GetGoldenAgeYieldMod(YieldTypes eIndex) const void CvCity::ChangeGoldenAgeYieldMod(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiGoldenAgeYieldMod[eIndex] = m_aiGoldenAgeYieldMod[eIndex] + iChange; - CvAssert(GetGoldenAgeYieldMod(eIndex) >= 0); + ASSERT(GetGoldenAgeYieldMod(eIndex) >= 0); } } @@ -24287,8 +24287,8 @@ void CvCity::ChangeGoldenAgeYieldMod(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromWLTKD(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromWLTKD[eIndex]; } @@ -24297,13 +24297,13 @@ int CvCity::GetYieldFromWLTKD(YieldTypes eIndex) const void CvCity::ChangeYieldFromWLTKD(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromWLTKD[eIndex] = m_aiYieldFromWLTKD[eIndex] + iChange; - CvAssert(GetYieldFromWLTKD(eIndex) >= 0); + ASSERT(GetYieldFromWLTKD(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24311,8 +24311,8 @@ void CvCity::ChangeYieldFromWLTKD(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromConstruction(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromConstruction[eIndex]; } @@ -24321,13 +24321,13 @@ int CvCity::GetYieldFromConstruction(YieldTypes eIndex) const void CvCity::ChangeYieldFromConstruction(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromConstruction[eIndex] = m_aiYieldFromConstruction[eIndex] + iChange; - CvAssert(GetYieldFromConstruction(eIndex) >= 0); + ASSERT(GetYieldFromConstruction(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24335,8 +24335,8 @@ void CvCity::ChangeYieldFromConstruction(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromTech(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromTech[eIndex]; } @@ -24345,13 +24345,13 @@ int CvCity::GetYieldFromTech(YieldTypes eIndex) const void CvCity::ChangeYieldFromTech(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromTech[eIndex] = m_aiYieldFromTech[eIndex] + iChange; - CvAssert(GetYieldFromTech(eIndex) >= 0); + ASSERT(GetYieldFromTech(eIndex) >= 0); } } @@ -24360,8 +24360,8 @@ void CvCity::ChangeYieldFromTech(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromBirth(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromBirth[eIndex]; } @@ -24370,13 +24370,13 @@ int CvCity::GetYieldFromBirth(YieldTypes eIndex) const void CvCity::ChangeYieldFromBirth(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromBirth[eIndex] += iChange; - CvAssert(GetYieldFromBirth(eIndex) >= 0); + ASSERT(GetYieldFromBirth(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24384,8 +24384,8 @@ void CvCity::ChangeYieldFromBirth(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromBirthEraScaling(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromBirthEraScaling[eIndex]; } @@ -24394,13 +24394,13 @@ int CvCity::GetYieldFromBirthEraScaling(YieldTypes eIndex) const void CvCity::ChangeYieldFromBirthEraScaling(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromBirthEraScaling[eIndex] += iChange; - CvAssert(GetYieldFromBirthEraScaling(eIndex) >= 0); + ASSERT(GetYieldFromBirthEraScaling(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24408,8 +24408,8 @@ void CvCity::ChangeYieldFromBirthEraScaling(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromUnitProduction(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromUnitProduction[eIndex]; } @@ -24418,13 +24418,13 @@ int CvCity::GetYieldFromUnitProduction(YieldTypes eIndex) const void CvCity::ChangeYieldFromUnitProduction(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromUnitProduction[eIndex] = m_aiYieldFromUnitProduction[eIndex] + iChange; - CvAssert(GetYieldFromUnitProduction(eIndex) >= 0); + ASSERT(GetYieldFromUnitProduction(eIndex) >= 0); } } @@ -24433,8 +24433,8 @@ void CvCity::ChangeYieldFromUnitProduction(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromBorderGrowth(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromBorderGrowth[eIndex]; } @@ -24443,13 +24443,13 @@ int CvCity::GetYieldFromBorderGrowth(YieldTypes eIndex) const void CvCity::ChangeYieldFromBorderGrowth(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromBorderGrowth[eIndex] = m_aiYieldFromBorderGrowth[eIndex] + iChange; - CvAssert(GetYieldFromBorderGrowth(eIndex) >= 0); + ASSERT(GetYieldFromBorderGrowth(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24457,8 +24457,8 @@ void CvCity::ChangeYieldFromBorderGrowth(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromPolicyUnlock(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPolicyUnlock[eIndex]; } @@ -24467,13 +24467,13 @@ int CvCity::GetYieldFromPolicyUnlock(YieldTypes eIndex) const void CvCity::ChangeYieldFromPolicyUnlock(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPolicyUnlock[eIndex] = m_aiYieldFromPolicyUnlock[eIndex] + iChange; - CvAssert(GetYieldFromPolicyUnlock(eIndex) >= 0); + ASSERT(GetYieldFromPolicyUnlock(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24481,8 +24481,8 @@ void CvCity::ChangeYieldFromPolicyUnlock(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromPurchase(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPurchase[eIndex]; } @@ -24491,13 +24491,13 @@ int CvCity::GetYieldFromPurchase(YieldTypes eIndex) const void CvCity::ChangeYieldFromPurchase(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPurchase[eIndex] = m_aiYieldFromPurchase[eIndex] + iChange; - CvAssert(GetYieldFromPurchase(eIndex) >= 0); + ASSERT(GetYieldFromPurchase(eIndex) >= 0); } } @@ -24507,8 +24507,8 @@ void CvCity::ChangeYieldFromPurchase(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromPurchaseGlobal(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPurchaseGlobal[eIndex]; } @@ -24517,13 +24517,13 @@ int CvCity::GetYieldFromPurchaseGlobal(YieldTypes eIndex) const void CvCity::ChangeYieldFromPurchaseGlobal(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromPurchaseGlobal[eIndex] = m_aiYieldFromPurchaseGlobal[eIndex] + iChange; - CvAssert(GetYieldFromPurchaseGlobal(eIndex) >= 0); + ASSERT(GetYieldFromPurchaseGlobal(eIndex) >= 0); } } @@ -24532,8 +24532,8 @@ void CvCity::ChangeYieldFromPurchaseGlobal(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromFaithPurchase(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromFaithPurchase[eIndex]; } @@ -24542,13 +24542,13 @@ int CvCity::GetYieldFromFaithPurchase(YieldTypes eIndex) const void CvCity::ChangeYieldFromFaithPurchase(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromFaithPurchase[eIndex] = m_aiYieldFromFaithPurchase[eIndex] + iChange; - CvAssert(GetYieldFromFaithPurchase(eIndex) >= 0); + ASSERT(GetYieldFromFaithPurchase(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24556,8 +24556,8 @@ void CvCity::ChangeYieldFromFaithPurchase(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromUnitLevelUp(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromUnitLevelUp[eIndex]; } @@ -24566,13 +24566,13 @@ int CvCity::GetYieldFromUnitLevelUp(YieldTypes eIndex) const void CvCity::ChangeYieldFromUnitLevelUp(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromUnitLevelUp[eIndex] = m_aiYieldFromUnitLevelUp[eIndex] + iChange; - CvAssert(GetYieldFromUnitLevelUp(eIndex) >= 0); + ASSERT(GetYieldFromUnitLevelUp(eIndex) >= 0); } } @@ -24581,8 +24581,8 @@ void CvCity::ChangeYieldFromUnitLevelUp(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromCombatExperienceTimes100(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromCombatExperienceTimes100[eIndex]; } @@ -24591,13 +24591,13 @@ int CvCity::GetYieldFromCombatExperienceTimes100(YieldTypes eIndex) const void CvCity::ChangeYieldFromCombatExperienceTimes100(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromCombatExperienceTimes100[eIndex] = m_aiYieldFromCombatExperienceTimes100[eIndex] + iChange; - CvAssert(GetYieldFromCombatExperienceTimes100(eIndex) >= 0); + ASSERT(GetYieldFromCombatExperienceTimes100(eIndex) >= 0); } } @@ -24606,8 +24606,8 @@ void CvCity::ChangeYieldFromCombatExperienceTimes100(YieldTypes eIndex, int iCha int CvCity::GetYieldPerAlly(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldPerAlly[eIndex]; } @@ -24616,13 +24616,13 @@ int CvCity::GetYieldPerAlly(YieldTypes eIndex) const void CvCity::ChangeYieldPerAlly(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldPerAlly[eIndex] = m_aiYieldPerAlly[eIndex] + iChange; - CvAssert(GetYieldPerAlly(eIndex) >= 0); + ASSERT(GetYieldPerAlly(eIndex) >= 0); } } // -------------------------------------------------------------------------------- @@ -24630,8 +24630,8 @@ void CvCity::ChangeYieldPerAlly(YieldTypes eIndex, int iChange) int CvCity::GetYieldPerFriend(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldPerFriend[eIndex]; } @@ -24640,13 +24640,13 @@ int CvCity::GetYieldPerFriend(YieldTypes eIndex) const void CvCity::ChangeYieldPerFriend(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldPerFriend[eIndex] = m_aiYieldPerFriend[eIndex] + iChange; - CvAssert(GetYieldPerFriend(eIndex) >= 0); + ASSERT(GetYieldPerFriend(eIndex) >= 0); } } @@ -24655,10 +24655,10 @@ void CvCity::ChangeYieldPerFriend(YieldTypes eIndex, int iChange) int CvCity::GetRealYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2) const { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); return ModifierLookup(m_yieldChanges[eIndex2].forActualYield, eIndex1); } @@ -24668,10 +24668,10 @@ int CvCity::GetRealYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2) const void CvCity::SetRealYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); ModifierUpdateInsertRemove(m_yieldChanges[eIndex2].forActualYield, eIndex1, iValue, false); } @@ -24680,10 +24680,10 @@ void CvCity::SetRealYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2, int i int CvCity::GetBuildingYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2) const { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return ModifierLookup(m_yieldChanges[eIndex2].forYield, eIndex1); } @@ -24693,10 +24693,10 @@ int CvCity::GetBuildingYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2) co void CvCity::ChangeBuildingYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); ModifierUpdateInsertRemove(m_yieldChanges[eIndex2].forYield, eIndex1, iValue, true); } @@ -24706,8 +24706,8 @@ void CvCity::ChangeBuildingYieldFromYield(YieldTypes eIndex1, YieldTypes eIndex2 int CvCity::GetYieldFromInternalTREnd(YieldTypes eIndex1) const { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromInternalTREnd[eIndex1]; } @@ -24717,12 +24717,12 @@ int CvCity::GetYieldFromInternalTREnd(YieldTypes eIndex1) const void CvCity::ChangeYieldFromInternalTREnd(YieldTypes eIndex1, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromInternalTREnd[eIndex1] = m_aiYieldFromInternalTREnd[eIndex1] + iChange; - CvAssert(GetYieldFromInternalTREnd(eIndex1) >= 0); + ASSERT(GetYieldFromInternalTREnd(eIndex1) >= 0); } } @@ -24731,8 +24731,8 @@ void CvCity::ChangeYieldFromInternalTREnd(YieldTypes eIndex1, int iChange) int CvCity::GetYieldFromInternalTR(YieldTypes eIndex1) const { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromInternalTR[eIndex1]; } @@ -24742,12 +24742,12 @@ int CvCity::GetYieldFromInternalTR(YieldTypes eIndex1) const void CvCity::ChangeYieldFromInternalTR(YieldTypes eIndex1, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromInternalTR[eIndex1] = m_aiYieldFromInternalTR[eIndex1] + iChange; - CvAssert(GetYieldFromInternalTR(eIndex1) >= 0); + ASSERT(GetYieldFromInternalTR(eIndex1) >= 0); } } @@ -24757,8 +24757,8 @@ void CvCity::ChangeYieldFromInternalTR(YieldTypes eIndex1, int iChange) int CvCity::GetYieldFromProcessModifier(YieldTypes eIndex1) const { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromProcessModifier[eIndex1]; } @@ -24768,12 +24768,12 @@ int CvCity::GetYieldFromProcessModifier(YieldTypes eIndex1) const void CvCity::ChangeYieldFromProcessModifier(YieldTypes eIndex1, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex1 >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromProcessModifier[eIndex1] = m_aiYieldFromProcessModifier[eIndex1] + iChange; - CvAssert(GetYieldFromProcessModifier(eIndex1) >= 0); + ASSERT(GetYieldFromProcessModifier(eIndex1) >= 0); } } @@ -24781,8 +24781,8 @@ void CvCity::ChangeYieldFromProcessModifier(YieldTypes eIndex1, int iChange) int CvCity::GetSpecialistRateModifierFromBuildings(SpecialistTypes eSpecialist) const { VALIDATE_OBJECT - CvAssertMsg(eSpecialist >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eSpecialist >= 0, "eIndex expected to be >= 0"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiSpecialistRateModifierFromBuildings[eSpecialist]; } @@ -24791,13 +24791,13 @@ int CvCity::GetSpecialistRateModifierFromBuildings(SpecialistTypes eSpecialist) void CvCity::ChangeSpecialistRateModifierFromBuildings(SpecialistTypes eSpecialist, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eSpecialist >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eSpecialist >= 0, "eIndex expected to be >= 0"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiSpecialistRateModifierFromBuildings[eSpecialist] = m_aiSpecialistRateModifierFromBuildings[eSpecialist] + iChange; - CvAssert(GetSpecialistRateModifierFromBuildings(eSpecialist) >= 0); + ASSERT(GetSpecialistRateModifierFromBuildings(eSpecialist) >= 0); } } // -------------------------------------------------------------------------------- @@ -24805,8 +24805,8 @@ void CvCity::ChangeSpecialistRateModifierFromBuildings(SpecialistTypes eSpeciali int CvCity::GetThemingYieldBonus(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiThemingYieldBonus[eIndex]; } @@ -24815,13 +24815,13 @@ int CvCity::GetThemingYieldBonus(YieldTypes eIndex) const void CvCity::ChangeThemingYieldBonus(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiThemingYieldBonus[eIndex] = m_aiThemingYieldBonus[eIndex] + iChange; - CvAssert(GetThemingYieldBonus(eIndex) >= 0); + ASSERT(GetThemingYieldBonus(eIndex) >= 0); } } @@ -24830,8 +24830,8 @@ void CvCity::ChangeThemingYieldBonus(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromSpyAttack(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromSpyAttack[eIndex]; } @@ -24840,13 +24840,13 @@ int CvCity::GetYieldFromSpyAttack(YieldTypes eIndex) const void CvCity::ChangeYieldFromSpyAttack(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromSpyAttack[eIndex] = m_aiYieldFromSpyAttack[eIndex] + iChange; - CvAssert(GetYieldFromSpyAttack(eIndex) >= 0); + ASSERT(GetYieldFromSpyAttack(eIndex) >= 0); } } @@ -24855,8 +24855,8 @@ void CvCity::ChangeYieldFromSpyAttack(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromSpyDefense(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromSpyDefense[eIndex]; } @@ -24865,13 +24865,13 @@ int CvCity::GetYieldFromSpyDefense(YieldTypes eIndex) const void CvCity::ChangeYieldFromSpyDefense(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromSpyDefense[eIndex] = m_aiYieldFromSpyDefense[eIndex] + iChange; - CvAssert(GetYieldFromSpyDefense(eIndex) >= 0); + ASSERT(GetYieldFromSpyDefense(eIndex) >= 0); } } @@ -24880,8 +24880,8 @@ void CvCity::ChangeYieldFromSpyDefense(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromSpyIdentify(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromSpyIdentify[eIndex]; } @@ -24890,13 +24890,13 @@ int CvCity::GetYieldFromSpyIdentify(YieldTypes eIndex) const void CvCity::ChangeYieldFromSpyIdentify(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromSpyIdentify[eIndex] = m_aiYieldFromSpyIdentify[eIndex] + iChange; - CvAssert(GetYieldFromSpyIdentify(eIndex) >= 0); + ASSERT(GetYieldFromSpyIdentify(eIndex) >= 0); } } @@ -24905,8 +24905,8 @@ void CvCity::ChangeYieldFromSpyIdentify(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromSpyDefenseOrID(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromSpyDefenseOrID[eIndex]; } @@ -24915,13 +24915,13 @@ int CvCity::GetYieldFromSpyDefenseOrID(YieldTypes eIndex) const void CvCity::ChangeYieldFromSpyDefenseOrID(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromSpyDefenseOrID[eIndex] = m_aiYieldFromSpyDefenseOrID[eIndex] + iChange; - CvAssert(GetYieldFromSpyDefenseOrID(eIndex) >= 0); + ASSERT(GetYieldFromSpyDefenseOrID(eIndex) >= 0); } } @@ -24930,8 +24930,8 @@ void CvCity::ChangeYieldFromSpyDefenseOrID(YieldTypes eIndex, int iChange) int CvCity::GetYieldFromSpyRigElection(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromSpyRigElection[eIndex]; } @@ -24940,13 +24940,13 @@ int CvCity::GetYieldFromSpyRigElection(YieldTypes eIndex) const void CvCity::ChangeYieldFromSpyRigElection(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldFromSpyRigElection[eIndex] = m_aiYieldFromSpyRigElection[eIndex] + iChange; - CvAssert(GetYieldFromSpyRigElection(eIndex) >= 0); + ASSERT(GetYieldFromSpyRigElection(eIndex) >= 0); } } #endif @@ -24957,11 +24957,11 @@ int CvCity::GetGreatPersonProgressFromConstruction(GreatPersonTypes eGreatPerson { VALIDATE_OBJECT - CvAssertMsg(eGreatPerson >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex expected to be < GC.getNumGreatPersonInfos()"); + ASSERT(eGreatPerson >= 0, "eIndex expected to be >= 0"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex expected to be < GC.getNumGreatPersonInfos()"); - CvAssertMsg(eEra >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eEra < GC.getNumEraInfos(), "eIndex expected to be < GC.getNumEraInfos()"); + ASSERT(eEra >= 0, "eIndex expected to be >= 0"); + ASSERT(eEra < GC.getNumEraInfos(), "eIndex expected to be < GC.getNumEraInfos()"); if (eGreatPerson != NO_GREATPERSON && eEra != NO_ERA) { @@ -24981,11 +24981,11 @@ void CvCity::ChangeGreatPersonProgressFromConstruction(GreatPersonTypes eGreatPe { VALIDATE_OBJECT - CvAssertMsg(eGreatPerson >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex expected to be < GC.getNumGreatPersonInfos()"); + ASSERT(eGreatPerson >= 0, "eIndex expected to be >= 0"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex expected to be < GC.getNumGreatPersonInfos()"); - CvAssertMsg(eEra >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eEra < GC.getNumEraInfos(), "eIndex expected to be < GC.getNumEraInfos()"); + ASSERT(eEra >= 0, "eIndex expected to be >= 0"); + ASSERT(eEra < GC.getNumEraInfos(), "eIndex expected to be < GC.getNumEraInfos()"); if (eGreatPerson != NO_GREATPERSON && eEra != NO_ERA && iChange != 0) { @@ -25132,8 +25132,8 @@ void CvCity::ChangeReligiousUnrestModifier(int iChange) int CvCity::GetBaseYieldRateFromReligion(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); int iBaseYield = m_aiBaseYieldRateFromReligion[eIndex]; @@ -25169,8 +25169,8 @@ int CvCity::GetBaseYieldRateFromReligion(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromReligion(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -25191,8 +25191,8 @@ void CvCity::ChangeBaseYieldRateFromReligion(YieldTypes eIndex, int iChange) int CvCity::GetBaseYieldRateFromCSAlliance(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); int iValue = m_aiBaseYieldRateFromCSAlliance[eIndex]; const CvPlayer& kPlayer = GET_PLAYER(getOwner()); @@ -25218,13 +25218,13 @@ int CvCity::GetBaseYieldRateFromCSAlliance(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromCSAlliance(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiBaseYieldRateFromCSAlliance[eIndex] += iChange; - CvAssert(GetBaseYieldRateFromCSAlliance(eIndex) >= 0); + ASSERT(GetBaseYieldRateFromCSAlliance(eIndex) >= 0); } } void CvCity::SetBaseYieldRateFromCSAlliance(YieldTypes eIndex, int iValue) @@ -25239,8 +25239,8 @@ void CvCity::SetBaseYieldRateFromCSAlliance(YieldTypes eIndex, int iValue) int CvCity::GetBaseYieldRateFromCSFriendship(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); int iValue = m_aiBaseYieldRateFromCSFriendship[eIndex]; const CvPlayer& kPlayer = GET_PLAYER(getOwner()); @@ -25265,13 +25265,13 @@ int CvCity::GetBaseYieldRateFromCSFriendship(YieldTypes eIndex) const void CvCity::ChangeBaseYieldRateFromCSFriendship(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiBaseYieldRateFromCSFriendship[eIndex] += iChange; - CvAssert(GetBaseYieldRateFromCSFriendship(eIndex) >= 0); + ASSERT(GetBaseYieldRateFromCSFriendship(eIndex) >= 0); } } void CvCity::SetBaseYieldRateFromCSFriendship(YieldTypes eIndex, int iValue) @@ -25296,8 +25296,8 @@ int CvCity::GetYieldFromMinors(YieldTypes eYield) const int CvCity::GetTradeRouteCityMod(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); CorporationTypes eCorporation = GET_PLAYER(getOwner()).GetCorporations()->GetFoundedCorporation(); if (eCorporation == NO_CORPORATION) @@ -25440,11 +25440,11 @@ int CvCity::GetBuildingYieldChangeFromCorporationFranchises(BuildingClassTypes e { VALIDATE_OBJECT - CvAssertMsg(eBuildingClass >= 0, "eBuildingClass expected to be greater or equal to 0"); - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); + ASSERT(eBuildingClass >= 0, "eBuildingClass expected to be greater or equal to 0"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); CvPlayer& kPlayer = GET_PLAYER(getOwner()); @@ -25472,8 +25472,8 @@ void CvCity::SetYieldChangeFromCorporationFranchises(YieldTypes eIndex, int iTot int CvCity::GetYieldChangeFromCorporationFranchises(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldChangeFromCorporationFranchises[eIndex]; } @@ -25495,21 +25495,21 @@ void CvCity::UpdateYieldFromCorporationFranchises(YieldTypes eIndex) int CvCity::GetResourceQuantityPerXFranchises(ResourceTypes eResource) const { VALIDATE_OBJECT - CvAssertMsg(eResource >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); + ASSERT(eResource >= 0, "eIndex expected to be >= 0"); + ASSERT(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); return m_aiResourceQuantityPerXFranchises[eResource]; } // -------------------------------------------------------------------------------- void CvCity::ChangeResourceQuantityPerXFranchises(ResourceTypes eResource, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eResource >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); + ASSERT(eResource >= 0, "eIndex expected to be >= 0"); + ASSERT(eResource < GC.getNumResourceInfos(), "eIndex expected to be < GC.getNumResourceInfos()"); if (iChange != 0) { m_aiResourceQuantityPerXFranchises[eResource] = m_aiResourceQuantityPerXFranchises[eResource] + iChange; - // CvAssert(GetCorporationResourceQuantity(eResource) >= 0); + // ASSERT(GetCorporationResourceQuantity(eResource) >= 0); } } void CvCity::SetResourceQuantityPerXFranchises(ResourceTypes eResource, int iValue) @@ -25819,8 +25819,8 @@ int CvCity::getNukeInterceptionChance() const void CvCity::SetPurchased(BuildingClassTypes eBuildingClass, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eBuildingClass >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "eIndex expected to be < MAX_PLAYERS"); + ASSERT(eBuildingClass >= 0, "eIndex expected to be >= 0"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "eIndex expected to be < MAX_PLAYERS"); if (m_abIsPurchased[eBuildingClass] != bValue) { m_abIsPurchased[eBuildingClass] = bValue; @@ -25829,15 +25829,15 @@ void CvCity::SetPurchased(BuildingClassTypes eBuildingClass, bool bValue) bool CvCity::IsPurchased(BuildingClassTypes eBuildingClass) { VALIDATE_OBJECT - CvAssertMsg(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); + ASSERT(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); return m_abIsPurchased[eBuildingClass]; } void CvCity::SetBestForWonder(BuildingClassTypes eBuildingClass, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); + ASSERT(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); if (m_abIsBestForWonder[eBuildingClass] != bValue) { m_abIsBestForWonder[eBuildingClass] = bValue; @@ -25846,8 +25846,8 @@ void CvCity::SetBestForWonder(BuildingClassTypes eBuildingClass, bool bValue) bool CvCity::IsBestForWonder(BuildingClassTypes eBuildingClass) { VALIDATE_OBJECT - CvAssertMsg(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); + ASSERT(eBuildingClass >= 0, "eBuildingClass expected to be >= 0"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "eBuildingClass expected to be < GC.getNumBuildingClassInfos()"); return m_abIsBestForWonder[eBuildingClass]; } @@ -25857,8 +25857,8 @@ bool CvCity::IsBestForWonder(BuildingClassTypes eBuildingClass) int CvCity::GetYieldPerPopTimes100(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldPerPop[eIndex]; } @@ -25868,8 +25868,8 @@ int CvCity::GetYieldPerPopTimes100(YieldTypes eIndex) const void CvCity::ChangeYieldPerPopTimes100(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) m_aiYieldPerPop[eIndex] = m_aiYieldPerPop[eIndex] + iChange; @@ -25881,8 +25881,8 @@ void CvCity::ChangeYieldPerPopTimes100(YieldTypes eIndex, int iChange) int CvCity::GetYieldPerPopInEmpireTimes100(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); std::map::const_iterator it = m_aiYieldPerPopInEmpire.find((int)eIndex); if (it != m_aiYieldPerPopInEmpire.end()) // find returns the iterator to map::end if the key i is not present in the map @@ -25898,8 +25898,8 @@ int CvCity::GetYieldPerPopInEmpireTimes100(YieldTypes eIndex) const void CvCity::ChangeYieldPerPopInEmpireTimes100(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) m_aiYieldPerPopInEmpire[(int)eIndex] += iChange; @@ -25911,8 +25911,8 @@ void CvCity::ChangeYieldPerPopInEmpireTimes100(YieldTypes eIndex, int iChange) int CvCity::GetYieldPerReligionTimes100(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldPerReligion[eIndex]; } @@ -25922,8 +25922,8 @@ int CvCity::GetYieldPerReligionTimes100(YieldTypes eIndex) const void CvCity::ChangeYieldPerReligionTimes100(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -25935,8 +25935,8 @@ void CvCity::ChangeYieldPerReligionTimes100(YieldTypes eIndex, int iChange) int CvCity::getYieldRateModifier(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldRateModifier[eIndex]; } @@ -25945,8 +25945,8 @@ int CvCity::getYieldRateModifier(YieldTypes eIndex) const void CvCity::changeYieldRateModifier(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiYieldRateModifier[eIndex] += iChange; @@ -25986,8 +25986,8 @@ void CvCity::changeLocalBuildingClassYield(BuildingClassTypes eBuilding, YieldTy int CvCity::GetGreatWorkYieldChange(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiGreatWorkYieldChange[eIndex]; } @@ -25996,8 +25996,8 @@ int CvCity::GetGreatWorkYieldChange(YieldTypes eIndex) const void CvCity::ChangeGreatWorkYieldChange(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -26010,8 +26010,8 @@ void CvCity::ChangeGreatWorkYieldChange(YieldTypes eIndex, int iChange) int CvCity::getResourceYieldRateModifier(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiResourceYieldRateModifier[eIndex]; } @@ -26020,13 +26020,13 @@ int CvCity::getResourceYieldRateModifier(YieldTypes eIndex) const void CvCity::changeResourceYieldRateModifier(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiResourceYieldRateModifier[eIndex] = m_aiResourceYieldRateModifier[eIndex] + iChange; - CvAssert(getYieldRate(eIndex, false) >= 0); + ASSERT(getYieldRate(eIndex, false) >= 0); GET_PLAYER(getOwner()).invalidateYieldRankCache(eIndex); } @@ -26037,8 +26037,8 @@ void CvCity::changeResourceYieldRateModifier(YieldTypes eIndex, int iChange) int CvCity::getExtraSpecialistYield(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiExtraSpecialistYield[eIndex]; } @@ -26047,10 +26047,10 @@ int CvCity::getExtraSpecialistYield(YieldTypes eIndex) const int CvCity::getExtraSpecialistYield(YieldTypes eIndex, SpecialistTypes eSpecialist) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); - CvAssertMsg(eSpecialist >= 0, "eSpecialist expected to be >= 0"); - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "GC.getNumSpecialistInfos expected to be >= 0"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eSpecialist >= 0, "eSpecialist expected to be >= 0"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "GC.getNumSpecialistInfos expected to be >= 0"); int iYieldMultiplier = 0; @@ -26114,8 +26114,8 @@ int CvCity::getExtraSpecialistYield(YieldTypes eIndex, SpecialistTypes eSpeciali void CvCity::updateExtraSpecialistYield(YieldTypes eYield) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); int iOldYield = getExtraSpecialistYield(eYield); int iNewYield = 0; @@ -26129,7 +26129,7 @@ void CvCity::updateExtraSpecialistYield(YieldTypes eYield) if (iOldYield != iNewYield) { m_aiExtraSpecialistYield[eYield] = iNewYield; - CvAssert(getExtraSpecialistYield(eYield) >= 0); + ASSERT(getExtraSpecialistYield(eYield) >= 0); ChangeBaseYieldRateFromSpecialists(eYield, (iNewYield - iOldYield)); } @@ -26151,8 +26151,8 @@ void CvCity::updateExtraSpecialistYield() int CvCity::getProductionToYieldModifier(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiProductionToYieldModifier[eIndex]; } @@ -26161,8 +26161,8 @@ int CvCity::getProductionToYieldModifier(YieldTypes eIndex) const void CvCity::changeProductionToYieldModifier(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -26224,8 +26224,8 @@ int CvCity::GetTradeYieldModifier(YieldTypes eIndex, CvString* toolTipSink) cons int CvCity::getDomainFreeExperience(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); return m_aiDomainFreeExperience[eIndex]; } @@ -26234,10 +26234,10 @@ int CvCity::getDomainFreeExperience(DomainTypes eIndex) const void CvCity::changeDomainFreeExperience(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); m_aiDomainFreeExperience[eIndex] = m_aiDomainFreeExperience[eIndex] + iChange; - CvAssert(getDomainFreeExperience(eIndex) >= 0); + ASSERT(getDomainFreeExperience(eIndex) >= 0); } @@ -26245,8 +26245,8 @@ void CvCity::changeDomainFreeExperience(DomainTypes eIndex, int iChange) int CvCity::getDomainFreeExperienceFromGreatWorks(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); int iXP = 0; @@ -26271,8 +26271,8 @@ int CvCity::getDomainFreeExperienceFromGreatWorks(DomainTypes eIndex) const int CvCity::getDomainFreeExperienceFromGreatWorksGlobal(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); int iMod = GET_PLAYER(getOwner()).GetDomainFreeExperiencePerGreatWorkGlobal(eIndex); if (iMod <= 0) @@ -26305,8 +26305,8 @@ int CvCity::getDomainFreeExperienceFromGreatWorksGlobal(DomainTypes eIndex) cons int CvCity::getDomainProductionModifier(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); return m_aiDomainProductionModifier[eIndex]; } @@ -26315,8 +26315,8 @@ int CvCity::getDomainProductionModifier(DomainTypes eIndex) const void CvCity::changeDomainProductionModifier(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); m_aiDomainProductionModifier[eIndex] = m_aiDomainProductionModifier[eIndex] + iChange; } @@ -26325,8 +26325,8 @@ void CvCity::changeDomainProductionModifier(DomainTypes eIndex, int iChange) bool CvCity::isEverLiberated(PlayerTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); return m_abEverLiberated[eIndex]; } @@ -26335,8 +26335,8 @@ bool CvCity::isEverLiberated(PlayerTypes eIndex) const void CvCity::setEverLiberated(PlayerTypes eIndex, bool bNewValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < MAX_PLAYERS, "eIndex expected to be < MAX_PLAYERS"); m_abEverLiberated[eIndex] = bNewValue; } @@ -26495,8 +26495,8 @@ void CvCity::ChangeExtraLuxuryResources(int iChange) int CvCity::getProjectProduction(ProjectTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); return m_paiProjectProduction[eIndex] / 100; } @@ -26520,8 +26520,8 @@ void CvCity::changeProjectProduction(ProjectTypes eIndex, int iChange) int CvCity::getProjectProductionTimes100(ProjectTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); return m_paiProjectProduction[eIndex]; } @@ -26530,13 +26530,13 @@ int CvCity::getProjectProductionTimes100(ProjectTypes eIndex) const void CvCity::setProjectProductionTimes100(ProjectTypes eIndex, int iNewValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); if (getProjectProductionTimes100(eIndex) != iNewValue) { m_paiProjectProduction[eIndex] = max(0, iNewValue); - CvAssert(getProjectProductionTimes100(eIndex) >= 0); + ASSERT(getProjectProductionTimes100(eIndex) >= 0); if ((getOwner() == GC.getGame().getActivePlayer()) && isCitySelected()) { @@ -26553,8 +26553,8 @@ void CvCity::setProjectProductionTimes100(ProjectTypes eIndex, int iNewValue) void CvCity::changeProjectProductionTimes100(ProjectTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex expected to be < GC.getNumProjectInfos()"); setProjectProductionTimes100(eIndex, (getProjectProductionTimes100(eIndex) + iChange)); } @@ -26569,8 +26569,8 @@ int CvCity::getProcessProduction(ProcessTypes eIndex) const int CvCity::getProcessProductionTimes100(ProcessTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumProcessInfos(), "eIndex expected to be < GC.getNumProcessInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumProcessInfos(), "eIndex expected to be < GC.getNumProcessInfos()"); if (eIndex == GC.getInfoTypeForString("PROCESS_STOCKPILE" , true)) { @@ -26592,8 +26592,8 @@ CvCityBuildings* CvCity::GetCityBuildings() const int CvCity::getUnitProduction(UnitTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); return m_paiUnitProduction[eIndex] / 100; } @@ -26618,8 +26618,8 @@ void CvCity::changeUnitProduction(UnitTypes eIndex, int iChange) int CvCity::getUnitProductionTimes100(UnitTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); return m_paiUnitProduction[eIndex]; } @@ -26628,13 +26628,13 @@ int CvCity::getUnitProductionTimes100(UnitTypes eIndex) const void CvCity::setUnitProductionTimes100(UnitTypes eIndex, int iNewValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); if (getUnitProductionTimes100(eIndex) != iNewValue) { m_paiUnitProduction[eIndex] = max(0, iNewValue); - CvAssert(getUnitProductionTimes100(eIndex) >= 0); + ASSERT(getUnitProductionTimes100(eIndex) >= 0); if ((getOwner() == GC.getGame().getActivePlayer()) && isCitySelected()) { @@ -26659,8 +26659,8 @@ void CvCity::changeUnitProductionTimes100(UnitTypes eIndex, int iChange) int CvCity::getUnitProductionTime(UnitTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); return m_paiUnitProductionTime[eIndex]; } @@ -26669,10 +26669,10 @@ int CvCity::getUnitProductionTime(UnitTypes eIndex) const void CvCity::setUnitProductionTime(UnitTypes eIndex, int iNewValue) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()"); m_paiUnitProductionTime[eIndex] = iNewValue; - CvAssert(getUnitProductionTime(eIndex) >= 0); + ASSERT(getUnitProductionTime(eIndex) >= 0); } @@ -26688,8 +26688,8 @@ void CvCity::changeUnitProductionTime(UnitTypes eIndex, int iChange) int CvCity::getUnitCombatFreeExperience(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); return m_paiUnitCombatFreeExperience[eIndex]; } @@ -26698,10 +26698,10 @@ int CvCity::getUnitCombatFreeExperience(UnitCombatTypes eIndex) const void CvCity::changeUnitCombatFreeExperience(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); m_paiUnitCombatFreeExperience[eIndex] = m_paiUnitCombatFreeExperience[eIndex] + iChange; - CvAssert(getUnitCombatFreeExperience(eIndex) >= 0); + ASSERT(getUnitCombatFreeExperience(eIndex) >= 0); } @@ -26709,8 +26709,8 @@ void CvCity::changeUnitCombatFreeExperience(UnitCombatTypes eIndex, int iChange) int CvCity::getUnitCombatProductionModifier(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); return m_paiUnitCombatProductionModifier[eIndex]; } @@ -26719,10 +26719,10 @@ int CvCity::getUnitCombatProductionModifier(UnitCombatTypes eIndex) const void CvCity::changeUnitCombatProductionModifier(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex expected to be < GC.getNumUnitCombatInfos()"); m_paiUnitCombatProductionModifier[eIndex] = m_paiUnitCombatProductionModifier[eIndex] + iChange; - CvAssert(getUnitCombatProductionModifier(eIndex) >= 0); + ASSERT(getUnitCombatProductionModifier(eIndex) >= 0); } @@ -26730,8 +26730,8 @@ void CvCity::changeUnitCombatProductionModifier(UnitCombatTypes eIndex, int iCha int CvCity::getFreePromotionCount(PromotionTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); if (m_paiFreePromotionCount.find(eIndex) != m_paiFreePromotionCount.end()) return m_paiFreePromotionCount.find(eIndex)->second; @@ -26770,8 +26770,8 @@ vector CvCity::getFreePromotions() const void CvCity::changeFreePromotionCount(PromotionTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); m_paiFreePromotionCount[eIndex] += iChange; if (m_paiFreePromotionCount[eIndex] == 0) @@ -26781,8 +26781,8 @@ void CvCity::changeFreePromotionCount(PromotionTypes eIndex, int iChange) // -------------------------------------------------------------------------------- void CvCity::SetRetroactivePromotion(PromotionTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()"); if (eIndex != NO_PROMOTION) { @@ -26827,7 +26827,7 @@ void CvCity::changeSpecialistFreeExperience(int iChange) { VALIDATE_OBJECT m_iSpecialistFreeExperience += iChange; - CvAssert(m_iSpecialistFreeExperience >= 0); + ASSERT(m_iSpecialistFreeExperience >= 0); } // -------------------------------------------------------------------------------- @@ -27221,8 +27221,8 @@ void CvCity::changeDamage(int iChange) int CvCity::GetDamagePermyriad(PlayerTypes ePlayer) const { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "ePlayer expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); return m_aiDamagePermyriad[ePlayer]; } @@ -27230,8 +27230,8 @@ int CvCity::GetDamagePermyriad(PlayerTypes ePlayer) const void CvCity::ChangeDamagePermyriad(PlayerTypes ePlayer, int iChange) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "ePlayer expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); m_aiDamagePermyriad[ePlayer] += iChange; } @@ -27239,8 +27239,8 @@ void CvCity::ChangeDamagePermyriad(PlayerTypes ePlayer, int iChange) void CvCity::SetDamagePermyriad(PlayerTypes ePlayer, int iValue) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); + ASSERT(ePlayer >= 0, "ePlayer expected to be >= 0"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer expected to be < MAX_PLAYERS"); m_aiDamagePermyriad[ePlayer] = iValue; } @@ -28432,7 +28432,7 @@ int CvCity::GetIndividualPlotScore(const CvPlot* pPlot) const } // Protect against div by 0. - CvAssertMsg(iCost != 0, "Plot cost is 0"); + ASSERT(iCost != 0, "Plot cost is 0"); if (iCost != 0) iRtnValue /= iCost; else @@ -28455,7 +28455,7 @@ void CvCity::SetCheapestPlotInfluenceDistance(int iValue) if (m_iCheapestPlotInfluenceDistance != iValue) m_iCheapestPlotInfluenceDistance = iValue; - CvAssertMsg(m_iCheapestPlotInfluenceDistance > 0, "Cheapest plot influence should never be 0 or less."); + ASSERT(m_iCheapestPlotInfluenceDistance > 0, "Cheapest plot influence should never be 0 or less."); } // -------------------------------------------------------------------------------- @@ -28618,7 +28618,7 @@ void CvCity::pushOrder(OrderTypes eOrder, int iData1, int iData2, bool bSave, bo break; default: - CvAssertMsg(false, "iOrder did not match a valid option"); + ASSERT(false, "iOrder did not match a valid option"); break; } @@ -28746,8 +28746,8 @@ void CvCity::popOrder(int iNum, bool bFinish, bool bChoose) case ORDER_TRAIN: eTrainUnit = ((UnitTypes)(pOrderNode->iData1)); eTrainAIUnit = ((UnitAITypes)(pOrderNode->iData2)); - CvAssertMsg(eTrainUnit != NO_UNIT, "eTrainUnit is expected to be assigned a valid unit type"); - CvAssertMsg(eTrainAIUnit != NO_UNITAI, "eTrainAIUnit is expected to be assigned a valid unit AI type"); + ASSERT(eTrainUnit != NO_UNIT, "eTrainUnit is expected to be assigned a valid unit type"); + ASSERT(eTrainAIUnit != NO_UNITAI, "eTrainAIUnit is expected to be assigned a valid unit AI type"); kOwner.changeUnitClassMaking(((UnitClassTypes)(GC.getUnitInfo(eTrainUnit)->GetUnitClassType())), -1); @@ -28801,7 +28801,7 @@ void CvCity::popOrder(int iNum, bool bFinish, bool bChoose) break; default: - CvAssertMsg(false, "pOrderNode->eOrderType is not a valid option"); + ASSERT(false, "pOrderNode->eOrderType is not a valid option"); break; } @@ -29249,7 +29249,7 @@ void CvCity::produce(BuildingTypes eConstructBuilding, bool bCanOverflow) int iProductionNeeded = getProductionNeeded(eConstructBuilding) * 100; bool bResult = CreateBuilding(eConstructBuilding); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "CreateBuilding failed"); + ASSERT(bResult, "CreateBuilding failed"); #if defined(MOD_EVENTS_CITY) if (MOD_EVENTS_CITY) { @@ -29328,7 +29328,7 @@ void CvCity::produce(ProjectTypes eCreateProject, bool bCanOverflow) bool bResult = CreateProject(eCreateProject); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "Failed to create project"); + ASSERT(bResult, "Failed to create project"); #if defined(MOD_EVENTS_CITY) if (MOD_EVENTS_CITY) { @@ -29668,16 +29668,16 @@ bool CvCity::CreateProject(ProjectTypes eProjectType) void CvCity::changeProjectCount(ProjectTypes eProject, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eProject >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(eProject < GC.getNumProjectInfos(), "ePlayer expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eProject >= 0, "ePlayer expected to be >= 0"); + ASSERT(eProject < GC.getNumProjectInfos(), "ePlayer expected to be < NUM_DOMAIN_TYPES"); m_aiNumProjects[eProject] = m_aiNumProjects[eProject] + iValue; } int CvCity::getProjectCount(ProjectTypes eProject) const { VALIDATE_OBJECT - CvAssertMsg(eProject >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(eProject < GC.getNumProjectInfos(), "ePlayer expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eProject >= 0, "ePlayer expected to be >= 0"); + ASSERT(eProject < GC.getNumProjectInfos(), "ePlayer expected to be < NUM_DOMAIN_TYPES"); return m_aiNumProjects[eProject]; } @@ -29821,8 +29821,8 @@ bool CvCity::IsCanPurchase(bool bTestPurchaseCost, bool bTestTrainable, UnitType bool CvCity::IsCanPurchase(const std::vector& vPreExistingBuildings, bool bTestPurchaseCost, bool bTestTrainable, UnitTypes eUnitType, BuildingTypes eBuildingType, ProjectTypes eProjectType, YieldTypes ePurchaseYield) { - CvAssertMsg(eUnitType >= 0 || eBuildingType >= 0 || eProjectType >= 0, "No valid passed in"); - CvAssertMsg(!(eUnitType >= 0 && eBuildingType >= 0) && !(eUnitType >= 0 && eProjectType >= 0) && !(eBuildingType >= 0 && eProjectType >= 0), "Only one being passed"); + ASSERT(eUnitType >= 0 || eBuildingType >= 0 || eProjectType >= 0, "No valid passed in"); + ASSERT(!(eUnitType >= 0 && eBuildingType >= 0) && !(eUnitType >= 0 && eProjectType >= 0) && !(eBuildingType >= 0 && eProjectType >= 0), "Only one being passed"); // Can't purchase anything in a puppeted city // slewis - The Venetian Exception @@ -30273,7 +30273,7 @@ bool CvCity::IsCanPurchase(const std::vector& vPreExistingBuildings, bool b default: // This function is accessible from Lua scripts so it's incorrect to assume this is unreachable unless we make the Lua function // throw errors for non-gold/faith inputs. - CvAssertMsg(false, "CvCity::IsCanPurchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); + ASSERT(false, "CvCity::IsCanPurchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); return false; } @@ -30517,7 +30517,7 @@ CvUnit* CvCity::PurchaseUnit(UnitTypes eUnitType, YieldTypes ePurchaseYield) } default: // This function is accessible from Lua scripts and network callbacks so it's incorrect to assume this is unreachable. - CvAssertMsg(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); + ASSERT(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); return NULL; } @@ -30710,7 +30710,7 @@ bool CvCity::PurchaseBuilding(BuildingTypes eBuildingType, YieldTypes ePurchaseY } default: // This function is accessible from Lua scripts and network callbacks so it's incorrect to assume this is unreachable. - CvAssertMsg(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); + ASSERT(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); return false; } @@ -30764,7 +30764,7 @@ bool CvCity::PurchaseProject(ProjectTypes eProjectType, YieldTypes ePurchaseYiel } default: // This function is accessible from Lua scripts and network callbacks so it's incorrect to assume this is unreachable. - CvAssertMsg(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); + ASSERT(false, "CvCity::Purchase expects either YIELD_GOLD or YIELD_FAITH as ePurchaseYield"); return false; } @@ -31071,7 +31071,7 @@ bool CvCity::doCheckProduction() if (eUpgradeUnit != NO_UNIT) { - CvAssertMsg(eUpgradeUnit != iI, "Trying to upgrade a Unit to itself"); + ASSERT(eUpgradeUnit != iI, "Trying to upgrade a Unit to itself"); iUpgradeProduction = getUnitProduction((UnitTypes)iI); setUnitProduction(((UnitTypes)iI), 0); setUnitProduction(eUpgradeUnit, iUpgradeProduction); @@ -31113,7 +31113,7 @@ bool CvCity::doCheckProduction() if (canConstruct(eUpgradeBuilding)) { - CvAssertMsg(eUpgradeBuilding != iI, "Trying to upgrade a Building to itself"); + ASSERT(eUpgradeBuilding != iI, "Trying to upgrade a Building to itself"); iUpgradeProduction = m_pCityBuildings->GetBuildingProduction(eBuilding); m_pCityBuildings->SetBuildingProduction((eBuilding), 0); m_pCityBuildings->SetBuildingProduction(eUpgradeBuilding, iUpgradeProduction); @@ -31282,7 +31282,7 @@ void CvCity::doProduction(bool bAllowNoProduction) void CvCity::doProcess() { ProcessTypes eProcess = getProductionProcess(); - CvAssertMsg(eProcess != NO_PROCESS, "Invalid Process for city production. Please send Anton your save file and version."); + ASSERT(eProcess != NO_PROCESS, "Invalid Process for city production."); if (eProcess == NO_PROCESS) return; #if defined(MOD_PROCESS_STOCKPILE) @@ -31809,7 +31809,7 @@ void CvCity::Serialize(City& city, Visitor& visitor) break; default: - CvAssertMsg(false, "order.eOrderType failed to match a valid option"); + ASSERT(false, "order.eOrderType failed to match a valid option"); visitor(order.iData1); visitor(order.iData2); break; @@ -31843,7 +31843,7 @@ void CvCity::Serialize(City& city, Visitor& visitor) break; } - CvAssertMsg(bIsValid, "Unit in build queue is invalid"); + ASSERT(bIsValid, "Unit in build queue is invalid"); if (bIsValid) city.m_orderQueue.insertAtEnd(&order); } @@ -32092,7 +32092,7 @@ void CvCity::invalidatePopulationRankCache() void CvCity::invalidateYieldRankCache(YieldTypes eYield) { VALIDATE_OBJECT - CvAssertMsg(eYield >= NO_YIELD && eYield < NUM_YIELD_TYPES, "invalidateYieldRankCache passed bogus yield index"); + ASSERT(eYield >= NO_YIELD && eYield < NUM_YIELD_TYPES, "invalidateYieldRankCache passed bogus yield index"); if (eYield == NO_YIELD) { @@ -32126,15 +32126,15 @@ void CvCity::setMadeAttack(bool bNewValue) void CvCity::ChangeNumTimesAttackedThisTurn(PlayerTypes ePlayer, int iValue) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "ePlayer expected to be < NUM_DOMAIN_TYPES"); + ASSERT(ePlayer >= 0, "ePlayer expected to be >= 0"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "ePlayer expected to be < NUM_DOMAIN_TYPES"); m_aiNumTimesAttackedThisTurn[ePlayer] = m_aiNumTimesAttackedThisTurn[ePlayer] + iValue; } int CvCity::GetNumTimesAttackedThisTurn(PlayerTypes ePlayer) const { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "eIndex expected to be < NUM_DOMAIN_TYPES"); return m_aiNumTimesAttackedThisTurn[ePlayer]; } @@ -33400,7 +33400,7 @@ void CvCity::ChangeExtraHitPoints(int iValue) if (iValue != 0) { m_iExtraHitPoints += iValue; - FAssertMsg(m_iExtraHitPoints >= 0, "Trying to set ExtraHitPoints to a negative value"); + ASSERT(m_iExtraHitPoints >= 0, "Trying to set ExtraHitPoints to a negative value"); if (m_iExtraHitPoints < 0) m_iExtraHitPoints = 0; @@ -33471,8 +33471,8 @@ void CvCity::setCombatUnit(CvUnit* pCombatUnit, bool /*bAttacking*/) { if (pCombatUnit != NULL) { - CvAssertMsg(getCombatUnit() == NULL, "Combat Unit is not expected to be assigned"); - CvAssertMsg(!(plot()->isCityFighting()), "(plot()->isCityFighting()) did not return false as expected"); + ASSERT(getCombatUnit() == NULL, "Combat Unit is not expected to be assigned"); + ASSERT(!(plot()->isCityFighting()), "(plot()->isCityFighting()) did not return false as expected"); m_combatUnit = pCombatUnit->GetIDInfo(); } else @@ -33486,7 +33486,7 @@ void CvCity::clearCombat() { if (getCombatUnit() != NULL) { - CvAssertMsg(plot()->isCityFighting(), "plot()->isCityFighting is expected to be true"); + ASSERT(plot()->isCityFighting(), "plot()->isCityFighting is expected to be true"); m_combatUnit.reset(); } } @@ -34801,8 +34801,8 @@ void CvCity::SetYieldModifierFromHappiness(YieldTypes eYield, int iValue) int CvCity::GetYieldModifierFromHappiness(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); return m_aiYieldModifierFromHappiness[eYield]; } @@ -34887,8 +34887,8 @@ void CvCity::SetYieldFromCrime(YieldTypes eYield, int iValue) int CvCity::GetYieldFromCrime(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromCrime[eYield]; } @@ -34904,8 +34904,8 @@ void CvCity::SetYieldFromDevelopment(YieldTypes eYield, int iValue) int CvCity::GetYieldFromDevelopment(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromDevelopment[eYield]; } @@ -35090,7 +35090,7 @@ int CvCity::SpawnPlayerUnitsNearby(const PlayerTypes ePlayer, const int iNumber, CvUnit* pUnit = kPlayer.initUnit(eUnit, pBestPlot->getX(), pBestPlot->getY()); if (!pUnit->jumpToNearestValidPlotWithinRange(3)) { - CvAssertMsg(false, "This really shouldn't happen after all those checks"); + ASSERT(false, "This really shouldn't happen after all those checks"); pUnit->kill(false); } else @@ -35109,7 +35109,7 @@ int CvCity::SpawnPlayerUnitsNearby(const PlayerTypes ePlayer, const int iNumber, // If existing number of free buildings > iValue, simply remove free buildings bool CvCity::SetNumFreeBuilding(const BuildingTypes eBuilding, const int iValue, const bool bRefund, const bool bValidate) { - CvAssert(eBuilding != NO_BUILDING); + ASSERT(eBuilding != NO_BUILDING); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); if (!pkBuildingInfo) diff --git a/CvGameCoreDLL_Expansion2/CvCityCitizens.cpp b/CvGameCoreDLL_Expansion2/CvCityCitizens.cpp index b71585c24c..ef7cfe90a4 100644 --- a/CvGameCoreDLL_Expansion2/CvCityCitizens.cpp +++ b/CvGameCoreDLL_Expansion2/CvCityCitizens.cpp @@ -84,7 +84,7 @@ void CvCityCitizens::Reset() int iI = 0; m_vWorkedPlots.clear(); - CvAssertMsg((0 < MAX_CITY_PLOTS), "MAX_CITY_PLOTS is not greater than zero but an array is being allocated in CvCityCitizens::reset"); + ASSERT((0 < MAX_CITY_PLOTS), "MAX_CITY_PLOTS is not greater than zero but an array is being allocated in CvCityCitizens::reset"); for (iI = 0; iI < MAX_CITY_PLOTS; iI++) { m_pabWorkingPlot[iI] = false; @@ -383,14 +383,14 @@ void CvCityCitizens::DoTurn() } } - CvAssertMsg((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); + ASSERT((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); DoReallocateCitizens(bForceCheck); } - CvAssertMsg((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); + ASSERT((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); DoSpecialists(); - CvAssertMsg((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); + ASSERT((GetNumCitizensWorkingPlots() + GetTotalSpecialistCount() + GetNumUnassignedCitizens()) <= GetCity()->getPopulation(true), "Gameplay: More workers than population in the city."); } int CvCityCitizens::GetBonusPlotValue(CvPlot* pPlot, YieldTypes eYield, SPrecomputedExpensiveNumbers& cache) @@ -1418,7 +1418,7 @@ int CvCityCitizens::GetNumUnassignedCitizens() const void CvCityCitizens::ChangeNumUnassignedCitizens(int iChange) { m_iNumUnassignedCitizens += iChange; - CvAssertMsg(m_iNumUnassignedCitizens >= 0, "invalid number of unassigned citizens in CvCityCitizens::ChangeNumUnassignedCitizens!"); + ASSERT(m_iNumUnassignedCitizens >= 0, "invalid number of unassigned citizens in CvCityCitizens::ChangeNumUnassignedCitizens!"); } /// How many Citizens are working Plots? @@ -2303,7 +2303,7 @@ void CvCityCitizens::SetWorkingPlot(CvPlot* pPlot, bool bNewValue, CvCity::eUpda int iIndex = GetCityIndexFromPlot(pPlot); - CvAssertMsg(iIndex >= 0, "iIndex expected to be >= 0"); + ASSERT(iIndex >= 0, "iIndex expected to be >= 0"); int iPlotNum = GC.getMap().plotNum(pPlot->getX(), pPlot->getY()); std::vector::iterator it = std::find(m_vWorkedPlots.begin(), m_vWorkedPlots.end(), iPlotNum); @@ -2319,7 +2319,7 @@ void CvCityCitizens::SetWorkingPlot(CvPlot* pPlot, bool bNewValue, CvCity::eUpda m_vWorkedPlots.erase(it); } - CvAssertMsg(iIndex < GetCity()->GetNumWorkablePlots(), "iIndex expected to be < NUM_CITY_PLOTS"); + ASSERT(iIndex < GetCity()->GetNumWorkablePlots(), "iIndex expected to be < NUM_CITY_PLOTS"); if (IsWorkingPlot(pPlot) != bNewValue && iIndex >= 0 && iIndex < GetCity()->GetNumWorkablePlots()) { @@ -2566,8 +2566,8 @@ void CvCityCitizens::SetForcedWorkingPlot(CvPlot* pPlot, bool bNewValue) { int iIndex = GetCityIndexFromPlot(pPlot); - CvAssertMsg(iIndex >= 0, "iIndex expected to be >= 0"); - CvAssertMsg(iIndex < GetCity()->GetNumWorkablePlots(), "iIndex expected to be < NUM_CITY_PLOTS"); + ASSERT(iIndex >= 0, "iIndex expected to be >= 0"); + ASSERT(iIndex < GetCity()->GetNumWorkablePlots(), "iIndex expected to be < NUM_CITY_PLOTS"); if (IsForcedWorkingPlot(pPlot) != bNewValue && iIndex >= 0 && iIndex < GetCity()->GetNumWorkablePlots()) { @@ -2999,8 +2999,8 @@ int CvCityCitizens::GetNumSpecialistsAllowedByBuilding(const CvBuildingEntry& kB /// Are we in the position to add another Specialist to eBuilding? bool CvCityCitizens::IsCanAddSpecialistToBuilding(BuildingTypes eBuilding) { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); if (m_pCity->IsResistance() || m_pCity->IsRazing()) return false; @@ -3020,8 +3020,8 @@ bool CvCityCitizens::IsCanAddSpecialistToBuilding(BuildingTypes eBuilding) /// Adds and initializes a Specialist for this building void CvCityCitizens::DoAddSpecialistToBuilding(BuildingTypes eBuilding, bool bForced, CvCity::eUpdateMode updateMode) { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); //no building means laborer if (eBuilding == NO_BUILDING) @@ -3097,8 +3097,8 @@ void CvCityCitizens::DoAddSpecialistToBuilding(BuildingTypes eBuilding, bool bFo /// Removes and uninitializes a Specialist for this building void CvCityCitizens::DoRemoveSpecialistFromBuilding(BuildingTypes eBuilding, bool bForced, CvCity::eUpdateMode updateMode) { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); if (pkBuildingInfo == NULL) @@ -3162,8 +3162,8 @@ void CvCityCitizens::DoRemoveSpecialistFromBuilding(BuildingTypes eBuilding, boo /// It is up to the caller to reassign population. void CvCityCitizens::DoRemoveAllSpecialistsFromBuilding(BuildingTypes eBuilding, CvCity::eUpdateMode updateMode) { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); if (pkBuildingInfo == NULL) @@ -3302,8 +3302,8 @@ void CvCityCitizens::ChangeNumForcedDefaultSpecialists(int iChange) /// How many Specialists do we have assigned of this type in our City? int CvCityCitizens::GetSpecialistCount(SpecialistTypes eIndex) const { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); return m_aiSpecialistCounts[eIndex]; } @@ -3311,15 +3311,15 @@ int CvCityCitizens::GetSpecialistCount(SpecialistTypes eIndex) const #if defined(MOD_BALANCE_CORE) int CvCityCitizens::GetSpecialistSlots(SpecialistTypes eIndex) const { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); return m_aiSpecialistSlots[eIndex]; } void CvCityCitizens::ChangeNumSpecialistSlots(SpecialistTypes eIndex, int iValue) { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); m_aiSpecialistSlots[eIndex] += iValue; } @@ -3367,8 +3367,8 @@ int CvCityCitizens::GetTotalSpecialistCount() const /// GPP changes from Buildings int CvCityCitizens::GetBuildingGreatPeopleRateChanges(SpecialistTypes eSpecialist) const { - CvAssert(eSpecialist > -1); - CvAssert(eSpecialist < GC.getNumSpecialistInfos()); + ASSERT(eSpecialist > -1); + ASSERT(eSpecialist < GC.getNumSpecialistInfos()); return m_piBuildingGreatPeopleRateChanges[eSpecialist]; } @@ -3376,8 +3376,8 @@ int CvCityCitizens::GetBuildingGreatPeopleRateChanges(SpecialistTypes eSpecialis /// Change GPP from Buildings void CvCityCitizens::ChangeBuildingGreatPeopleRateChanges(SpecialistTypes eSpecialist, int iChange) { - CvAssert(eSpecialist > -1); - CvAssert(eSpecialist < GC.getNumSpecialistInfos()); + ASSERT(eSpecialist > -1); + ASSERT(eSpecialist < GC.getNumSpecialistInfos()); m_piBuildingGreatPeopleRateChanges[eSpecialist] += iChange; } @@ -3385,8 +3385,8 @@ void CvCityCitizens::ChangeBuildingGreatPeopleRateChanges(SpecialistTypes eSpeci /// How much progress does this City have towards a Great Person from eIndex? int CvCityCitizens::GetSpecialistGreatPersonProgress(SpecialistTypes eIndex) const { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); return GetSpecialistGreatPersonProgressTimes100(eIndex) / 100; } @@ -3394,8 +3394,8 @@ int CvCityCitizens::GetSpecialistGreatPersonProgress(SpecialistTypes eIndex) con /// How much progress does this City have towards a Great Person from eIndex? (in hundreds) int CvCityCitizens::GetSpecialistGreatPersonProgressTimes100(SpecialistTypes eIndex) const { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); return m_aiSpecialistGreatPersonProgressTimes100[eIndex]; } @@ -3403,8 +3403,8 @@ int CvCityCitizens::GetSpecialistGreatPersonProgressTimes100(SpecialistTypes eIn /// Change progress for this City towards a Great Person void CvCityCitizens::ChangeSpecialistGreatPersonProgressTimes100(SpecialistTypes eIndex, int iChange, bool bCheckForSpawn) { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); m_aiSpecialistGreatPersonProgressTimes100[eIndex] += iChange; @@ -3439,16 +3439,16 @@ void CvCityCitizens::ChangeSpecialistGreatPersonProgressTimes100(SpecialistTypes /// Reset Specialist progress void CvCityCitizens::DoResetSpecialistGreatPersonProgressTimes100(SpecialistTypes eIndex, int iAmountToRemove) { - CvAssert(eIndex > -1); - CvAssert(eIndex < GC.getNumSpecialistInfos()); + ASSERT(eIndex > -1); + ASSERT(eIndex < GC.getNumSpecialistInfos()); m_aiSpecialistGreatPersonProgressTimes100[eIndex] -= iAmountToRemove; } /// How many Specialists are assigned to eBuilding? int CvCityCitizens::GetNumSpecialistsInBuilding(BuildingTypes eBuilding) const { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); return m_aiNumSpecialistsInBuilding[eBuilding]; } @@ -3456,8 +3456,8 @@ int CvCityCitizens::GetNumSpecialistsInBuilding(BuildingTypes eBuilding) const /// How many Forced Specialists are assigned to eBuilding? int CvCityCitizens::GetNumForcedSpecialistsInBuilding(BuildingTypes eBuilding) const { - CvAssert(eBuilding > -1); - CvAssert(eBuilding < GC.getNumBuildingInfos()); + ASSERT(eBuilding > -1); + ASSERT(eBuilding < GC.getNumBuildingInfos()); return m_aiNumForcedSpecialistsInBuilding[eBuilding]; } @@ -3594,7 +3594,7 @@ int CvCityCitizens::GetSpecialistUpgradeThreshold(UnitClassTypes eUnitClass) con /// Create a GP! void CvCityCitizens::DoSpawnGreatPerson(UnitTypes eUnit, bool bIncrementCount, bool bCountAsProphet, bool bIsFree) { - CvAssert(eUnit != NO_UNIT); + ASSERT(eUnit != NO_UNIT); if (GC.getUnitInfo(eUnit)->IsFoundReligion() && GC.getGame().isOption(GAMEOPTION_NO_RELIGION)) return; diff --git a/CvGameCoreDLL_Expansion2/CvCityManager.cpp b/CvGameCoreDLL_Expansion2/CvCityManager.cpp index 11f12e5afd..81793541a6 100644 --- a/CvGameCoreDLL_Expansion2/CvCityManager.cpp +++ b/CvGameCoreDLL_Expansion2/CvCityManager.cpp @@ -124,12 +124,12 @@ void CvCityManager::OnCityDestroyed(CvCity* pkCity) // --------------------------------------------------------------------------- const CvCityManager::CityList& CvCityManager::GetNearbyCities(CvCity* pkCity) { - CvAssert(pkCity); + ASSERT(pkCity); if (pkCity) { CityMap::const_iterator itr = ms_kCityMap.find(pkCity); - CvAssert(itr != ms_kCityMap.end()); + ASSERT(itr != ms_kCityMap.end()); if (itr != ms_kCityMap.end()) { return (*itr).second; diff --git a/CvGameCoreDLL_Expansion2/CvCitySpecializationAI.cpp b/CvGameCoreDLL_Expansion2/CvCitySpecializationAI.cpp index 2b21717b2e..f481b0827c 100644 --- a/CvGameCoreDLL_Expansion2/CvCitySpecializationAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvCitySpecializationAI.cpp @@ -72,8 +72,8 @@ bool CvCitySpecializationXMLEntry::CacheResults(Database::Results& kResults, CvD /// What Flavors will be added by adopting this Strategy? int CvCitySpecializationXMLEntry::GetFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : -1; } @@ -827,7 +827,7 @@ vector CvCitySpecializationAI::SelectSpecializations() } else { - FAssertMsg(false, "Code does not support > 1 specialization for yields other than production."); + ASSERT(false, "Code does not support > 1 specialization for yields other than production."); } } else diff --git a/CvGameCoreDLL_Expansion2/CvCityStrategyAI.cpp b/CvGameCoreDLL_Expansion2/CvCityStrategyAI.cpp index 7f2706377f..cccba6a095 100644 --- a/CvGameCoreDLL_Expansion2/CvCityStrategyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvCityStrategyAI.cpp @@ -115,8 +115,8 @@ bool CvAICityStrategyEntry::CacheResults(Database::Results& kResults, CvDatabase /// What Flavors will be added by adopting this Strategy? int CvAICityStrategyEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : -1; } @@ -129,8 +129,8 @@ int CvAICityStrategyEntry::GetWeightThreshold() const /// How do a player's Personality Flavors affect the Threshold for adopting a Strategy? (if applicable) int CvAICityStrategyEntry::GetPersonalityFlavorThresholdMod(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPersonalityFlavorThresholdMod ? m_piPersonalityFlavorThresholdMod[i] : -1; } @@ -3047,7 +3047,7 @@ bool CityStrategyAIHelpers::IsTestCityStrategy_ManyTechsStolen(CvCity* pCity) eFlavorEspionage = eFlavor; } } - CvAssertMsg(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); + ASSERT(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); fRatio = pCityEspionage->m_aiNumTimesCityRobbed[ePlayer] / (float)(iTurnsOfEspionage); } @@ -3095,7 +3095,7 @@ bool CityStrategyAIHelpers::IsTestCityStrategy_KeyScienceCity(CvCity* pCity) eFlavorEspionage = eFlavor; } } - CvAssertMsg(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); + ASSERT(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); float fRatio = iNumBetterScienceCities / (float)iNumOtherCities; float fCutOff = (0.05f * GET_PLAYER(ePlayer).GetFlavorManager()->GetPersonalityIndividualFlavor(eFlavorEspionage)); diff --git a/CvGameCoreDLL_Expansion2/CvContractClasses.cpp b/CvGameCoreDLL_Expansion2/CvContractClasses.cpp index 848201535d..62c55a1459 100644 --- a/CvGameCoreDLL_Expansion2/CvContractClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvContractClasses.cpp @@ -116,14 +116,14 @@ int CvContractEntry::GetTurns() const } int CvContractEntry::GetYieldCost(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piYieldCost ? m_piYieldCost[eYield] : -1; } int CvContractEntry::GetFlavorValue(FlavorTypes eFlavor) const { - CvAssertMsg(eFlavor < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(eFlavor > -1, "Index out of bounds"); + ASSERT(eFlavor < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(eFlavor > -1, "Index out of bounds"); return m_piFlavor ? m_piFlavor[eFlavor] : -1; } @@ -525,7 +525,7 @@ void CvPlayerContracts::InitContractUnits(ContractTypes eContract) // Init unit pUnit = m_pPlayer->initUnit(eUnit, pBestCity->getX(), pBestCity->getY(), pkUnitInfo->GetDefaultUnitAIType(), REASON_DEFAULT, false, true, 0, 0, eContract); - CvAssert(pUnit); + ASSERT(pUnit); if (pUnit) { if (!pUnit->jumpToNearestValidPlotWithinRange(5)) diff --git a/CvGameCoreDLL_Expansion2/CvCorporationClasses.cpp b/CvGameCoreDLL_Expansion2/CvCorporationClasses.cpp index 7eabbf509f..3b90073793 100644 --- a/CvGameCoreDLL_Expansion2/CvCorporationClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvCorporationClasses.cpp @@ -127,7 +127,7 @@ uint CvCorporationEntry::GetResourceMonopolyAndSize() const } int CvCorporationEntry::GetResourceMonopolyAnd(uint ui) const { - CvAssertMsg(ui < m_viResourceMonopolyAnds.size(), "Index out of bounds"); + ASSERT(ui < m_viResourceMonopolyAnds.size(), "Index out of bounds"); return m_viResourceMonopolyAnds[ui]; } @@ -138,72 +138,72 @@ uint CvCorporationEntry::GetResourceMonopolyOrSize() const } int CvCorporationEntry::GetResourceMonopolyOr(uint ui) const { - CvAssertMsg(ui < m_viResourceMonopolyOrs.size(), "Index out of bounds"); + ASSERT(ui < m_viResourceMonopolyOrs.size(), "Index out of bounds"); return m_viResourceMonopolyOrs[ui]; } int CvCorporationEntry::GetNumFreeResource(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeResource ? m_piNumFreeResource[i] : -1; } int CvCorporationEntry::GetUnitResourceProductionModifier(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piUnitResourceProductionModifier ? m_piUnitResourceProductionModifier[i] : -1; } /// Yield Modifier for Trade Routes to cities from an office to cities with a Franchise int CvCorporationEntry::GetTradeRouteMod(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piTradeRouteMod ? m_piTradeRouteMod[i] : -1; } int CvCorporationEntry::GetTradeRouteCityMod(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piTradeRouteCityMod ? m_piTradeRouteCityMod[i] : -1; } /// Change to Resource yield by type int CvCorporationEntry::GetResourceYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiResourceYieldChange ? m_ppaiResourceYieldChange[i][j] : -1; } /// Array of changes to Resource yield int* CvCorporationEntry::GetResourceYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiResourceYieldChange[i]; } /// Change to specialist yield by type int CvCorporationEntry::GetSpecialistYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChange ? m_ppaiSpecialistYieldChange[i][j] : -1; } /// Array of changes to specialist yield int* CvCorporationEntry::GetSpecialistYieldChangeArray(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_ppaiSpecialistYieldChange[i]; } @@ -220,10 +220,10 @@ CvString CvCorporationEntry::GetTradeRouteBenefitHelper() const /// Yield change for a specific BuildingClass by yield type int CvCorporationEntry::GetBuildingClassYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldChanges[i][j]; } @@ -743,15 +743,15 @@ void CvPlayerCorporations::ChangeNoFranchisesInForeignCities(int iValue) int CvPlayerCorporations::GetFranchisesPerImprovement(ImprovementTypes eIndex) const { - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex > -1, "Index out of bounds"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex > -1, "Index out of bounds"); return m_aiFranchisesPerImprovement[eIndex]; } void CvPlayerCorporations::ChangeFranchisesPerImprovement(ImprovementTypes eIndex, int iValue) { - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex > -1, "Index out of bounds"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex > -1, "Index out of bounds"); if (iValue != 0) { m_aiFranchisesPerImprovement[eIndex] += iValue; @@ -1433,8 +1433,8 @@ void CvPlayerCorporations::ClearAllCorporationsFromCity(CvCity* pCity) // Clear foreign Corporations from pCity void CvPlayerCorporations::ClearCorporationFromCity(CvCity* pCity, CorporationTypes eCorporation, bool bAllButThis) { - CvAssert(pCity); - CvAssert(eCorporation != NO_CORPORATION); + ASSERT(pCity); + ASSERT(eCorporation != NO_CORPORATION); if (!pCity) return; diff --git a/CvGameCoreDLL_Expansion2/CvCultureClasses.cpp b/CvGameCoreDLL_Expansion2/CvCultureClasses.cpp index 812836bc19..af7712d4cd 100644 --- a/CvGameCoreDLL_Expansion2/CvCultureClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvCultureClasses.cpp @@ -125,14 +125,14 @@ int CvGameCulture::CreateGreatWork(GreatWorkType eType, GreatWorkClass eClass, P GreatWorkType CvGameCulture::GetGreatWorkType(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); const CvGreatWork* pWork = &m_CurrentGreatWorks[iIndex]; return pWork->m_eType; } GreatWorkClass CvGameCulture::GetGreatWorkClass(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); const CvGreatWork* pWork = &m_CurrentGreatWorks[iIndex]; return pWork->m_eClassType; } @@ -140,11 +140,11 @@ GreatWorkClass CvGameCulture::GetGreatWorkClass(int iIndex) const /// Returns UI tooltip for this Great Work CvString CvGameCulture::GetGreatWorkTooltip(int iIndex, PlayerTypes eOwner) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); CvString szTooltip = ""; const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; - CvAssertMsg(pWork->m_eClassType != NO_GREAT_WORK_CLASS, "Invalid Great Work Class"); + ASSERT(pWork->m_eClassType != NO_GREAT_WORK_CLASS, "Invalid Great Work Class"); CvString strYearString; CvGameTextMgr::setDateStr(strYearString, @@ -311,7 +311,7 @@ CvString CvGameCulture::GetGreatWorkTooltip(int iIndex, PlayerTypes eOwner) cons /// Returns name of this Great Work CvString CvGameCulture::GetGreatWorkName(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); const CvGreatWork* pWork = &m_CurrentGreatWorks[iIndex]; return CultureHelpers::GetGreatWorkName(pWork->m_eType); @@ -320,7 +320,7 @@ CvString CvGameCulture::GetGreatWorkName(int iIndex) const /// Returns artist of this Great Work CvString CvGameCulture::GetGreatWorkArtist(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); CvString szArtist = ""; const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; @@ -332,7 +332,7 @@ CvString CvGameCulture::GetGreatWorkArtist(int iIndex) const /// Returns era of this Great Work CvString CvGameCulture::GetGreatWorkEra(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); CvString szEra = ""; const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; @@ -355,7 +355,7 @@ CvString CvGameCulture::GetGreatWorkEra(int iIndex) const CvString CvGameCulture::GetGreatWorkEraAbbreviation(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); CvString szEra = ""; const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; @@ -366,7 +366,7 @@ CvString CvGameCulture::GetGreatWorkEraAbbreviation(int iIndex) const CvString CvGameCulture::GetGreatWorkEraShort(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); CvString szEra = ""; const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; @@ -377,14 +377,14 @@ CvString CvGameCulture::GetGreatWorkEraShort(int iIndex) const PlayerTypes CvGameCulture::GetGreatWorkCreator (int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); const CvGreatWork *pWork = &m_CurrentGreatWorks[iIndex]; return pWork->m_ePlayer; } PlayerTypes CvGameCulture::GetGreatWorkController(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); // for each player // for each building @@ -444,7 +444,7 @@ bool CvGameCulture::IsGreatWorkCreated(GreatWorkType eType) const CvCity* CvGameCulture::GetGreatWorkCity(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); // for each player // for each building @@ -490,7 +490,7 @@ CvCity* CvGameCulture::GetGreatWorkCity(int iIndex) const int CvGameCulture::GetGreatWorkCurrentThemingBonus(int iIndex) const { - CvAssertMsg (iIndex < GetNumGreatWorks(), "Bad Great Work index"); + ASSERT(iIndex < GetNumGreatWorks(), "Bad Great Work index"); // for each player // for each building @@ -2802,14 +2802,14 @@ void CvPlayerCulture::SetSwappableMusicIndex (int iIndex) /// Add to the list of plots where we have archaeologists waiting for orders void CvPlayerCulture::AddDigCompletePlot(CvPlot* pPlot) { - CvAssert(pPlot != NULL); + ASSERT(pPlot != NULL); m_aDigCompletePlots.push_back(pPlot); } /// Remove a plot from the list of plots where we have archaeologists waiting for orders void CvPlayerCulture::RemoveDigCompletePlot(CvPlot* pPlot) { - CvAssert(pPlot != NULL); + ASSERT(pPlot != NULL); vector::iterator it = std::find(m_aDigCompletePlots.begin(), m_aDigCompletePlots.end(), pPlot); if (it != m_aDigCompletePlots.end()) { @@ -2869,7 +2869,7 @@ CvUnit *CvPlayerCulture::GetNextDigCompleteArchaeologist(CvPlot **ppPlot) const /// Is there a dig that completed at this plot? bool CvPlayerCulture::HasDigCompleteHere(CvPlot* pPlot) const { - CvAssert(pPlot != NULL); + ASSERT(pPlot != NULL); return std::find(m_aDigCompletePlots.begin(), m_aDigCompletePlots.end(), pPlot) != m_aDigCompletePlots.end(); } @@ -3830,8 +3830,8 @@ void CvPlayerCulture::SetLastTurnCPT(int iValue) /// What is our cultural influence now? int CvPlayerCulture::GetInfluenceOn(PlayerTypes ePlayer) const { - CvAssertMsg (ePlayer >= 0, "Invalid player index"); - CvAssertMsg (ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); + ASSERT(ePlayer >= 0, "Invalid player index"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); int iIndex = (int)ePlayer; if (iIndex < 0 || iIndex >= MAX_MAJOR_CIVS) return 0; @@ -3841,8 +3841,8 @@ int CvPlayerCulture::GetInfluenceOn(PlayerTypes ePlayer) const // What is our cultural influence now? void CvPlayerCulture::ChangeInfluenceOn(PlayerTypes ePlayer, int iValue) { - CvAssertMsg (ePlayer >= 0, "Invalid player index"); - CvAssertMsg (ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); + ASSERT(ePlayer >= 0, "Invalid player index"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); int iIndex = (int)ePlayer; if (iIndex < 0 || iIndex >= MAX_MAJOR_CIVS) return; @@ -3883,8 +3883,8 @@ int CvPlayerCulture::ChangeInfluenceOn(PlayerTypes eOtherPlayer, int iBaseInflue /// What was our cultural influence last turn? int CvPlayerCulture::GetLastTurnInfluenceOn(PlayerTypes ePlayer) const { - CvAssertMsg (ePlayer >= 0, "Invalid player index"); - CvAssertMsg (ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); + ASSERT(ePlayer >= 0, "Invalid player index"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); int iIndex = (int)ePlayer; if (iIndex < 0 || iIndex >= MAX_MAJOR_CIVS) return 0; @@ -3894,8 +3894,8 @@ int CvPlayerCulture::GetLastTurnInfluenceOn(PlayerTypes ePlayer) const /// What was our cultural influence last turn? int CvPlayerCulture::GetLastTurnInfluenceIPT(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "Invalid player index"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); + ASSERT(ePlayer >= 0, "Invalid player index"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "Invalid player index"); int iIndex = (int)ePlayer; if (iIndex < 0 || iIndex >= MAX_MAJOR_CIVS) return 0; @@ -6954,7 +6954,7 @@ CvString CvCityCulture::GetThemingTooltip(BuildingClassTypes eBuildingClass) con if (iIndex != -1) { CvThemingBonusInfo* pkThemingInfo = pkBuildingInfo->GetThemingBonusInfo(iIndex); - CvAssert(pkThemingInfo); + ASSERT(pkThemingInfo); CvString szBonusString = ""; szBonusString.Format("+%d [ICON_TOURISM]/[ICON_CULTURE]: ", GetThemingBonus(eBuildingClass)); diff --git a/CvGameCoreDLL_Expansion2/CvDatabaseUtility.cpp b/CvGameCoreDLL_Expansion2/CvDatabaseUtility.cpp index d171635883..34f5d06b11 100644 --- a/CvGameCoreDLL_Expansion2/CvDatabaseUtility.cpp +++ b/CvGameCoreDLL_Expansion2/CvDatabaseUtility.cpp @@ -85,7 +85,7 @@ bool CvDatabaseUtility::Initialize2DArray(int**& ppArray, const char* szTable1Na if(iCount1 <= 0 || iCount2 <= 0) { ppArray = NULL; - CvAssertMsg(false, "Cannot initialize array to 0 size."); + ASSERT(false, "Cannot initialize array to 0 size."); return false; } @@ -113,7 +113,7 @@ void CvDatabaseUtility::Initialize2DArray(int**& ppArray, const size_t iCount1, { if(iCount1 <= 0 || iCount2 <= 0) { - CvAssertMsg(false, "Cannot initialize array to 0 size."); + ASSERT(false, "Cannot initialize array to 0 size."); return; } @@ -164,7 +164,7 @@ bool CvDatabaseUtility::PopulateArrayByExistence(bool*& pArray, const char* szTy if(!pResults->Bind(1, szFilterValue, false)) { - CvAssertMsg(false, GetErrorMessage()); + ASSERT(false, GetErrorMessage()); return false; } @@ -200,7 +200,7 @@ bool CvDatabaseUtility::PopulateArrayByExistence(int*& pArray, const char* szTyp if(!pResults->Bind(1, szFilterValue, false)) { - CvAssertMsg(false, GetErrorMessage()); + ASSERT(false, GetErrorMessage()); return false; } @@ -237,7 +237,7 @@ bool CvDatabaseUtility::PopulateVector(std::vector& pVector, const char* sz if (!pResults->Bind(1, szFilterValue, false)) { - CvAssertMsg(false, GetErrorMessage()); + ASSERT(false, GetErrorMessage()); return false; } @@ -281,7 +281,7 @@ bool CvDatabaseUtility::PopulateArrayByValue(int*& pArray, const char* szTypeTab if(!pResults->Bind(1, szFilterValue, false)) { - CvAssertMsg(false, GetErrorMessage()); + ASSERT(false, GetErrorMessage()); return false; } while(pResults->Step()) @@ -318,7 +318,7 @@ bool CvDatabaseUtility::PopulateSetByExistence(set& siData, const char* szT if (!pResults->Bind(1, szFilterValue, false)) { - CvAssertMsg(false, GetErrorMessage()); + ASSERT(false, GetErrorMessage()); return false; } diff --git a/CvGameCoreDLL_Expansion2/CvDatabaseUtility.h b/CvGameCoreDLL_Expansion2/CvDatabaseUtility.h index 2088edf8e7..cd922c5662 100644 --- a/CvGameCoreDLL_Expansion2/CvDatabaseUtility.h +++ b/CvGameCoreDLL_Expansion2/CvDatabaseUtility.h @@ -114,7 +114,7 @@ void InitializeArray(T*& pArray, const char* szTableName, T default_ = (T)0); //------------------------------------------------------------------------------ inline void CvDatabaseUtility::InitializeArray(int*& pArray, const size_t count, int iDefault) { - CvAssertMsg(count > 0, "Initializing array to 0 or less items."); + ASSERT(count > 0, "Initializing array to 0 or less items."); pArray = FNEW(int[count], c_eCiv5GameplayDLL, 0); if(iDefault == 0) { @@ -129,7 +129,7 @@ inline void CvDatabaseUtility::InitializeArray(int*& pArray, const size_t count, //------------------------------------------------------------------------------ inline void CvDatabaseUtility::InitializeArray(bool*& pArray, const size_t count, bool bDefault) { - CvAssertMsg(count > 0, "Initializing array to 0 or less items."); + ASSERT(count > 0, "Initializing array to 0 or less items."); pArray = FNEW(bool[count], c_eCiv5GameplayDLL, 0); if(bDefault == 0.0f) { @@ -144,7 +144,7 @@ inline void CvDatabaseUtility::InitializeArray(bool*& pArray, const size_t count //------------------------------------------------------------------------------ inline void CvDatabaseUtility::InitializeArray(float*& pArray, const size_t count, float fDefault) { - CvAssertMsg(count > 0, "Initializing array to 0 or less items."); + ASSERT(count > 0, "Initializing array to 0 or less items."); pArray = FNEW(float[count], c_eCiv5GameplayDLL, 0); if(fDefault == 0.0f) { @@ -167,7 +167,7 @@ inline void CvDatabaseUtility::InitializeArray(T*& pArray, const char* szTableNa //We cannot simply NULL out the array because WAY too much code blindly assumes SOMETHING will be there.. //Instead we allocate room for 1 element and just roll with it. - //CvAssertMsg(count > 0, DB.ErrorMessage()); + //ASSERT(count > 0, DB.ErrorMessage()); if(count == 0) count = 1; diff --git a/CvGameCoreDLL_Expansion2/CvDealAI.cpp b/CvGameCoreDLL_Expansion2/CvDealAI.cpp index 7dca5310ed..cbb6a00a32 100644 --- a/CvGameCoreDLL_Expansion2/CvDealAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvDealAI.cpp @@ -710,9 +710,9 @@ bool CvDealAI::DoEqualizeDeal(CvDeal* pDeal, PlayerTypes eOtherPlayer, bool& bDe PlayerTypes eMyPlayer = GetPlayer()->GetID(); DEBUG_VARIABLE(eMyPlayer); - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); - CvAssertMsg(eMyPlayer != eOtherPlayer, "DEAL_AI: Trying to equalize human deal, but both players are the same. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eMyPlayer != eOtherPlayer, "DEAL_AI: Trying to equalize human deal, but both players are the same."); if (pDeal->GetNumItems() <= 0) { @@ -934,10 +934,10 @@ int CvDealAI::GetOneGPTValue(bool bPeaceDeal) const /// What is a particular item worth? int CvDealAI::GetTradeItemValue(TradeableItems eItem, bool bFromMe, PlayerTypes eOtherPlayer, int iData1, int iData2, int iData3, bool bFlag1, int iDuration, bool bIsAIOffer, bool bEqualize) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); - CvAssertMsg(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to get deal item value for trading to oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eItem != TRADE_ITEM_NONE, "DEAL_AI: Trying to get value of TRADE_ITEM_NONE. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to get deal item value for trading to oneself."); + ASSERT(eItem != TRADE_ITEM_NONE, "DEAL_AI: Trying to get value of TRADE_ITEM_NONE."); //clear cache if outdated if (GC.getGame().getTurnSlice() != m_iDealItemValuesTurnSlice) @@ -1021,7 +1021,7 @@ int CvDealAI::GetTradeItemValue(TradeableItems eItem, bool bFromMe, PlayerTypes else if (eItem == TRADE_ITEM_VASSALAGE_REVOKE) iItemValue = GetRevokeVassalageValue(bFromMe, eOtherPlayer, GET_TEAM(GetPlayer()->getTeam()).isAtWar(GET_PLAYER(eOtherPlayer).getTeam())); - CvAssertMsg(iItemValue >= 0, "DEAL_AI: Trade Item value is negative. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iItemValue >= 0, "DEAL_AI: Trade Item value is negative."); } } else @@ -1245,7 +1245,7 @@ int CvDealAI::GetGoldForForValueExchange(int iGoldOrValue, bool bNumGoldFromValu /// How much GPT should be provided if we're trying to make it worth iValue? int CvDealAI::GetGPTForForValueExchange(int iGPTorValue, bool bNumGPTFromValue, int iNumTurns, bool bFromMe, PlayerTypes eOtherPlayer) { - CvAssertMsg(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of GPT with oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of GPT with oneself."); if (iGPTorValue <= 0) return -1; @@ -1308,7 +1308,7 @@ int CvDealAI::GetGPTForForValueExchange(int iGPTorValue, bool bNumGPTFromValue, int CvDealAI::GetResourceValue(ResourceTypes eResource, int iResourceQuantity, int iNumTurns, bool bFromMe, PlayerTypes eOtherPlayer, int iCurrentNetGoldOfReceivingPlayer) { const CvResourceInfo* pkResourceInfo = GC.getResourceInfo(eResource); - CvAssert(pkResourceInfo != NULL); + ASSERT(pkResourceInfo != NULL); if (pkResourceInfo == NULL) return 0; @@ -2355,7 +2355,7 @@ int CvDealAI::GetEmbassyValue(bool bFromMe, PlayerTypes eOtherPlayer) /// How much is Open Borders worth? int CvDealAI::GetOpenBordersValue(bool bFromMe, PlayerTypes eOtherPlayer) { - CvAssertMsg(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of Open Borders with oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of Open Borders with oneself."); CvDiplomacyAI* pDiploAI = GetPlayer()->GetDiplomacyAI(); CivApproachTypes eApproach = pDiploAI->GetSurfaceApproach(eOtherPlayer); @@ -2589,7 +2589,7 @@ int CvDealAI::GetDefensivePactValue(bool bFromMe, PlayerTypes eOtherPlayer) /// How much is a Research Agreement worth? int CvDealAI::GetResearchAgreementValue(bool bFromMe, PlayerTypes eOtherPlayer) { - CvAssertMsg(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of a Research Agreement with oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of a Research Agreement with oneself."); int iItemValue = 100; @@ -3352,9 +3352,9 @@ int CvDealAI::GetVoteCommitmentValue(bool bFromMe, PlayerTypes eOtherPlayer, int /// See if adding a Vote Commitment to their side of the deal helps even out pDeal void CvDealAI::DoAddVoteCommitmentToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us."); CvWeightedVector viTradeValues; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); @@ -3432,9 +3432,9 @@ void CvDealAI::DoAddVoteCommitmentToThem(CvDeal* pDeal, PlayerTypes eThem, int& /// See if adding a Vote Commitment to our side of the deal helps even out pDeal void CvDealAI::DoAddVoteCommitmentToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS) - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS) + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us."); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); if(pLeague == NULL || !pLeague) @@ -3519,9 +3519,9 @@ void CvDealAI::DoAddVoteCommitmentToUs(CvDeal* pDeal, PlayerTypes eThem, int& iT /// See if adding 3rd Party War to their side of the deal helps even out pDeal void CvDealAI::DoAddThirdPartyWarToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us."); // Not allowed in demands. if (pDeal->GetDemandingPlayer() != NO_PLAYER) @@ -3599,9 +3599,9 @@ void CvDealAI::DoAddThirdPartyWarToThem(CvDeal* pDeal, PlayerTypes eThem, int& i /// See if adding 3rd Party War to our side of the deal helps even out pDeal void CvDealAI::DoAddThirdPartyWarToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS) - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS) + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us."); if ((iThresholdValue != 0 || !WithinAcceptableRange(eThem, pDeal->GetMaxValue(), iTotalValue)) && (iThresholdValue == 0 || iTotalValue >= iThresholdValue)) { @@ -3646,9 +3646,9 @@ void CvDealAI::DoAddThirdPartyWarToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTo /// See if adding 3rd Party Peace to their side of the deal helps even out pDeal void CvDealAI::DoAddThirdPartyPeaceToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Them, but them is us."); CvWeightedVector viTradeValues; @@ -3716,9 +3716,9 @@ void CvDealAI::DoAddThirdPartyPeaceToThem(CvDeal* pDeal, PlayerTypes eThem, int& /// See if adding a 3rd Party Peace deal to our side of the deal helps even out pDeal void CvDealAI::DoAddThirdPartyPeaceToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS) - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us. Please send Anton your save file and version."); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS) + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vote Commitment to Us, but them is us."); if ((iThresholdValue != 0 || !WithinAcceptableRange(eThem, pDeal->GetMaxValue(), iTotalValue)) && (iThresholdValue == 0 || iTotalValue >= iThresholdValue)) { @@ -3759,9 +3759,9 @@ void CvDealAI::DoAddThirdPartyPeaceToUs(CvDeal* pDeal, PlayerTypes eThem, int& i /// See if adding a Resource to their side of the deal helps even out pDeal void CvDealAI::DoAddLuxuryResourceToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Them, but them is us."); CvWeightedVector viTradeValues; @@ -3867,9 +3867,9 @@ void CvDealAI::DoAddLuxuryResourceToThem(CvDeal* pDeal, PlayerTypes eThem, int& /// See if adding a Resource to our side of the deal helps even out pDeal void CvDealAI::DoAddLuxuryResourceToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Us, but them is us."); CvWeightedVector viTradeValues; @@ -3964,9 +3964,9 @@ void CvDealAI::DoAddLuxuryResourceToUs(CvDeal* pDeal, PlayerTypes eThem, int& iT /// See if adding a Resource to their side of the deal helps even out pDeal void CvDealAI::DoAddStrategicResourceToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Them, but them is us."); typedef pair TradeItem; vector> vOptions; @@ -4061,9 +4061,9 @@ void CvDealAI::DoAddStrategicResourceToThem(CvDeal* pDeal, PlayerTypes eThem, in /// See if adding a Resource to our side of the deal helps even out pDeal void CvDealAI::DoAddStrategicResourceToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Resource to Us, but them is us."); typedef pair TradeItem; vector> vOptions; @@ -4153,9 +4153,9 @@ void CvDealAI::DoAddStrategicResourceToUs(CvDeal* pDeal, PlayerTypes eThem, int& /// See if adding Embassy to their side of the deal helps even out pDeal void CvDealAI::DoAddEmbassyToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Embassy to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Embassy to Them, but them is us."); // don't make a demand for an embassy if (pDeal->GetDemandingPlayer() != NO_PLAYER) @@ -4190,9 +4190,9 @@ void CvDealAI::DoAddEmbassyToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalV /// See if adding Embassy to our side of the deal helps even out pDeal void CvDealAI::DoAddEmbassyToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Embassy to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Embassy to Us, but them is us."); if ((iThresholdValue != 0 || !WithinAcceptableRange(eThem, pDeal->GetMaxValue(), iTotalValue)) && (iThresholdValue == 0 || iTotalValue >= iThresholdValue)) { @@ -4223,9 +4223,9 @@ void CvDealAI::DoAddEmbassyToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalVal /// See if adding Open Borders to their side of the deal helps even out pDeal void CvDealAI::DoAddOpenBordersToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Them, but them is us."); int iDealDuration = pDeal->GetDuration(); @@ -4258,9 +4258,9 @@ void CvDealAI::DoAddOpenBordersToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTo /// See if adding Open Borders to our side of the deal helps even out pDeal void CvDealAI::DoAddOpenBordersToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us."); PlayerTypes eMyPlayer = GetPlayer()->GetID(); @@ -4293,9 +4293,9 @@ void CvDealAI::DoAddOpenBordersToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTota /// See if adding Cities to our side of the deal helps even out pDeal void CvDealAI::DoAddCitiesToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us."); if (!pDeal->IsPossibleToTradeItem(GetPlayer()->GetID(), eThem, TRADE_ITEM_CITIES)) return; @@ -4375,9 +4375,9 @@ void CvDealAI::DoAddCitiesToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValu /// See if adding Cities to their side of the deal helps even out pDeal void CvDealAI::DoAddCitiesToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Open Borders to Us, but them is us."); // Not allowed in demands. if (pDeal->GetDemandingPlayer() != NO_PLAYER) @@ -4460,9 +4460,9 @@ void CvDealAI::DoAddCitiesToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalVa /// See if adding Gold to their side of the deal helps even out pDeal void CvDealAI::DoAddGoldToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iDemandValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Gold to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Gold to Them, but them is us."); PlayerTypes eMyPlayer = GetPlayer()->GetID(); if (!pDeal->IsPossibleToTradeItem(eThem, eMyPlayer, TRADE_ITEM_GOLD)) @@ -4507,9 +4507,9 @@ void CvDealAI::DoAddGoldToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValu /// See if adding Gold to our side of the deal helps even out pDeal void CvDealAI::DoAddGoldToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Gold to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Gold to Us, but them is us."); PlayerTypes eMyPlayer = GetPlayer()->GetID(); if (!pDeal->IsPossibleToTradeItem(eMyPlayer, eThem, TRADE_ITEM_GOLD)) @@ -4554,9 +4554,9 @@ void CvDealAI::DoAddGoldToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue) /// See if adding Gold Per Turn to their side of the deal helps even out pDeal void CvDealAI::DoAddGPTToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iDemandValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add GPT to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add GPT to Them, but them is us."); PlayerTypes eMyPlayer = GetPlayer()->GetID(); if (!pDeal->IsPossibleToTradeItem(eThem, eMyPlayer, TRADE_ITEM_GOLD_PER_TURN)) @@ -4606,9 +4606,9 @@ void CvDealAI::DoAddGPTToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue /// See if adding Gold Per Turn to our side of the deal helps even out pDeal void CvDealAI::DoAddGPTToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add GPT to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add GPT to Us, but them is us."); PlayerTypes eMyPlayer = GetPlayer()->GetID(); if (!pDeal->IsPossibleToTradeItem(eMyPlayer, eThem, TRADE_ITEM_GOLD_PER_TURN)) @@ -4833,9 +4833,9 @@ void CvDealAI::DoAddItemsToUs(CvDeal* pDeal, PlayerTypes eOtherPlayer, int& iTot /// See if removing Gold Per Turn from their side of the deal helps even out pDeal void CvDealAI::DoRemoveGPTFromThem(CvDeal* pDeal, PlayerTypes eThem, int iToRemove) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to remove GPT from Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to remove GPT from Them, but them is us."); int iDealDuration = pDeal->GetDuration(); int iNumGoldPerTurnInThisDeal = pDeal->GetGoldPerTurnTrade(eThem); @@ -4855,7 +4855,7 @@ void CvDealAI::DoRemoveGPTFromThem(CvDeal* pDeal, PlayerTypes eThem, int iToRemo { if (!pDeal->ChangeGoldPerTurnTrade(eThem, iNumGoldPerTurnInThisDeal, iDealDuration)) { - CvAssertMsg(false, "DEAL_AI: DealAI is trying to remove GoldPerTurn from a deal but couldn't find the item for some reason. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(false, "DEAL_AI: DealAI is trying to remove GoldPerTurn from a deal but couldn't find the item for some reason."); } } } @@ -4885,7 +4885,7 @@ void CvDealAI::DoRemoveGPTFromUs(CvDeal* pDeal, int iToRemove) { if(!pDeal->ChangeGoldPerTurnTrade(eMyPlayer, iNumGoldPerTurnInThisDeal, iDealDuration)) { - CvAssertMsg(false, "DEAL_AI: DealAI is trying to remove GoldPerTurn from a deal but couldn't find the item for some reason. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(false, "DEAL_AI: DealAI is trying to remove GoldPerTurn from a deal but couldn't find the item for some reason."); } } } @@ -4894,9 +4894,9 @@ void CvDealAI::DoRemoveGPTFromUs(CvDeal* pDeal, int iToRemove) /// See if removing Gold from their side of the deal helps even out pDeal void CvDealAI::DoRemoveGoldFromThem(CvDeal* pDeal, PlayerTypes eThem, int& iGold) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to remove Gold from Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to remove Gold from Them, but them is us."); int iNumGoldInThisDeal = pDeal->GetGoldTrade(eThem); if(iNumGoldInThisDeal > 0) @@ -4915,7 +4915,7 @@ void CvDealAI::DoRemoveGoldFromThem(CvDeal* pDeal, PlayerTypes eThem, int& iGold { if(!pDeal->ChangeGoldTrade(eThem, iNumGoldInThisDeal)) { - CvAssertMsg(false, "DEAL_AI: DealAI is trying to remove Gold from a deal but couldn't find the item for some reason. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(false, "DEAL_AI: DealAI is trying to remove Gold from a deal but couldn't find the item for some reason."); } } } @@ -4944,7 +4944,7 @@ void CvDealAI::DoRemoveGoldFromUs(CvDeal* pDeal, int& iGold) { if (!pDeal->ChangeGoldTrade(eMyPlayer, iNumGoldInThisDeal)) { - CvAssertMsg(false, "DEAL_AI: DealAI is trying to remove Gold from a deal but couldn't find the item for some reason. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(false, "DEAL_AI: DealAI is trying to remove Gold from a deal but couldn't find the item for some reason."); } } } @@ -4954,8 +4954,8 @@ void CvDealAI::DoRemoveGoldFromUs(CvDeal* pDeal, int& iGold) bool CvDealAI::IsOfferPeace(PlayerTypes eOtherPlayer, CvDeal* pDeal, bool bEqualizingDeals) { bool result = false; - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Can we actually complete this deal? if(!pDeal->IsPossibleToTradeItem(GetPlayer()->GetID(), eOtherPlayer, TRADE_ITEM_PEACE_TREATY)) @@ -5008,8 +5008,8 @@ bool CvDealAI::IsOfferPeace(PlayerTypes eOtherPlayer, CvDeal* pDeal, bool bEqual ePeaceTreatyTheyreWillingToOffer = PeaceTreatyTypes((ePeaceTreatyTheyreWillingToOffer + ePeaceTreatyImWillingToAccept) / 2); } - CvAssertMsg(ePeaceTreatyImWillingToOffer >= PEACE_TREATY_WHITE_PEACE, "DEAL_AI: I'm offering a peace treaty with negative ID. Please show Jon"); - CvAssertMsg(ePeaceTreatyTheyreWillingToOffer >= PEACE_TREATY_WHITE_PEACE, "DEAL_AI: They're offering a peace treaty with negative ID. Please show Jon"); + ASSERT(ePeaceTreatyImWillingToOffer >= PEACE_TREATY_WHITE_PEACE, "DEAL_AI: I'm offering a peace treaty with negative ID."); + ASSERT(ePeaceTreatyTheyreWillingToOffer >= PEACE_TREATY_WHITE_PEACE, "DEAL_AI: They're offering a peace treaty with negative ID."); // I'm surrendering in this deal if(ePeaceTreatyImWillingToOffer > ePeaceTreatyTheyreWillingToOffer) @@ -5482,8 +5482,8 @@ void CvDealAI::DoAddPlayersAlliesToTreaty(PlayerTypes eToPlayer, CvDeal* pDeal) int CvDealAI::GetPotentialDemandValue(PlayerTypes eOtherPlayer, CvDeal* pDeal, int iIdealValue) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Set that this CvDeal is a demand pDeal->SetDemandingPlayer(GetPlayer()->GetID()); @@ -5506,8 +5506,8 @@ int CvDealAI::GetPotentialDemandValue(PlayerTypes eOtherPlayer, CvDeal* pDeal, i /// AI making a demand of eOtherPlayer bool CvDealAI::IsMakeDemand(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Set that this CvDeal is a demand pDeal->SetDemandingPlayer(GetPlayer()->GetID()); @@ -5531,8 +5531,8 @@ bool CvDealAI::IsMakeDemand(PlayerTypes eOtherPlayer, CvDeal* pDeal) /// A good time to make an offer for someone's extra Luxury? bool CvDealAI::IsMakeOfferForLuxuryResource(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); ResourceTypes eLuxuryFromThem = NO_RESOURCE; @@ -5610,8 +5610,8 @@ bool CvDealAI::IsMakeOfferForLuxuryResource(PlayerTypes eOtherPlayer, CvDeal* pD /// A good time to make an offer for someone's extra strats? bool CvDealAI::IsMakeOfferForStrategicResource(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); ResourceTypes eStratFromThem = NO_RESOURCE; @@ -5728,8 +5728,8 @@ bool CvDealAI::IsMakeOfferForStrategicResource(PlayerTypes eOtherPlayer, CvDeal* /// A good time to make an offer to get an embassy? bool CvDealAI::IsMakeOfferForEmbassy(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Don't ask for an embassy if we're hostile or planning war CivApproachTypes eApproach = GetPlayer()->GetDiplomacyAI()->GetCivApproach(eOtherPlayer); @@ -5772,8 +5772,8 @@ bool CvDealAI::IsMakeOfferForEmbassy(PlayerTypes eOtherPlayer, CvDeal* pDeal) /// A good time to make an offer to get Open Borders? bool CvDealAI::IsMakeOfferForOpenBorders(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Don't ask for Open Borders if we're hostile or planning war CivApproachTypes eApproach = GetPlayer()->GetDiplomacyAI()->GetCivApproach(eOtherPlayer); @@ -5814,8 +5814,8 @@ bool CvDealAI::IsMakeOfferForOpenBorders(PlayerTypes eOtherPlayer, CvDeal* pDeal /// A good time to make an offer for a Research Agreement? bool CvDealAI::IsMakeOfferForResearchAgreement(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); if (GetPlayer()->IsAITeammateOfHuman()) return false; @@ -5849,8 +5849,8 @@ bool CvDealAI::IsMakeOfferForResearchAgreement(PlayerTypes eOtherPlayer, CvDeal* /// A good time to make an offer for a Defensive Pact? bool CvDealAI::IsMakeOfferForDefensivePact(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Logic for when THIS AI wants to make a RA is in the Diplo AI @@ -5884,8 +5884,8 @@ bool CvDealAI::IsMakeOfferForDefensivePact(PlayerTypes eOtherPlayer, CvDeal* pDe /// A good time to make an offer to buy or sell a city? bool CvDealAI::IsMakeOfferForCityExchange(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Don't ask for a city if we're hostile or planning a war CivApproachTypes eApproach = GetPlayer()->GetDiplomacyAI()->GetCivApproach(eOtherPlayer); @@ -5972,8 +5972,8 @@ bool CvDealAI::IsMakeOfferForCityExchange(PlayerTypes eOtherPlayer, CvDeal* pDea /// A good time to make an offer to start a war? bool CvDealAI::IsMakeOfferForThirdPartyWar(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); if(eOtherPlayer == NO_PLAYER) { @@ -6080,8 +6080,8 @@ bool CvDealAI::IsMakeOfferForThirdPartyWar(PlayerTypes eOtherPlayer, CvDeal* pDe /// A good time to make an offer for a Peace Deal? bool CvDealAI::IsMakeOfferForThirdPartyPeace(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); if(eOtherPlayer == NO_PLAYER) { @@ -6169,8 +6169,8 @@ bool CvDealAI::IsMakeOfferForThirdPartyPeace(PlayerTypes eOtherPlayer, CvDeal* p /// A good time to make an offer for a Peace Deal? bool CvDealAI::IsMakeOfferForVote(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); if(!pLeague) @@ -7417,8 +7417,8 @@ int CvDealAI::GetRevokeVassalageValue(bool bFromMe, PlayerTypes eOtherPlayer, bo /// A good time to offer for World Map? bool CvDealAI::IsMakeOfferForMaps(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Don't ask for a map if we're hostile if (GetPlayer()->GetDiplomacyAI()->GetCivApproach(eOtherPlayer) == CIV_APPROACH_HOSTILE) @@ -7451,8 +7451,8 @@ bool CvDealAI::IsMakeOfferForMaps(PlayerTypes eOtherPlayer, CvDeal* pDeal) /// A good time to make an offer for technology? bool CvDealAI::IsMakeOfferForTech(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Don't ask for Technology if we're hostile or planning war CivApproachTypes eApproach = GetPlayer()->GetDiplomacyAI()->GetCivApproach(eOtherPlayer); @@ -7537,8 +7537,8 @@ bool CvDealAI::IsMakeOfferForTech(PlayerTypes eOtherPlayer, CvDeal* pDeal) /// A good time to make an offer for Vassalage? bool CvDealAI::IsMakeOfferForVassalage(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); // Human teams don't get asked for vassalage if(GET_TEAM(GET_PLAYER(eOtherPlayer).getTeam()).isHuman()) @@ -7582,8 +7582,8 @@ bool CvDealAI::IsMakeOfferForVassalage(PlayerTypes eOtherPlayer, CvDeal* pDeal) /// A good time to make an offer for Vassalage? bool CvDealAI::IsMakeOfferToBecomeVassal(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); if (!pDeal->IsPossibleToTradeItem(GetPlayer()->GetID(), eOtherPlayer, TRADE_ITEM_VASSALAGE)) { @@ -7620,8 +7620,8 @@ bool CvDealAI::IsMakeOfferToBecomeVassal(PlayerTypes eOtherPlayer, CvDeal* pDeal bool CvDealAI::IsMakeOfferForRevokeVassalage(PlayerTypes eOtherPlayer, CvDeal* pDeal) { - CvAssert(eOtherPlayer >= 0); - CvAssert(eOtherPlayer < MAX_MAJOR_CIVS); + ASSERT(eOtherPlayer >= 0); + ASSERT(eOtherPlayer < MAX_MAJOR_CIVS); //If the other player has no vassals... if(GET_TEAM(GET_PLAYER(eOtherPlayer).getTeam()).GetNumVassals() <= 0) @@ -7695,9 +7695,9 @@ bool CvDealAI::IsMakeOfferForRevokeVassalage(PlayerTypes eOtherPlayer, CvDeal* p /// See if adding Maps to their side of the deal helps even out pDeal void CvDealAI::DoAddMapsToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add World Map to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add World Map to Them, but them is us."); // Not allowed in demands. if (pDeal->GetDemandingPlayer() != NO_PLAYER) @@ -7732,9 +7732,9 @@ void CvDealAI::DoAddMapsToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValu /// See if adding Maps to our side of the deal helps even out pDeal void CvDealAI::DoAddMapsToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add World Map to Us, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add World Map to Us, but them is us."); //if(!bDontChangeMyExistingItems) { @@ -7766,9 +7766,9 @@ void CvDealAI::DoAddMapsToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, /// See if adding Technology to their side of the deal helps even out pDeal void CvDealAI::DoAddTechToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us."); // Not allowed in demands. if (pDeal->GetDemandingPlayer() != NO_PLAYER) @@ -7836,9 +7836,9 @@ void CvDealAI::DoAddTechToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValu /// See if adding Technology to our side of the deal helps even out pDeal void CvDealAI::DoAddTechToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us."); //if(!bDontChangeMyExistingItems) { @@ -7879,9 +7879,9 @@ void CvDealAI::DoAddTechToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, void CvDealAI::DoAddVassalageToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us."); if (!pDeal->IsPossibleToTradeItem(GetPlayer()->GetID(), eThem, TRADE_ITEM_VASSALAGE)) return; @@ -7925,9 +7925,9 @@ void CvDealAI::DoAddVassalageToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalV void CvDealAI::DoAddVassalageToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vassalage to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Vassalage to Them, but them is us."); if (!pDeal->IsPossibleToTradeItem(eThem, GetPlayer()->GetID(), TRADE_ITEM_VASSALAGE)) return; @@ -7981,9 +7981,9 @@ void CvDealAI::DoAddVassalageToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTota void CvDealAI::DoAddRevokeVassalageToUs(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us."); if (!pDeal->IsPossibleToTradeItem(GetPlayer()->GetID(), eThem, TRADE_ITEM_VASSALAGE_REVOKE)) return; @@ -8008,9 +8008,9 @@ void CvDealAI::DoAddRevokeVassalageToUs(CvDeal* pDeal, PlayerTypes eThem, int& i void CvDealAI::DoAddRevokeVassalageToThem(CvDeal* pDeal, PlayerTypes eThem, int& iTotalValue, int iThresholdValue) { - CvAssert(eThem >= 0); - CvAssert(eThem < MAX_MAJOR_CIVS); - CvAssertMsg(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us. Please show Jon"); + ASSERT(eThem >= 0); + ASSERT(eThem < MAX_MAJOR_CIVS); + ASSERT(eThem != GetPlayer()->GetID(), "DEAL_AI: Trying to add Technology to Them, but them is us."); // Not allowed in demands. if (pDeal->GetDemandingPlayer() != NO_PLAYER) diff --git a/CvGameCoreDLL_Expansion2/CvDealClasses.cpp b/CvGameCoreDLL_Expansion2/CvDealClasses.cpp index 48d25da301..516648eec2 100644 --- a/CvGameCoreDLL_Expansion2/CvDealClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvDealClasses.cpp @@ -234,8 +234,8 @@ int CvDeal::GetNumItems() /// Who is player 1 in this deal (called from Lua because the interface has a static Deal that is initialized with both players as -1) void CvDeal::SetFromPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DEAL: Invalid Player Index."); + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); m_eFromPlayer = ePlayer; } @@ -243,8 +243,8 @@ void CvDeal::SetFromPlayer(PlayerTypes ePlayer) /// Who is player 2 in this deal (called from Lua because the interface has a static Deal that is initialized with both players as -1) void CvDeal::SetToPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DEAL: Invalid Player Index."); + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); m_eToPlayer = ePlayer; } @@ -295,8 +295,8 @@ void CvDeal::SetDuration(int iValue) /// Helper function to figure out who the TO player is for a TradeableItem PlayerTypes CvDeal::GetOtherPlayer(PlayerTypes eFromPlayer) const { - CvAssertMsg(eFromPlayer >= 0, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFromPlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFromPlayer >= 0, "DEAL: Invalid Player Index."); + ASSERT(eFromPlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); if(m_eFromPlayer != eFromPlayer) { @@ -3153,8 +3153,8 @@ PeaceTreatyTypes CvDeal::GetPeaceTreatyType() const /// Sets what kind of Peace Treaty (if any) is this Deal void CvDeal::SetPeaceTreatyType(PeaceTreatyTypes eTreaty) { - CvAssertMsg(eTreaty >= NO_PEACE_TREATY_TYPE, "DEAL: Invalid PeaceTreatyType index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); // NO_PEACE_TREATY_TYPE is valid because we could be clearing the deal out for other uses - CvAssertMsg(eTreaty < NUM_PEACE_TREATY_TYPES, "DEAL: Invalid PeaceTreatyType index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eTreaty >= NO_PEACE_TREATY_TYPE, "DEAL: Invalid PeaceTreatyType index."); // NO_PEACE_TREATY_TYPE is valid because we could be clearing the deal out for other uses + ASSERT(eTreaty < NUM_PEACE_TREATY_TYPES, "DEAL: Invalid PeaceTreatyType index."); m_ePeaceTreatyType = eTreaty; } @@ -3168,8 +3168,8 @@ PlayerTypes CvDeal::GetSurrenderingPlayer() const /// Sets Who (if anyone) is surrendering in this Deal void CvDeal::SetSurrenderingPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); // NO_PLAYER is valid because we could be clearing the deal out for other uses - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index."); // NO_PLAYER is valid because we could be clearing the deal out for other uses + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); m_eSurrenderingPlayer = ePlayer; } @@ -3183,8 +3183,8 @@ PlayerTypes CvDeal::GetDemandingPlayer() const /// Sets Who (if anyone) is making a demand in this Deal void CvDeal::SetDemandingPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); // NO_PLAYER is valid because we could be clearing the deal out for other uses - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index."); // NO_PLAYER is valid because we could be clearing the deal out for other uses + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); m_eDemandingPlayer = ePlayer; } @@ -3198,8 +3198,8 @@ PlayerTypes CvDeal::GetRequestingPlayer() const /// Sets Who (if anyone) is making a request in this Deal void CvDeal::SetRequestingPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); // NO_PLAYER is valid because we could be clearing the deal out for other uses - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= NO_PLAYER, "DEAL: Invalid Player Index."); // NO_PLAYER is valid because we could be clearing the deal out for other uses + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DEAL: Invalid Player Index."); m_eRequestingPlayer = ePlayer; } @@ -3210,8 +3210,8 @@ void CvDeal::SetRequestingPlayer(PlayerTypes ePlayer) /// Insert an immediate gold trade void CvDeal::AddGoldTrade(PlayerTypes eFrom, int iAmount, bool bDoNotRemove) { - CvAssertMsg(iAmount >= 0, "DEAL: Trying to add a negative amount of Gold to a deal. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iAmount >= 0, "DEAL: Trying to add a negative amount of Gold to a deal."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_GOLD, iAmount)) { @@ -3229,10 +3229,10 @@ void CvDeal::AddGoldTrade(PlayerTypes eFrom, int iAmount, bool bDoNotRemove) /// Insert a gold per turn trade void CvDeal::AddGoldPerTurnTrade(PlayerTypes eFrom, int iAmount, int iDuration, bool bDoNotRemove) { - CvAssertMsg(iAmount >= 0, "DEAL: Trying to add a negative amount of GPT to a deal. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iAmount >= 0, "DEAL: Trying to add a negative amount of GPT to a deal."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_GOLD_PER_TURN, iAmount, iDuration)) { @@ -3248,14 +3248,14 @@ void CvDeal::AddGoldPerTurnTrade(PlayerTypes eFrom, int iAmount, int iDuration, } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid GPT amount to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid GPT amount to a deal"); } } /// Insert a map trade void CvDeal::AddMapTrade(PlayerTypes eFrom, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_MAPS)) { @@ -3269,17 +3269,17 @@ void CvDeal::AddMapTrade(PlayerTypes eFrom, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Map item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Map item to a deal"); } } /// Insert a resource trade void CvDeal::AddResourceTrade(PlayerTypes eFrom, ResourceTypes eResource, int iAmount, int iDuration, bool bDoNotRemove) { - CvAssertMsg(iAmount >= 0, "DEAL: Trying to add a negative amount of a Resource to a deal. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iAmount >= 0, "DEAL: Trying to add a negative amount of a Resource to a deal."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_RESOURCES, eResource, iAmount)) { @@ -3296,14 +3296,14 @@ void CvDeal::AddResourceTrade(PlayerTypes eFrom, ResourceTypes eResource, int iA } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Resource to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Resource to a deal"); } } /// Insert a city trade void CvDeal::AddCityTrade(PlayerTypes eFrom, int iCityID, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); CvCity* pCity = GET_PLAYER(eFrom).getCity(iCityID); if (!pCity) @@ -3328,14 +3328,14 @@ void CvDeal::AddCityTrade(PlayerTypes eFrom, int iCityID, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid City to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid City to a deal"); } } /// Insert adding an embassy to the deal void CvDeal::AddAllowEmbassy(PlayerTypes eFrom, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_ALLOW_EMBASSY)) { @@ -3347,16 +3347,16 @@ void CvDeal::AddAllowEmbassy(PlayerTypes eFrom, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Allow Embassy item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Allow Embassy item to a deal"); } } /// Insert an open borders pact void CvDeal::AddOpenBorders(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) { - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_OPEN_BORDERS, iDuration)) { @@ -3371,16 +3371,16 @@ void CvDeal::AddOpenBorders(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Open Borders item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Open Borders item to a deal"); } } /// Insert a defensive pact void CvDeal::AddDefensivePact(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) { - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_DEFENSIVE_PACT, iDuration)) { @@ -3395,16 +3395,16 @@ void CvDeal::AddDefensivePact(PlayerTypes eFrom, int iDuration, bool bDoNotRemov } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Defensive Pact item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Defensive Pact item to a deal"); } } /// Insert a Research Agreement void CvDeal::AddResearchAgreement(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) { - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_RESEARCH_AGREEMENT, iDuration)) { @@ -3419,14 +3419,14 @@ void CvDeal::AddResearchAgreement(PlayerTypes eFrom, int iDuration, bool bDoNotR } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Research Agreement item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Research Agreement item to a deal"); } } /// Insert ending a war void CvDeal::AddPeaceTreaty(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_PEACE_TREATY)) { @@ -3440,14 +3440,14 @@ void CvDeal::AddPeaceTreaty(PlayerTypes eFrom, int iDuration, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Peace Treaty item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Peace Treaty item to a deal"); } } /// Insert going to peace with a third party void CvDeal::AddThirdPartyPeace(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iDuration, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_THIRD_PARTY_PEACE, eThirdPartyTeam)) { @@ -3462,14 +3462,14 @@ void CvDeal::AddThirdPartyPeace(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, in } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Third Party Peace item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Third Party Peace item to a deal"); } } /// Insert going to war with a third party void CvDeal::AddThirdPartyWar(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_THIRD_PARTY_WAR, eThirdPartyTeam)) { @@ -3484,14 +3484,14 @@ void CvDeal::AddThirdPartyWar(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, bool } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Third Party War item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Third Party War item to a deal"); } } /// Insert adding a declaration of peace to the deal void CvDeal::AddDeclarationOfFriendship(PlayerTypes eFrom, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_DECLARATION_OF_FRIENDSHIP)) { @@ -3506,14 +3506,14 @@ void CvDeal::AddDeclarationOfFriendship(PlayerTypes eFrom, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Declaration of Friendship item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Declaration of Friendship item to a deal"); } } /// Insert a vote commitment to the deal void CvDeal::AddVoteCommitment(PlayerTypes eFrom, int iResolutionID, int iVoteChoice, int iNumVotes, bool bRepeal, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_VOTE_COMMITMENT, iResolutionID, iVoteChoice, iNumVotes, bRepeal)) { @@ -3529,13 +3529,13 @@ void CvDeal::AddVoteCommitment(PlayerTypes eFrom, int iResolutionID, int iVoteCh } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Vote Commitment item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Vote Commitment item to a deal"); } } bool CvDeal::ChangeGoldTrade(PlayerTypes eFrom, int iNewAmount) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal!"); int iOldValue = 0; @@ -3565,9 +3565,9 @@ bool CvDeal::ChangeGoldTrade(PlayerTypes eFrom, int iNewAmount) bool CvDeal::ChangeGoldPerTurnTrade(PlayerTypes eFrom, int iNewAmount, int iDuration) { - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal!"); TradedItemList::iterator it; for(it = m_TradedItems.begin(); it != m_TradedItems.end(); ++it) @@ -3664,9 +3664,9 @@ int CvDeal::GetNumStrategicsOnTheirSide(PlayerTypes eFrom) bool CvDeal::ChangeResourceTrade(PlayerTypes eFrom, ResourceTypes eResource, int iAmount, int iDuration) { - CvAssertMsg(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Changing deal item for a player that's not actually in this deal!"); TradedItemList::iterator it; for(it = m_TradedItems.begin(); it != m_TradedItems.end(); ++it) @@ -3841,7 +3841,7 @@ CvDeal::DealRenewStatus CvDeal::GetItemTradeableState(TradeableItems eTradeItem) return DEAL_SUPPLEMENTAL; } - CvAssertMsg(false, "unknown eTradeItem passed in"); + ASSERT(false, "unknown eTradeItem passed in"); return DEAL_NONRENEWABLE; } @@ -4005,8 +4005,8 @@ void CvDeal::ChangeThirdPartyWarDuration(PlayerTypes eFrom, TeamTypes eThirdPart void CvDeal::ChangeThirdPartyPeaceDuration(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iNewDuration) { - CvAssertMsg(iNewDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iNewDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iNewDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem."); + ASSERT(iNewDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); TradedItemList::iterator it; for(it = m_TradedItems.begin(); it != m_TradedItems.end(); ++it) @@ -4060,7 +4060,7 @@ FDataStream& operator<<(FDataStream& saveTo, const CvDeal& readFrom) /// Insert a tech trade void CvDeal::AddTechTrade(PlayerTypes eFrom, TechTypes eTech, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_TECHS, eTech)) { @@ -4075,14 +4075,14 @@ void CvDeal::AddTechTrade(PlayerTypes eFrom, TechTypes eTech, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Tech item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Tech item to a deal"); } } /// Insert Vassalage Trade void CvDeal::AddVassalageTrade(PlayerTypes eFrom, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_VASSALAGE)) { @@ -4094,14 +4094,14 @@ void CvDeal::AddVassalageTrade(PlayerTypes eFrom, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Vassalage item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Vassalage item to a deal"); } } /// Insert Vassalage Trade void CvDeal::AddRevokeVassalageTrade(PlayerTypes eFrom, bool bDoNotRemove) { - CvAssertMsg(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eFrom == m_eFromPlayer || eFrom == m_eToPlayer, "DEAL: Adding deal item for a player that's not actually in this deal!"); if(IsPossibleToTradeItem(eFrom, GetOtherPlayer(eFrom), TRADE_ITEM_VASSALAGE_REVOKE)) { @@ -4113,7 +4113,7 @@ void CvDeal::AddRevokeVassalageTrade(PlayerTypes eFrom, bool bDoNotRemove) } else { - CvAssertMsg(false, "DEAL: Trying to add an invalid Vassalage item to a deal"); + ASSERT(false, "DEAL: Trying to add an invalid Vassalage item to a deal"); } } @@ -5180,10 +5180,10 @@ void CvGameDeals::DoTurn() for (itemIter = it->m_TradedItems.begin(); itemIter != it->m_TradedItems.end(); ++itemIter) { int iFinalTurn = itemIter->m_iFinalTurn; - CvAssertMsg(iFinalTurn >= -1, "DEAL: Trade item has a negative final turn. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iFinalTurn < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a final turn way beyond the end of the game. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(itemIter->m_iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(itemIter->m_eFromPlayer == it->m_eFromPlayer || itemIter->m_eFromPlayer == it->m_eToPlayer, "DEAL: Processing turn for a deal that has an item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iFinalTurn >= -1, "DEAL: Trade item has a negative final turn."); + ASSERT(iFinalTurn < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a final turn way beyond the end of the game."); + ASSERT(itemIter->m_iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(itemIter->m_eFromPlayer == it->m_eFromPlayer || itemIter->m_eFromPlayer == it->m_eToPlayer, "DEAL: Processing turn for a deal that has an item for a player that's not actually in this deal!"); if (iFinalTurn > -1 && iFinalTurn == iGameTurn) { @@ -5208,10 +5208,10 @@ void CvGameDeals::DoTurn() for(itemIter = it->m_TradedItems.begin(); itemIter != it->m_TradedItems.end(); ++itemIter) { int iFinalTurn = itemIter->m_iFinalTurn; - CvAssertMsg(iFinalTurn >= -1, "DEAL: Trade item has a negative final turn. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(iFinalTurn < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a final turn way beyond the end of the game. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(itemIter->m_iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(itemIter->m_eFromPlayer == it->m_eFromPlayer || itemIter->m_eFromPlayer == it->m_eToPlayer, "DEAL: Processing turn for a deal that has an item for a player that's not actually in this deal! Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iFinalTurn >= -1, "DEAL: Trade item has a negative final turn."); + ASSERT(iFinalTurn < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a final turn way beyond the end of the game."); + ASSERT(itemIter->m_iDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid)."); + ASSERT(itemIter->m_eFromPlayer == it->m_eFromPlayer || itemIter->m_eFromPlayer == it->m_eToPlayer, "DEAL: Processing turn for a deal that has an item for a player that's not actually in this deal!"); if(iFinalTurn > -1 && iFinalTurn == iGameTurn) { diff --git a/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp b/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp index b307d42821..de0441c485 100644 --- a/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp @@ -24484,7 +24484,7 @@ void CvDiplomacyAI::SelectBestApproachTowardsMinorCiv(PlayerTypes ePlayer) switch (GET_PLAYER(ePlayer).GetMinorCivAI()->GetPersonality()) { case NO_MINOR_CIV_PERSONALITY_TYPE: - CvAssertMsg(!GET_PLAYER(ePlayer).isMinorCiv(), "Minor missing personality"); + ASSERT(!GET_PLAYER(ePlayer).isMinorCiv(), "Minor missing personality"); break; // Not a minor civ. case MINOR_CIV_PERSONALITY_FRIENDLY: vApproachScores[CIV_APPROACH_FRIENDLY] += vApproachBias[CIV_APPROACH_FRIENDLY] * 2; @@ -27865,8 +27865,8 @@ bool CvDiplomacyAI::IsGoldRequest(PlayerTypes ePlayer, CvDeal* pDeal, int& iWeig /// Are we willing to swap embassies with ePlayer? bool CvDiplomacyAI::IsEmbassyExchangeAcceptable(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); CivApproachTypes eApproach = GetSurfaceApproach(ePlayer); @@ -29163,8 +29163,8 @@ int CvDiplomacyAI::GetOtherPlayerWarmongerScore(PlayerTypes ePlayer) const /// First contact between this player and another void CvDiplomacyAI::DoFirstContact(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index."); if (ePlayer != GetID()) { @@ -29287,10 +29287,10 @@ void CvDiplomacyAI::DoKilledByPlayer(PlayerTypes ePlayer) /// Send a statement to another player void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementTypes eStatement, int iData1, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eStatement >= 0, "DIPLOMACY_AI: Invalid DiploStatementType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eStatement < NUM_DIPLO_STATEMENT_TYPES, "DIPLOMACY_AI: Invalid DiploStatementType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(eStatement >= 0, "DIPLOMACY_AI: Invalid DiploStatementType."); + ASSERT(eStatement < NUM_DIPLO_STATEMENT_TYPES, "DIPLOMACY_AI: Invalid DiploStatementType."); const char* szText = NULL; bool bHuman = GET_PLAYER(ePlayer).isHuman(); @@ -29345,7 +29345,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT if (bHuman) { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if(eMinorCiv != NO_PLAYER) { const char* strMinorCivKey = GET_PLAYER(eMinorCiv).getNameKey(); @@ -29362,7 +29362,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT if (bHuman) { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if (eMinorCiv != NO_PLAYER) { const char* strMinorCivKey = GET_PLAYER(eMinorCiv).getNameKey(); @@ -29374,7 +29374,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if (eMinorCiv != NO_PLAYER) { if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetCivApproach(eMinorCiv) == CIV_APPROACH_WAR) @@ -29396,7 +29396,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT if (bHuman) { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if (eMinorCiv != NO_PLAYER) { const char* strMinorCivKey = GET_PLAYER(eMinorCiv).getNameKey(); @@ -29408,7 +29408,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if (eMinorCiv != NO_PLAYER) { if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetCivApproach(eMinorCiv) == CIV_APPROACH_HOSTILE) @@ -29518,7 +29518,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT if(bHuman) { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if(eMinorCiv != NO_PLAYER) { const char* strMinorCivKey = GET_PLAYER(eMinorCiv).getNameKey(); @@ -29536,7 +29536,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if(eMinorCiv != NO_PLAYER) { if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetCivApproach(eMinorCiv) == CIV_APPROACH_FRIENDLY || GET_PLAYER(ePlayer).GetDiplomacyAI()->GetMinorCivCompetitiveness() > 6) @@ -29575,7 +29575,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT if(bHuman) { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if (eMinorCiv != NO_PLAYER) { const char* strMinorCivKey = GET_PLAYER(eMinorCiv).getNameKey(); @@ -29590,7 +29590,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else { PlayerTypes eMinorCiv = (PlayerTypes) iData1; - CvAssert(eMinorCiv != NO_PLAYER); + ASSERT(eMinorCiv != NO_PLAYER); if(eMinorCiv != NO_PLAYER) { if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetCivApproach(eMinorCiv) == CIV_APPROACH_FRIENDLY || GET_PLAYER(ePlayer).GetDiplomacyAI()->GetMinorCivCompetitiveness() > 6) @@ -29947,7 +29947,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else if(eStatement == DIPLO_STATEMENT_REQUEST_FRIEND_DENOUNCE) { PlayerTypes eTarget = (PlayerTypes) iData1; - CvAssert(eTarget != NO_PLAYER); + ASSERT(eTarget != NO_PLAYER); if(eTarget != NO_PLAYER) { const char* strTargetCivKey = GET_PLAYER(eTarget).getCivilizationShortDescriptionKey(); @@ -30005,7 +30005,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else if (eStatement == DIPLO_STATEMENT_COOP_WAR_REQUEST) { PlayerTypes eAgainstPlayer = (PlayerTypes) iData1; - CvAssert(!IsPlayerValid(eAgainstPlayer)); + ASSERT(!IsPlayerValid(eAgainstPlayer)); if (IsPlayerValid(eAgainstPlayer)) { // Send message to human @@ -30036,7 +30036,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else if(eStatement == DIPLO_STATEMENT_COOP_WAR_TIME) { PlayerTypes eAgainstPlayer = (PlayerTypes) iData1; - CvAssert(eAgainstPlayer != NO_PLAYER); + ASSERT(eAgainstPlayer != NO_PLAYER); if(eAgainstPlayer != NO_PLAYER) { // Send message to human @@ -30474,10 +30474,10 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT else if(eStatement == DIPLO_STATEMENT_SHARE_INTRIGUE) { IntrigueNotificationMessage* pNotificationMessage = GetPlayer()->GetEspionage()->GetRecentIntrigueInfo(ePlayer); - CvAssertMsg(pNotificationMessage, "pNotificationMessage is null. Whut?"); + ASSERT(pNotificationMessage, "pNotificationMessage is null. Whut?"); if (pNotificationMessage) { - CvAssertMsg(pNotificationMessage->m_eSourcePlayer != NO_PLAYER, "There is no plotter! What's going on"); + ASSERT(pNotificationMessage->m_eSourcePlayer != NO_PLAYER, "There is no plotter! What's going on"); PlayerTypes ePlotterPlayer = pNotificationMessage->m_eSourcePlayer; CvIntrigueType eIntrigueType = (CvIntrigueType)pNotificationMessage->m_iIntrigueType; // don't share intrigue about two parties if they are already at war, except for the information that someone has been bribed to go to war @@ -30559,7 +30559,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT szText = GetDiploStringForMessage(DIPLO_MESSAGE_SHARE_INTRIGUE_COOP_WAR, NO_PLAYER, szPlayerName, szBribedPlayerName); break; default: - CvAssertMsg(false, "Unknown intrigue type"); + ASSERT(false, "Unknown intrigue type"); break; } @@ -31179,7 +31179,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT { if(bHuman) { - CvAssertMsg(false, "Don't send vassalage statement to human!"); + ASSERT(false, "Don't send vassalage statement to human!"); } else { @@ -31243,7 +31243,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT } else { - CvAssertMsg(false, "Don't send this message to AI!"); + ASSERT(false, "Don't send this message to AI!"); } } // AI is happy that their taxes were lowered @@ -31256,7 +31256,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT } else { - CvAssertMsg(false, "Don't send this message to AI!"); + ASSERT(false, "Don't send this message to AI!"); } } // AI notifies human that their taxes were RAISED @@ -31269,7 +31269,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT } else { - CvAssertMsg(false, "Don't send this message to AI!"); + ASSERT(false, "Don't send this message to AI!"); } } // AI notifies human that their taxes were LOWERED @@ -31282,7 +31282,7 @@ void CvDiplomacyAI::DoSendStatementToPlayer(PlayerTypes ePlayer, DiploStatementT } else { - CvAssertMsg(false, "Don't send this message to AI!"); + ASSERT(false, "Don't send this message to AI!"); } } @@ -31374,8 +31374,8 @@ void CvDiplomacyAI::DoContactMajorCivs() { PlayerTypes eLoopPlayer = *humanIter; - CvAssert(CvPreGame::isHuman(eLoopPlayer)); - CvAssert(GET_PLAYER(eLoopPlayer).isTurnActive()); + ASSERT(CvPreGame::isHuman(eLoopPlayer)); + ASSERT(GET_PLAYER(eLoopPlayer).isTurnActive()); if (!IsPlayerValid(eLoopPlayer)) continue; @@ -31915,7 +31915,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Could not lookup minor civ's area! Please send Anton your save file and version."); + ASSERT(false, "Could not lookup minor civ's area!"); } // How many units does the city-state have? @@ -32074,7 +32074,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Could not lookup minor civ's area! Please send Anton your save file and version."); + ASSERT(false, "Could not lookup minor civ's area!"); } // How many units does the city-state have? @@ -32583,7 +32583,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Chose a minor to buyout that cannot actually be bought! Please send Anton your save file and version."); + ASSERT(false, "Chose a minor to buyout that cannot actually be bought!"); } } else @@ -32606,7 +32606,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Chose a minor to buyout that cannot actually be bought! Please send Anton your save file and version."); + ASSERT(false, "Chose a minor to buyout that cannot actually be bought!"); } } else @@ -32628,7 +32628,7 @@ void CvDiplomacyAI::DoContactMinorCivs() for (int i = 0; i < veMinorsToBullyAnnex.size(); i++) { eLoopMinor = veMinorsToBullyAnnex.GetElement(i); - CvAssertMsg(eLoopMinor != NO_PLAYER, "Trying to bully-annex NO_PLAYER!"); + ASSERT(eLoopMinor != NO_PLAYER, "Trying to bully-annex NO_PLAYER!"); if (GET_PLAYER(eLoopMinor).GetMinorCivAI()->CanMajorBullyUnit(eID)) { GC.getGame().DoMinorBullyAnnex(eID, eLoopMinor); @@ -32636,7 +32636,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Chose a minor to bully-annex that cannot actually be bullied!"); + ASSERT(false, "Chose a minor to bully-annex that cannot actually be bullied!"); } } } @@ -32716,7 +32716,7 @@ void CvDiplomacyAI::DoContactMinorCivs() for(int i = 0; i < veMinorsToBullyUnit.size(); i++) { eLoopMinor = veMinorsToBullyUnit.GetElement(i); - CvAssertMsg(eLoopMinor != NO_PLAYER, "Trying to bully a unit from NO_PLAYER! Please send Anton your save file and version."); + ASSERT(eLoopMinor != NO_PLAYER, "Trying to bully a unit from NO_PLAYER!"); if(GET_PLAYER(eLoopMinor).GetMinorCivAI()->CanMajorBullyUnit(eID)) { GC.getGame().DoMinorBullyUnit(eID, eLoopMinor); @@ -32724,7 +32724,7 @@ void CvDiplomacyAI::DoContactMinorCivs() } else { - CvAssertMsg(false, "Chose a minor to bully unit from that cannot actually be bullied! Please send Anton your save file and version."); + ASSERT(false, "Chose a minor to bully unit from that cannot actually be bullied!"); } } } @@ -32737,14 +32737,14 @@ void CvDiplomacyAI::DoContactMinorCivs() for(int i = 0; i < veMinorsToBullyGold.size(); i++) { eLoopMinor = veMinorsToBullyGold.GetElement(i); - CvAssertMsg(eLoopMinor != NO_PLAYER, "Trying to bully gold from NO_PLAYER! Please send Anton your save file and version."); + ASSERT(eLoopMinor != NO_PLAYER, "Trying to bully gold from NO_PLAYER!"); if(GET_PLAYER(eLoopMinor).GetMinorCivAI()->CanMajorBullyGold(eID)) { GC.getGame().DoMinorBullyGold(eID, eLoopMinor); } else { - CvAssertMsg(false, "Chose a minor to bully gold from that cannot actually be bullied! Please send Anton your save file and version."); + ASSERT(false, "Chose a minor to bully gold from that cannot actually be bullied!"); } } } @@ -32776,8 +32776,8 @@ void CvDiplomacyAI::DoUpdateMinorCivProtection(PlayerTypes eMinor) /// Possible Contact Statement - Notify human it's time for a coop war they agreed to void CvDiplomacyAI::DoCoopWarTimeStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -32858,8 +32858,8 @@ void CvDiplomacyAI::DoCoopWarTimeStatement(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - Coop War Request void CvDiplomacyAI::DoCoopWarStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GC.getGame().IsCoopWarRequestsDisabled()) return; @@ -32897,8 +32897,8 @@ void CvDiplomacyAI::DoCoopWarStatement(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - Demand void CvDiplomacyAI::DoMakeDemand(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); //End the gift exchange at the start of each round. GetPlayer()->GetDiplomacyAI()->SetOfferingGift(ePlayer, false); @@ -32996,8 +32996,8 @@ void CvDiplomacyAI::DoAggressiveMilitaryStatement(PlayerTypes ePlayer, DiploStat /// Possible Contact Statement - Killed a City-State we're protective towards void CvDiplomacyAI::DoKilledCityStateStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33015,8 +33015,8 @@ void CvDiplomacyAI::DoKilledCityStateStatement(PlayerTypes ePlayer, DiploStateme PlayerTypes eMinorCiv = GetOtherPlayerProtectedMinorKilled(ePlayer); if(eMinorCiv != NO_PLAYER) { - CvAssert(eMinorCiv >= MAX_MAJOR_CIVS); - CvAssert(eMinorCiv < MAX_CIV_PLAYERS); + ASSERT(eMinorCiv >= MAX_MAJOR_CIVS); + ASSERT(eMinorCiv < MAX_CIV_PLAYERS); eStatement = eTempStatement; @@ -33030,8 +33030,8 @@ void CvDiplomacyAI::DoKilledCityStateStatement(PlayerTypes ePlayer, DiploStateme /// Possible Contact Statement - Attacked a City-State we're protective towards void CvDiplomacyAI::DoAttackedCityStateStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33053,8 +33053,8 @@ void CvDiplomacyAI::DoAttackedCityStateStatement(PlayerTypes ePlayer, DiploState PlayerTypes eMinorCiv = GetOtherPlayerProtectedMinorAttacked(ePlayer); if(eMinorCiv != NO_PLAYER) { - CvAssert(eMinorCiv >= MAX_MAJOR_CIVS); - CvAssert(eMinorCiv < MAX_CIV_PLAYERS); + ASSERT(eMinorCiv >= MAX_MAJOR_CIVS); + ASSERT(eMinorCiv < MAX_CIV_PLAYERS); // Minor civ must still be alive! if(GET_PLAYER(eMinorCiv).isAlive()) { @@ -33070,8 +33070,8 @@ void CvDiplomacyAI::DoAttackedCityStateStatement(PlayerTypes ePlayer, DiploState /// Possible Contact Statement - Bullied a City-State we're protective towards void CvDiplomacyAI::DoBulliedCityStateStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. "); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. "); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33114,8 +33114,8 @@ void CvDiplomacyAI::DoBulliedCityStateStatement(PlayerTypes ePlayer, DiploStatem PlayerTypes eMinorCiv = GetOtherPlayerProtectedMinorBullied(ePlayer); if(eMinorCiv != NO_PLAYER) { - CvAssert(eMinorCiv >= MAX_MAJOR_CIVS); - CvAssert(eMinorCiv < MAX_CIV_PLAYERS); + ASSERT(eMinorCiv >= MAX_MAJOR_CIVS); + ASSERT(eMinorCiv < MAX_CIV_PLAYERS); // Minor civ must still be alive! if(GET_PLAYER(eMinorCiv).isAlive()) { @@ -33186,8 +33186,8 @@ void CvDiplomacyAI::DoPlotBuyingWarningStatement(PlayerTypes ePlayer, DiploState /// Possible Contact Statement - Tell the player he broke his Plot Buying promise void CvDiplomacyAI::DoPlotBuyingBrokenPromiseStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33205,8 +33205,8 @@ void CvDiplomacyAI::DoPlotBuyingBrokenPromiseStatement(PlayerTypes ePlayer, Dipl /// Possible Contact Statement - We attacked a minor that is protected by someone void CvDiplomacyAI::DoWeAttackedYourMinorStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33236,8 +33236,8 @@ void CvDiplomacyAI::DoWeAttackedYourMinorStatement(PlayerTypes ePlayer, DiploSta int iTurnsBetweenStatements = 1; if(GetNumTurnsSinceStatementSent(ePlayer, eTempStatement) >= iTurnsBetweenStatements) { - CvAssert(eMinor >= MAX_MAJOR_CIVS); - CvAssert(eMinor < MAX_CIV_PLAYERS); + ASSERT(eMinor >= MAX_MAJOR_CIVS); + ASSERT(eMinor < MAX_CIV_PLAYERS); eStatement = eTempStatement; iData1 = eMinor; @@ -33252,8 +33252,8 @@ void CvDiplomacyAI::DoWeAttackedYourMinorStatement(PlayerTypes ePlayer, DiploSta /// Possible Contact Statement - We bullied a minor that is protected by someone void CvDiplomacyAI::DoWeBulliedYourMinorStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. "); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. "); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33283,8 +33283,8 @@ void CvDiplomacyAI::DoWeBulliedYourMinorStatement(PlayerTypes ePlayer, DiploStat if(GetNumTurnsSinceStatementSent(ePlayer, eTempStatement) >= iTurnsBetweenStatements) { - CvAssert(eMinor >= MAX_MAJOR_CIVS); - CvAssert(eMinor < MAX_CIV_PLAYERS); + ASSERT(eMinor >= MAX_MAJOR_CIVS); + ASSERT(eMinor < MAX_CIV_PLAYERS); eStatement = eTempStatement; iData1 = eMinor; @@ -33299,8 +33299,8 @@ void CvDiplomacyAI::DoWeBulliedYourMinorStatement(PlayerTypes ePlayer, DiploStat /// Possible Contact Statement - We caught this player spying on us void CvDiplomacyAI::DoCaughtYourSpyStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33324,8 +33324,8 @@ void CvDiplomacyAI::DoCaughtYourSpyStatement(PlayerTypes ePlayer, DiploStatement /// Possible Contact Statement - We killed this player's spy void CvDiplomacyAI::DoKilledYourSpyStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33374,8 +33374,8 @@ void CvDiplomacyAI::DoKilledMySpyStatement(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - Share intrigue with this player void CvDiplomacyAI::DoShareIntrigueStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33432,8 +33432,8 @@ void CvDiplomacyAI::DoShareIntrigueStatement(PlayerTypes ePlayer, DiploStatement /// Possible Contact Statement - They converted one of our cities, and we want them to stop that void CvDiplomacyAI::DoConvertedMyCityStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33453,8 +33453,8 @@ void CvDiplomacyAI::DoConvertedMyCityStatement(PlayerTypes ePlayer, DiploStateme /// Possible Contact Statement - They dug up one of our artifacts, and we want them to stop that void CvDiplomacyAI::DoDugUpMyYardStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send slewis your save file and version."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33478,8 +33478,8 @@ void CvDiplomacyAI::DoDugUpMyYardStatement(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - We want to make a Declaration of Friendship with them void CvDiplomacyAI::DoDoFStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsFriendshipRequestsDisabled()) return; @@ -33523,8 +33523,8 @@ void CvDiplomacyAI::DoDoFStatement(PlayerTypes ePlayer, DiploStatementTypes& eSt /// Possible Contact Statement - We're denouncing one of our friends (backstabbing) void CvDiplomacyAI::DoDenounceFriendStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33543,8 +33543,8 @@ void CvDiplomacyAI::DoDenounceFriendStatement(PlayerTypes ePlayer, DiploStatemen /// Possible Contact Statement - We're ending our Declaration of Friendship with them void CvDiplomacyAI::DoEndDoFStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) const { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33563,8 +33563,8 @@ void CvDiplomacyAI::DoEndDoFStatement(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - We're denouncing a player void CvDiplomacyAI::DoDenounceStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33597,8 +33597,8 @@ void CvDiplomacyAI::DoDenounceStatement(PlayerTypes ePlayer, DiploStatementTypes /// Possible Contact Statement - We're requesting that a player denounce someone void CvDiplomacyAI::DoRequestFriendDenounceStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -33630,8 +33630,8 @@ void CvDiplomacyAI::DoRequestFriendDenounceStatement(PlayerTypes ePlayer, DiploS /// Possible Contact Statement - Luxury Trade void CvDiplomacyAI::DoLuxuryTrade(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33660,8 +33660,8 @@ void CvDiplomacyAI::DoLuxuryTrade(PlayerTypes ePlayer, DiploStatementTypes& eSta /// Possibile Contact Statement - Embassy Exchange void CvDiplomacyAI::DoEmbassyExchange(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33729,8 +33729,8 @@ void CvDiplomacyAI::DoEmbassyExchange(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - Embassy void CvDiplomacyAI::DoEmbassyOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33767,8 +33767,8 @@ void CvDiplomacyAI::DoEmbassyOffer(PlayerTypes ePlayer, DiploStatementTypes& eSt /// Possible Contact Statement - Open Borders Exchange void CvDiplomacyAI::DoOpenBordersExchange(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33820,8 +33820,8 @@ void CvDiplomacyAI::DoOpenBordersExchange(PlayerTypes ePlayer, DiploStatementTyp /// Possible Contact Statement - Open Borders void CvDiplomacyAI::DoOpenBordersOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33858,8 +33858,8 @@ void CvDiplomacyAI::DoOpenBordersOffer(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - Research Agreement Offer void CvDiplomacyAI::DoResearchAgreementOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33895,8 +33895,8 @@ void CvDiplomacyAI::DoResearchAgreementOffer(PlayerTypes ePlayer, DiploStatement /// Possible Contact Statement - Strategic Resource Offer void CvDiplomacyAI::DoStrategicTrade(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33925,8 +33925,8 @@ void CvDiplomacyAI::DoStrategicTrade(PlayerTypes ePlayer, DiploStatementTypes& e /// Possible Contact Statement - Defensive Pact Offer void CvDiplomacyAI::DoDefensivePactOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -33961,8 +33961,8 @@ void CvDiplomacyAI::DoDefensivePactOffer(PlayerTypes ePlayer, DiploStatementType /// Possible Contact Statement - City Exchange void CvDiplomacyAI::DoCityExchange(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsTradeOffersDisabled()) return; @@ -33988,8 +33988,8 @@ void CvDiplomacyAI::DoCityExchange(PlayerTypes ePlayer, DiploStatementTypes& eSt /// Possible Contact Statement - Third Party War Trade void CvDiplomacyAI::DoThirdPartyWarTrade(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsTradeOffersDisabled()) return; @@ -34017,8 +34017,8 @@ void CvDiplomacyAI::DoThirdPartyWarTrade(PlayerTypes ePlayer, DiploStatementType /// Possible Contact Statement - Peace Trade void CvDiplomacyAI::DoThirdPartyPeaceTrade(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsTradeOffersDisabled()) return; @@ -34046,8 +34046,8 @@ void CvDiplomacyAI::DoThirdPartyPeaceTrade(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - Vote Trade void CvDiplomacyAI::DoVoteTrade(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -34076,8 +34076,8 @@ void CvDiplomacyAI::DoVoteTrade(PlayerTypes ePlayer, DiploStatementTypes& eState /// Possible Contact Statement - Renew Recently Expired Deal CvDeal* CvDiplomacyAI::DoRenewExpiredDeal(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); CvGameDeals& kGameDeals = GC.getGame().GetGameDeals(); @@ -34178,8 +34178,8 @@ CvDeal* CvDiplomacyAI::DoRenewExpiredDeal(PlayerTypes ePlayer, DiploStatementTyp /// Possible Contact Statement - Request Help void CvDiplomacyAI::DoRequest(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsHelpRequestsDisabled()) return; @@ -34224,8 +34224,8 @@ void CvDiplomacyAI::DoRequest(PlayerTypes ePlayer, DiploStatementTypes& eStateme /// Possible Contact Statement - Gift void CvDiplomacyAI::DoGift(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -34268,8 +34268,8 @@ void CvDiplomacyAI::DoGift(PlayerTypes ePlayer, DiploStatementTypes& eStatement, /// Possible Contact Statement //void CvDiplomacyAI::DoNowUnforgivableStatement(PlayerTypes ePlayer, DiploStatementTypes &eStatement) //{ -// CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); -// CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); +// ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); +// ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); // // if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsInsultMessagesDisabled()) // return; @@ -34304,8 +34304,8 @@ void CvDiplomacyAI::DoGift(PlayerTypes ePlayer, DiploStatementTypes& eStatement, /// Possible Contact Statement //void CvDiplomacyAI::DoNowEnemyStatement(PlayerTypes ePlayer, DiploStatementTypes &eStatement) //{ -// CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); -// CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); +// ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); +// ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); // // if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsInsultMessagesDisabled()) // return; @@ -34344,8 +34344,8 @@ void CvDiplomacyAI::DoGift(PlayerTypes ePlayer, DiploStatementTypes& eStatement, /// Possible Contact Statement - Approach towards player is now HOSTILE void CvDiplomacyAI::DoHostileStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34386,8 +34386,8 @@ void CvDiplomacyAI::DoHostileStatement(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement //void CvDiplomacyAI::DoFriendlyStatement(PlayerTypes ePlayer, DiploStatementTypes &eStatement) //{ -// CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); -// CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); +// ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); +// ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); // // if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) // return; @@ -34412,8 +34412,8 @@ void CvDiplomacyAI::DoHostileStatement(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - Approach towards player is now AFRAID void CvDiplomacyAI::DoAfraidStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -34436,8 +34436,8 @@ void CvDiplomacyAI::DoAfraidStatement(PlayerTypes ePlayer, DiploStatementTypes& /// Possible Contact Statement - Warning the player about their warmongering void CvDiplomacyAI::DoWarmongerStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34480,8 +34480,8 @@ void CvDiplomacyAI::DoWarmongerStatement(PlayerTypes ePlayer, DiploStatementType /// Possible Contact Statement - Warning the player that we don't like their interactions with "our" City-States void CvDiplomacyAI::DoMinorCivCompetitionStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1, bool bIgnoreTurnsBetweenLimit) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34552,8 +34552,8 @@ void CvDiplomacyAI::DoMinorCivCompetitionStatement(PlayerTypes ePlayer, DiploSta /// Possible Contact Statement - We're angry that they befriended a player we denounced void CvDiplomacyAI::DoAngryBefriendedEnemy(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34629,8 +34629,8 @@ void CvDiplomacyAI::DoAngryBefriendedEnemy(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - We're angry that they denounced one of our friends void CvDiplomacyAI::DoAngryDenouncedFriend(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34706,8 +34706,8 @@ void CvDiplomacyAI::DoAngryDenouncedFriend(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - We're happy that they denounced a player we denounced void CvDiplomacyAI::DoHappyDenouncedEnemy(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -34776,8 +34776,8 @@ void CvDiplomacyAI::DoHappyDenouncedEnemy(PlayerTypes ePlayer, DiploStatementTyp /// Possible Contact Statement - We're happy they befriended one of our friends void CvDiplomacyAI::DoHappyBefriendedFriend(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -34846,8 +34846,8 @@ void CvDiplomacyAI::DoHappyBefriendedFriend(PlayerTypes ePlayer, DiploStatementT /// Possible Contact Statement - Peace void CvDiplomacyAI::DoPeaceOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsPeaceOffersDisabled()) return; @@ -34898,8 +34898,8 @@ void CvDiplomacyAI::DoPeaceOffer(PlayerTypes ePlayer, DiploStatementTypes& eStat /// Possible Contact Statement - We befriended one of the human's enemies and we're letting them know void CvDiplomacyAI::DoFYIBefriendedHumanEnemy(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -34988,8 +34988,8 @@ void CvDiplomacyAI::DoFYIBefriendedHumanEnemy(PlayerTypes ePlayer, DiploStatemen /// Possible Contact Statement - We denounced one of the human's friends and we're letting them know void CvDiplomacyAI::DoFYIDenouncedHumanFriend(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (WasResurrectedBy(ePlayer)) return; @@ -35078,8 +35078,8 @@ void CvDiplomacyAI::DoFYIDenouncedHumanFriend(PlayerTypes ePlayer, DiploStatemen /// Possible Contact Statement - We denounced someone the human has denounced and we're letting them know void CvDiplomacyAI::DoFYIDenouncedHumanEnemy(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -35168,8 +35168,8 @@ void CvDiplomacyAI::DoFYIDenouncedHumanEnemy(PlayerTypes ePlayer, DiploStatement /// Possible Contact Statement - We befriended one of the human's friends, and we're letting them know void CvDiplomacyAI::DoFYIBefriendedHumanFriend(PlayerTypes ePlayer, DiploStatementTypes& eStatement, int& iData1) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -35269,8 +35269,8 @@ void CvDiplomacyAI::DoFYIBefriendedHumanFriend(PlayerTypes ePlayer, DiploStateme /// Possible Contact Statement - We're happy we're following the same ideology as the human void CvDiplomacyAI::DoHappySamePolicyTree(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -35334,8 +35334,8 @@ void CvDiplomacyAI::DoHappySamePolicyTree(PlayerTypes ePlayer, DiploStatementTyp /// Possible Contact Statement - Either AI or human has switched ideologies due to the other's pressure void CvDiplomacyAI::DoIdeologicalStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); PolicyBranchTypes eFreedom = (PolicyBranchTypes)GD_INT_GET(POLICY_BRANCH_FREEDOM); PolicyBranchTypes eOrder = (PolicyBranchTypes)GD_INT_GET(POLICY_BRANCH_ORDER); @@ -35476,8 +35476,8 @@ void CvDiplomacyAI::DoIdeologicalStatement(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - Message to human if the AI thinks they are getting close to the victory they're also going for. void CvDiplomacyAI::DoVictoryCompetitionStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (!IsCompetingForVictory()) return; @@ -35635,8 +35635,8 @@ void CvDiplomacyAI::DoVictoryCompetitionStatement(PlayerTypes ePlayer, DiploStat /// Possible Contact Statement - Message to human if the AI thinks they are getting close to a victory that they're not going for. void CvDiplomacyAI::DoVictoryBlockStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (!IsCompetingForVictory()) return; @@ -35716,8 +35716,8 @@ void CvDiplomacyAI::DoVictoryBlockStatement(PlayerTypes ePlayer, DiploStatementT /// Possible Contact Statement - We liked the human's proposal to the World Congress void CvDiplomacyAI::DoWeLikedTheirProposal(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -35765,8 +35765,8 @@ void CvDiplomacyAI::DoWeLikedTheirProposal(PlayerTypes ePlayer, DiploStatementTy /// Possible Contact Statement - We disliked the human's proposal to the World Congress void CvDiplomacyAI::DoWeDislikedTheirProposal(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsInsultMessagesDisabled()) return; @@ -35818,8 +35818,8 @@ void CvDiplomacyAI::DoWeDislikedTheirProposal(PlayerTypes ePlayer, DiploStatemen /// Possible Contact Statement - The human helped our proposal pass in the World Congress void CvDiplomacyAI::DoTheySupportedOurProposal(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -35868,8 +35868,8 @@ void CvDiplomacyAI::DoTheySupportedOurProposal(PlayerTypes ePlayer, DiploStateme /// Possible Contact Statement - The human helped our proposal fail in the World Congress void CvDiplomacyAI::DoTheyFoiledOurProposal(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsInsultMessagesDisabled()) return; @@ -35922,8 +35922,8 @@ void CvDiplomacyAI::DoTheyFoiledOurProposal(PlayerTypes ePlayer, DiploStatementT /// Possible Contact Statement - The human helped relocate the World Congress to our lands void CvDiplomacyAI::DoTheySupportedOurHosting(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsComplimentMessagesDisabled()) return; @@ -36025,10 +36025,10 @@ const char* CvDiplomacyAI::GetDiploStringForMessage(DiploMessageTypes eDiploMess const char* CvDiplomacyAI::GetDiploStringForMessage(DiploMessageTypes eDiploMessage, PlayerTypes eForPlayer, const Localization::String& strOptionalKey1, const Localization::String& strOptionalKey2) { - CvAssertMsg(eDiploMessage >= 0, "DIPLOMACY_AI: Invalid DiploMessageType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eDiploMessage < NUM_DIPLO_MESSAGE_TYPES, "DIPLOMACY_AI: Invalid DiploMessageType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eForPlayer >= NO_PLAYER, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); // NO_PLAYER is valid because eForPlayer is used when we need specific data (e.g. for declaring war) - CvAssertMsg(eForPlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eDiploMessage >= 0, "DIPLOMACY_AI: Invalid DiploMessageType."); + ASSERT(eDiploMessage < NUM_DIPLO_MESSAGE_TYPES, "DIPLOMACY_AI: Invalid DiploMessageType."); + ASSERT(eForPlayer >= NO_PLAYER, "DIPLOMACY_AI: Invalid Player Index."); // NO_PLAYER is valid because eForPlayer is used when we need specific data (e.g. for declaring war) + ASSERT(eForPlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); EraTypes eCurrentEra = GC.getGame().getCurrentEra(); int iMessage = 0; @@ -37637,8 +37637,8 @@ const char* CvDiplomacyAI::GetDiploStringForMessage(DiploMessageTypes eDiploMess // Should always have a state we're handling default: - strText = "NO MESSAGE. Trying to get Diplo string. Something has gone wrong, somehow. Please send Jon this with your last 5 autosaves and what changelist # you're playing."; - CvAssert(false); + strText = "NO MESSAGE. Trying to get Diplo string. Something has gone wrong, somehow."; + ASSERT(false); break; } @@ -37649,8 +37649,8 @@ const char* CvDiplomacyAI::GetDiploStringForMessage(DiploMessageTypes eDiploMess /// Message from UI to gameplay about something that should happen with regards to diplomacy void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEventTypes eEvent, int iArg1, int iArg2) { - CvAssertMsg(eEvent >= 0, "DIPLOMACY_AI: Invalid FromUIDiploEventType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(eEvent < NUM_FROM_UI_DIPLO_EVENTS, "DIPLOMACY_AI: Invalid FromUIDiploEventType. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(eEvent >= 0, "DIPLOMACY_AI: Invalid FromUIDiploEventType."); + ASSERT(eEvent < NUM_FROM_UI_DIPLO_EVENTS, "DIPLOMACY_AI: Invalid FromUIDiploEventType."); const char* strText = ""; @@ -38121,8 +38121,8 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent { // **** NOTE **** - iArg1 is BUTTON ID, iArg2 is MINOR ID from DiscussionDialog.lua PlayerTypes eMinor = (PlayerTypes) iArg2; - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. "); + ASSERT(eMinor < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. "); if (eMinor < MAX_MAJOR_CIVS || eMinor >= MAX_CIV_PLAYERS) { // Fail gracefully, allow UI to continue @@ -38132,7 +38132,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent } CvPlayer* pMinor = &GET_PLAYER(eMinor); - CvAssertMsg(pMinor, "Error triggering gameplay effects for diplomacy event involving a Protected city-state. Please send Anton your save file and version."); + ASSERT(pMinor, "Error triggering gameplay effects for diplomacy event involving a Protected city-state."); if (!pMinor) { // Fail gracefully, allow UI to continue @@ -38141,7 +38141,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent break; } - CvAssertMsg(pMinor->GetMinorCivAI()->IsProtectedByMajor(eFromPlayer), "Diplomacy event involving a Protected city-state when there was no Pledge active. Please send Anton your save file and Version."); + ASSERT(pMinor->GetMinorCivAI()->IsProtectedByMajor(eFromPlayer), "Diplomacy event involving a Protected city-state when there was no Pledge active."); // Human says he forgives the AI if (iArg1 == 1) @@ -38293,8 +38293,8 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent { // **** NOTE **** - iArg1 is BUTTON ID, iArg2 is MINOR ID from DiscussionDialog.lua PlayerTypes eMinor = (PlayerTypes) iArg2; - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version."); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. "); + ASSERT(eMinor < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. "); if (eMinor < MAX_MAJOR_CIVS || eMinor >= MAX_CIV_PLAYERS) { // Fail gracefully, allow UI to continue @@ -38304,7 +38304,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent } CvPlayer* pMinor = &GET_PLAYER(eMinor); - CvAssertMsg(pMinor, "Error triggering gameplay effects for breaking a Pledge to Protect a city-state. Please send Anton your save file and version."); + ASSERT(pMinor, "Error triggering gameplay effects for breaking a Pledge to Protect a city-state."); if (!pMinor) { // Fail gracefully, allow UI to continue @@ -38313,7 +38313,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent break; } - CvAssertMsg(pMinor->GetMinorCivAI()->IsProtectedByMajor(eFromPlayer), "Diplomacy event involving a Protected city-state when there was no Pledge active. Please send Anton your save file and Version."); + ASSERT(pMinor->GetMinorCivAI()->IsProtectedByMajor(eFromPlayer), "Diplomacy event involving a Protected city-state when there was no Pledge active."); // Human says he forgives the AI if(iArg1 == 1) @@ -39306,7 +39306,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent { PlayerTypes ePlottingPlayer = (PlayerTypes)iArg1; CvIntrigueType eIntrigueType = (CvIntrigueType)iArg2; - CvAssert(CvPlayerAI::IsValid(ePlottingPlayer)); + ASSERT(CvPlayerAI::IsValid(ePlottingPlayer)); if (CvPlayerAI::IsValid(ePlottingPlayer)) { ChangeNumTimesIntrigueSharedBy(eFromPlayer, 1); @@ -39815,7 +39815,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent // Something happened! (will generate an error message) else { - CvAssert(false); + ASSERT(false); if (bActivePlayer) { @@ -39828,7 +39828,7 @@ void CvDiplomacyAI::DoFromUIDiploEvent(PlayerTypes eFromPlayer, FromUIDiploEvent // Should always have a state we're handling default: - CvAssert(false); + ASSERT(false); break; } } @@ -40230,8 +40230,8 @@ const char* CvDiplomacyAI::GetOfferText(PlayerTypes ePlayer) /// The AI is denouncing the human int CvDiplomacyAI::GetDenounceMessage(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); int iMessage = 0; if(GetPlayer()->isHuman()) @@ -40785,10 +40785,10 @@ const char* CvDiplomacyAI::GetAttackedByHumanMessage() /// The AI is declaring war on a human, what does he say? const char* CvDiplomacyAI::GetWarMessage(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); - const char* strText = "OMG I HAVE NO DATA (DECLARING WAR) - Please send Jon this with your last 5 autosaves and what changelist # you're playing."; + const char* strText = "OMG I HAVE NO DATA (DECLARING WAR)"; // Only show the message for the active human if(GC.getGame().getActivePlayer() == ePlayer) @@ -40862,10 +40862,10 @@ const char* CvDiplomacyAI::GetWarMessage(PlayerTypes ePlayer) /// The AI is breaking up with the human const char* CvDiplomacyAI::GetEndDoFMessage(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); - const char* strText = "OMG I HAVE NO DATA (DECLARING WAR) - Please send Jon this with your last 5 autosaves and what changelist # you're playing."; + const char* strText = "OMG I HAVE NO DATA (DECLARING WAR)"; // Guy is a warmonger if(GetWarmongerThreat(ePlayer) >= THREAT_MAJOR) @@ -40900,10 +40900,10 @@ const char* CvDiplomacyAI::GetEndDoFMessage(PlayerTypes ePlayer) /// The AI is done working against someone const char* CvDiplomacyAI::GetEndWorkAgainstSomeoneMessage(PlayerTypes ePlayer, const Localization::String& strAgainstPlayerKey) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); - const char* strText = "OMG I HAVE NO DATA (DECLARING WAR) - Please send Jon this with your last 5 autosaves and what changelist # you're playing."; + const char* strText = "OMG I HAVE NO DATA (DECLARING WAR)"; if(ePlayer >=0 && ePlayer < MAX_MAJOR_CIVS) strText = GetDiploTextFromTag("RESPONSE_END_WORK_AGAINST_SOMEONE_DEFAULT", strAgainstPlayerKey); @@ -43407,8 +43407,8 @@ bool CvDiplomacyAI::IsPlayerOpposingIdeology(PlayerTypes ePlayer) const /// Denounces a player void CvDiplomacyAI::DoDenouncePlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); PlayerTypes eMyPlayer = GetID(); TeamTypes eMyTeam = GetTeam(); @@ -54287,8 +54287,8 @@ bool CvDiplomacyAIHelpers::IgnoresBackstabbing(PlayerTypes eObserver, PlayerType /// Possible Contact Statement - AI only void CvDiplomacyAI::DoMakeVassalageStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GET_PLAYER(ePlayer).isHuman() && GC.getGame().IsTradeOffersDisabled()) return; @@ -54320,8 +54320,8 @@ void CvDiplomacyAI::DoMakeVassalageStatement(PlayerTypes ePlayer, DiploStatement /// Possible Contact Statement - AI only void CvDiplomacyAI::DoBecomeVassalageStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (IsAvoidDeals()) return; @@ -54354,8 +54354,8 @@ void CvDiplomacyAI::DoBecomeVassalageStatement(PlayerTypes ePlayer, DiploStateme /// Possible Contact Statement - Vassal taxes have been raised void CvDiplomacyAI::DoVassalTaxesRaisedStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -54402,8 +54402,8 @@ void CvDiplomacyAI::DoVassalTaxesRaisedStatement(PlayerTypes ePlayer, DiploState /// Possible Contact Statement - Vassal taxes have been lowered void CvDiplomacyAI::DoVassalTaxesLoweredStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -54451,8 +54451,8 @@ void CvDiplomacyAI::DoVassalTaxesLoweredStatement(PlayerTypes ePlayer, DiploStat /// Possible Contact Statement - Vassal has been liberated void CvDiplomacyAI::DoLiberateMyVassalStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -54951,8 +54951,8 @@ bool CvDiplomacyAI::IsWantToLiberateVassal(PlayerTypes ePlayer, int& iScoreForLi /// Possible Contact Statement - Third-party offer for ePlayer to liberate their vassals void CvDiplomacyAI::DoRevokeVassalageStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); // note: we check to see if it's possible in IsMakeOfferForVassalage() @@ -56312,8 +56312,8 @@ bool CvDiplomacyAI::IsEndVassalageRequestAcceptable(PlayerTypes ePlayer) /// Possible Contact Statement - We're done being ePlayer's vassal void CvDiplomacyAI::DoEndVassalageStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); // Don't send this to an AI teammate of a human if (GET_PLAYER(ePlayer).IsAITeammateOfHuman()) @@ -56343,8 +56343,8 @@ void CvDiplomacyAI::DoEndVassalageStatement(PlayerTypes ePlayer, DiploStatementT /// Possible Contact Statement - World Map void CvDiplomacyAI::DoMapsOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GetPlayer()->IsAITeammateOfHuman()) return; @@ -56377,8 +56377,8 @@ void CvDiplomacyAI::DoMapsOffer(PlayerTypes ePlayer, DiploStatementTypes& eState /// Possible Contact Statement - Purchase technology void CvDiplomacyAI::DoTechOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GetPlayer()->IsAITeammateOfHuman()) return; @@ -56404,8 +56404,8 @@ void CvDiplomacyAI::DoTechOffer(PlayerTypes ePlayer, DiploStatementTypes& eState /// Possible Contact Statement - Generous Offer void CvDiplomacyAI::DoGenerousOffer(PlayerTypes ePlayer, DiploStatementTypes& eStatement, CvDeal* pDeal) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if(eStatement == NO_DIPLO_STATEMENT_TYPE) { @@ -56491,8 +56491,8 @@ bool CvDiplomacyAI::IsTechRequest(PlayerTypes ePlayer, CvDeal* pDeal, int& iWeig /// Do we want to trade world maps with eOtherPlayer? - this is only used for when to trigger an AI request, not whether or not the AI will accept a deal period bool CvDiplomacyAI::WantsMapsFromPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index."); if (GetPlayer()->IsAITeammateOfHuman()) return false; diff --git a/CvGameCoreDLL_Expansion2/CvDiplomacyRequests.cpp b/CvGameCoreDLL_Expansion2/CvDiplomacyRequests.cpp index fc231a29fd..5f2953852d 100644 --- a/CvGameCoreDLL_Expansion2/CvDiplomacyRequests.cpp +++ b/CvGameCoreDLL_Expansion2/CvDiplomacyRequests.cpp @@ -277,8 +277,8 @@ void CvDiplomacyRequests::ActivateNext() if (m_eRequestActiveFromPlayer == NO_PLAYER) return; - CvAssert(GC.getGame().getActivePlayer() == m_ePlayer); - CvAssert(GET_PLAYER(m_ePlayer).isTurnActive()); + ASSERT(GC.getGame().getActivePlayer() == m_ePlayer); + ASSERT(GET_PLAYER(m_ePlayer).isTurnActive()); RequestList::iterator requestIter; for (requestIter = m_aRequests.begin(); requestIter != m_aRequests.end(); ++requestIter) @@ -414,7 +414,7 @@ void CvDiplomacyRequests::ActivateNext() // ---------------------------------------------------------------------------- void CvDiplomacyRequests::ActivateAllFrom(PlayerTypes eFromPlayer) { - CvAssertMsg(!HasActiveRequest(), "There should not be any active requests, if the player was able to start Diplomacy with AI ..."); + ASSERT(!HasActiveRequest(), "There should not be any active requests, if the player was able to start Diplomacy with AI ..."); m_eRequestActiveFromPlayer = eFromPlayer; Update(); } @@ -546,15 +546,15 @@ void CvDiplomacyRequests::SendDealRequest(PlayerTypes eFromPlayer, PlayerTypes e if(GC.getGame().isReallyNetworkMultiPlayer() && MOD_ACTIVE_DIPLOMACY) { - CvAssert(eFromPlayer != NO_PLAYER); - CvAssertMsg(!GET_PLAYER(eFromPlayer).isHuman(), "CvDiplomacyRequests::SendDealRequest must not be used by a human player!"); + ASSERT(eFromPlayer != NO_PLAYER); + ASSERT(!GET_PLAYER(eFromPlayer).isHuman(), "CvDiplomacyRequests::SendDealRequest must not be used by a human player!"); CvPlayer& kTo = GET_PLAYER(eToPlayer); CvDiplomacyRequests* pDiploRequests = kTo.GetDiplomacyRequests(); if (pDiploRequests && pkDeal) { - CvAssert(pkDeal->GetFromPlayer() == eFromPlayer); - CvAssert(pkDeal->GetToPlayer() == eToPlayer); + ASSERT(pkDeal->GetFromPlayer() == eFromPlayer); + ASSERT(pkDeal->GetToPlayer() == eToPlayer); GC.getGame().GetGameDeals().AddProposedDeal(*pkDeal); // propose the deal (needed for activation...) pDiploRequests->Add(eFromPlayer, eDiploType, pszMessage, eAnimationType, -1); } @@ -574,8 +574,8 @@ void CvDiplomacyRequests::SendDealRequest(PlayerTypes eFromPlayer, PlayerTypes e CvDiplomacyRequests* pDiploRequests = kTo.GetDiplomacyRequests(); if (pDiploRequests && pkDeal && pkDeal->m_bConsideringForRenewal) { - CvAssert(pkDeal->GetFromPlayer() == eFromPlayer); - CvAssert(pkDeal->GetToPlayer() == eToPlayer); + ASSERT(pkDeal->GetFromPlayer() == eFromPlayer); + ASSERT(pkDeal->GetToPlayer() == eToPlayer); CvGameDeals::PrepareRenewDeal(pkDeal); pDiploRequests->Add(eFromPlayer, eDiploType, pszMessage, eAnimationType, -1); } @@ -593,7 +593,7 @@ void CvDiplomacyRequests::DoAIDiplomacy(PlayerTypes eTargetPlayer) { ICvUserInterface2* pkIFace = GC.GetEngineUserInterface(); // WARNING: Processing depends on the state of the interface! - CvAssert(!CvPreGame::isNetworkMultiplayerGame()); + ASSERT(!CvPreGame::isNetworkMultiplayerGame()); // Don't process while a modal dialog is up or another diplo or popup is up. if(pkIFace->IsModalStackEmpty() && !pkIFace->isDiploOrPopupWaiting() && !pkIFace->isCityScreenUp()) diff --git a/CvGameCoreDLL_Expansion2/CvDllBuildInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllBuildInfo.cpp index 81db5e5892..3e6c3762e6 100644 --- a/CvGameCoreDLL_Expansion2/CvDllBuildInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllBuildInfo.cpp @@ -13,7 +13,7 @@ CvDllBuildInfo::CvDllBuildInfo(CvBuildInfo* pBuildInfo) : m_pBuildInfo(pBuildInfo) , m_uiRefCount(1) { - FAssertMsg(pBuildInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pBuildInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllBuildInfo::~CvDllBuildInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllCivilizationInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllCivilizationInfo.cpp index 9d8b8144a9..b0f7f283a3 100644 --- a/CvGameCoreDLL_Expansion2/CvDllCivilizationInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllCivilizationInfo.cpp @@ -13,7 +13,7 @@ CvDllCivilizationInfo::CvDllCivilizationInfo(CvCivilizationInfo* pCivilizationIn : m_pCivilizationInfo(pCivilizationInfo) , m_uiRefCount(1) { - FAssertMsg(pCivilizationInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pCivilizationInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllCivilizationInfo::~CvDllCivilizationInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllColorInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllColorInfo.cpp index 8cfbf87c0f..a886fb6f0c 100644 --- a/CvGameCoreDLL_Expansion2/CvDllColorInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllColorInfo.cpp @@ -13,7 +13,7 @@ CvDllColorInfo::CvDllColorInfo(CvColorInfo* pColorInfo) : m_pColorInfo(pColorInfo) , m_uiRefCount(1) { - FAssertMsg(pColorInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pColorInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllColorInfo::~CvDllColorInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.cpp b/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.cpp index b60a306353..46367775fa 100644 --- a/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.cpp @@ -178,7 +178,7 @@ bool CvDllDatabaseUtility::CacheGameDatabaseData() //Log Database Memory statistics LogMsg(DB.CalculateMemoryStats()); - CvAssertMsg(bSuccess, "Failed to load Gameplay Database Data! Not Good!"); + ASSERT(bSuccess, "Failed to load Gameplay Database Data! Not Good!"); GC.GameDataPostCache(); @@ -416,7 +416,7 @@ bool CvDllDatabaseUtility::PrefetchGameData() while(kResults.Step()) { const int iFlavor = kResults.GetInt("ID"); - CvAssert(iFlavor >= 0 && iFlavor < iNumFlavors); + ASSERT(iFlavor >= 0 && iFlavor < iNumFlavors); if(iFlavor >= 0 && iFlavor < iNumFlavors) { paFlavors[iFlavor] = kResults.GetText("Type"); @@ -426,7 +426,7 @@ bool CvDllDatabaseUtility::PrefetchGameData() } else { - CvAssertMsg(false, DB.ErrorMessage()); + ASSERT(false, DB.ErrorMessage()); } } @@ -951,7 +951,7 @@ bool CvDllDatabaseUtility::SetGlobalActionInfo() for(i = 0; i < iTotalActionInfoCount; i++) { CvActionInfo* pActionInfo = FNEW(CvActionInfo, c_eCiv5GameplayDLL, 0); - CvAssert(piIndexList[piOrderedIndex[i]] != -1); + ASSERT(piIndexList[piOrderedIndex[i]] != -1); pActionInfo->setOriginalIndex(piIndexList[piOrderedIndex[i]]); pActionInfo->setSubType((ActionSubTypes)piActionInfoTypeList[piOrderedIndex[i]]); diff --git a/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.h b/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.h index 2e8beb27e5..f4010725fd 100644 --- a/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.h +++ b/CvGameCoreDLL_Expansion2/CvDllDatabaseUtility.h @@ -121,7 +121,7 @@ bool CvDllDatabaseUtility::PrefetchCollection(std::vector& kCollection, cons while(kResults.Step()) { size_t Id = kResults.GetInt("ID"); - CvAssertMsg(index <= Id, "This should never happen!") + ASSERT(index <= Id, "This should never happen!") while(Id > index) { @@ -139,7 +139,7 @@ bool CvDllDatabaseUtility::PrefetchCollection(std::vector& kCollection, cons { char szErrorMsg[512]; sprintf_s(szErrorMsg, "PrefetchCollection: Cannot find table '%s'. Error - %s", tableName, DB.ErrorMessage()); - CvAssertMsg(false, szErrorMsg); + ASSERT(false, szErrorMsg); } diff --git a/CvGameCoreDLL_Expansion2/CvDllEraInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllEraInfo.cpp index 877619400c..5fd6fa5edd 100644 --- a/CvGameCoreDLL_Expansion2/CvDllEraInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllEraInfo.cpp @@ -13,7 +13,7 @@ CvDllEraInfo::CvDllEraInfo(CvEraInfo* pEraInfo) : m_pEraInfo(pEraInfo) , m_uiRefCount(1) { - FAssertMsg(pEraInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pEraInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllEraInfo::~CvDllEraInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllFeatureInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllFeatureInfo.cpp index 6d63865e97..88ae6c9979 100644 --- a/CvGameCoreDLL_Expansion2/CvDllFeatureInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllFeatureInfo.cpp @@ -13,7 +13,7 @@ CvDllFeatureInfo::CvDllFeatureInfo(CvFeatureInfo* pFeatureInfo) : m_pFeatureInfo(pFeatureInfo) , m_uiRefCount(1) { - FAssertMsg(pFeatureInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pFeatureInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllFeatureInfo::~CvDllFeatureInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllGame.cpp b/CvGameCoreDLL_Expansion2/CvDllGame.cpp index 141a92aa6e..4f2f4c2aef 100644 --- a/CvGameCoreDLL_Expansion2/CvDllGame.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllGame.cpp @@ -278,7 +278,7 @@ void CvDllGame::HandleAction(int iAction) //------------------------------------------------------------------------------ bool CvDllGame::HasTurnTimerExpired() { - CvAssertMsg(0, "Obsolete"); + ASSERT(0, "Obsolete"); return false; } //------------------------------------------------------------------------------ diff --git a/CvGameCoreDLL_Expansion2/CvDllGameOptionInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllGameOptionInfo.cpp index 17be77d29a..b64bfba713 100644 --- a/CvGameCoreDLL_Expansion2/CvDllGameOptionInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllGameOptionInfo.cpp @@ -13,7 +13,7 @@ CvDllGameOptionInfo::CvDllGameOptionInfo(CvGameOptionInfo* pGameOptionInfo) : m_pGameOptionInfo(pGameOptionInfo) , m_uiRefCount(1) { - FAssertMsg(pGameOptionInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pGameOptionInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllGameOptionInfo::~CvDllGameOptionInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllGameSpeedInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllGameSpeedInfo.cpp index f91399512c..cfa096564b 100644 --- a/CvGameCoreDLL_Expansion2/CvDllGameSpeedInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllGameSpeedInfo.cpp @@ -13,7 +13,7 @@ CvDllGameSpeedInfo::CvDllGameSpeedInfo(CvGameSpeedInfo* pGameSpeedInfo) : m_pGameSpeedInfo(pGameSpeedInfo) , m_uiRefCount(1) { - FAssertMsg(pGameSpeedInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pGameSpeedInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllGameSpeedInfo::~CvDllGameSpeedInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllHandicapInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllHandicapInfo.cpp index 2b4e0be648..8c2a9424c6 100644 --- a/CvGameCoreDLL_Expansion2/CvDllHandicapInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllHandicapInfo.cpp @@ -13,7 +13,7 @@ CvDllHandicapInfo::CvDllHandicapInfo(CvHandicapInfo* pHandicapInfo) : m_pHandicapInfo(pHandicapInfo) , m_uiRefCount(1) { - FAssertMsg(pHandicapInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pHandicapInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllHandicapInfo::~CvDllHandicapInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllInterfaceModeInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllInterfaceModeInfo.cpp index 0865d11347..70fff4bb2d 100644 --- a/CvGameCoreDLL_Expansion2/CvDllInterfaceModeInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllInterfaceModeInfo.cpp @@ -13,7 +13,7 @@ CvDllInterfaceModeInfo::CvDllInterfaceModeInfo(CvInterfaceModeInfo* pInterfaceMo : m_pInterfaceModeInfo(pInterfaceModeInfo) , m_uiRefCount(1) { - FAssertMsg(pInterfaceModeInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pInterfaceModeInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllInterfaceModeInfo::~CvDllInterfaceModeInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllLeaderheadInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllLeaderheadInfo.cpp index df6643ed72..3ee4c81e45 100644 --- a/CvGameCoreDLL_Expansion2/CvDllLeaderheadInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllLeaderheadInfo.cpp @@ -13,7 +13,7 @@ CvDllLeaderHeadInfo::CvDllLeaderHeadInfo(CvLeaderHeadInfo* pLeaderHeadInfo) : m_pLeaderHeadInfo(pLeaderHeadInfo) , m_uiRefCount(1) { - FAssertMsg(pLeaderHeadInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pLeaderHeadInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllLeaderHeadInfo::~CvDllLeaderHeadInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllMinorCivInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllMinorCivInfo.cpp index 0fbb0a68e8..319a13511e 100644 --- a/CvGameCoreDLL_Expansion2/CvDllMinorCivInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllMinorCivInfo.cpp @@ -15,7 +15,7 @@ CvDllMinorCivInfo::CvDllMinorCivInfo(CvMinorCivInfo* pMinorCivInfo) : m_pMinorCivInfo(pMinorCivInfo) , m_uiRefCount(1) { - FAssertMsg(pMinorCivInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pMinorCivInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllMinorCivInfo::~CvDllMinorCivInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllMissionInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllMissionInfo.cpp index bb3a81639b..72a0e27266 100644 --- a/CvGameCoreDLL_Expansion2/CvDllMissionInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllMissionInfo.cpp @@ -13,7 +13,7 @@ CvDllMissionInfo::CvDllMissionInfo(CvMissionInfo* pMissionInfo) : m_pMissionInfo(pMissionInfo) , m_uiRefCount(1) { - FAssertMsg(pMissionInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pMissionInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllMissionInfo::~CvDllMissionInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllNetMessageHandler.cpp b/CvGameCoreDLL_Expansion2/CvDllNetMessageHandler.cpp index 1a4425df30..633b0c1d13 100644 --- a/CvGameCoreDLL_Expansion2/CvDllNetMessageHandler.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllNetMessageHandler.cpp @@ -468,12 +468,12 @@ void CvDllNetMessageHandler::ResponseMoveSpy(PlayerTypes ePlayer, int iSpyIndex, } else { - CvAssertMsg(iTargetPlayer != -1, "iTargetPlayer is -1"); + ASSERT(iTargetPlayer != -1, "iTargetPlayer is -1"); if(iTargetPlayer != -1) { PlayerTypes eTargetPlayer = (PlayerTypes)iTargetPlayer; CvCity* pCity = GET_PLAYER(eTargetPlayer).getCity(iTargetCity); - CvAssertMsg(pCity, "pCity is null"); + ASSERT(pCity, "pCity is null"); if(pCity) { pPlayerEspionage->MoveSpyTo(pCity, iSpyIndex, bAsDiplomat); @@ -490,13 +490,13 @@ void CvDllNetMessageHandler::ResponseStageCoup(PlayerTypes eSpyPlayer, int iSpyI if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eSpyPlayer)) return; - CvAssertMsg(eSpyPlayer != NO_PLAYER, "eSpyPlayer invalid"); - CvAssertMsg(iSpyIndex >= 0, "iSpyIndex invalid"); + ASSERT(eSpyPlayer != NO_PLAYER, "eSpyPlayer invalid"); + ASSERT(iSpyIndex >= 0, "iSpyIndex invalid"); CvPlayerAI& kPlayer = GET_PLAYER(eSpyPlayer); CvPlayerEspionage* pPlayerEspionage = kPlayer.GetEspionage(); - CvAssertMsg(pPlayerEspionage, "pPlayerEspionage is null"); + ASSERT(pPlayerEspionage, "pPlayerEspionage is null"); if(pPlayerEspionage) { bool bCoupSuccess = pPlayerEspionage->AttemptCoup(iSpyIndex); @@ -509,9 +509,9 @@ void CvDllNetMessageHandler::ResponseFaithPurchase(PlayerTypes ePlayer, FaithPur if (!GC.getGame().isFinalInitialized() || PlayerInvalid(ePlayer)) return; - CvAssertMsg(ePlayer != NO_PLAYER, "ePlayer invalid"); - CvAssertMsg(eFaithPurchaseType > -1, "Faith Purchase Type invalid"); - CvAssertMsg(iFaithPurchaseIndex > -1, "Faith Purchase Index invalid"); + ASSERT(ePlayer != NO_PLAYER, "ePlayer invalid"); + ASSERT(eFaithPurchaseType > -1, "Faith Purchase Type invalid"); + ASSERT(iFaithPurchaseIndex > -1, "Faith Purchase Index invalid"); CvPlayerAI& kPlayer = GET_PLAYER(ePlayer); kPlayer.SetFaithPurchaseType(eFaithPurchaseType); @@ -524,11 +524,11 @@ void CvDllNetMessageHandler::ResponseLeagueVoteEnact(LeagueTypes eLeague, int iR if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eVoter) || eLeague==NO_LEAGUE) return; - CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid"); - CvAssertMsg(eVoter != NO_PLAYER, "eVoter invalid"); + ASSERT(eLeague != NO_LEAGUE, "eLeague invalid"); + ASSERT(eVoter != NO_PLAYER, "eVoter invalid"); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague); - CvAssertMsg(pLeague->CanVote(eVoter), "eVoter not allowed to vote. Please send Anton your save file and version."); + ASSERT(pLeague->CanVote(eVoter), "eVoter not allowed to vote."); pLeague->DoVoteEnact(iResolutionID, eVoter, iNumVotes, iChoice); } //------------------------------------------------------------------------------ @@ -538,11 +538,11 @@ void CvDllNetMessageHandler::ResponseLeagueVoteRepeal(LeagueTypes eLeague, int i if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eVoter) || eLeague==NO_LEAGUE) return; - CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid"); - CvAssertMsg(eVoter != NO_PLAYER, "eVoter invalid"); + ASSERT(eLeague != NO_LEAGUE, "eLeague invalid"); + ASSERT(eVoter != NO_PLAYER, "eVoter invalid"); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague); - CvAssertMsg(pLeague->CanVote(eVoter), "eVoter not allowed to vote. Please send Anton your save file and version."); + ASSERT(pLeague->CanVote(eVoter), "eVoter not allowed to vote."); pLeague->DoVoteRepeal(iResolutionID, eVoter, iNumVotes, iChoice); } //------------------------------------------------------------------------------ @@ -552,11 +552,11 @@ void CvDllNetMessageHandler::ResponseLeagueVoteAbstain(LeagueTypes eLeague, Play if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eVoter) || eLeague==NO_LEAGUE) return; - CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid"); - CvAssertMsg(eVoter != NO_PLAYER, "eVoter invalid"); + ASSERT(eLeague != NO_LEAGUE, "eLeague invalid"); + ASSERT(eVoter != NO_PLAYER, "eVoter invalid"); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague); - CvAssertMsg(pLeague->CanVote(eVoter), "eVoter not allowed to vote. Please send Anton your save file and version."); + ASSERT(pLeague->CanVote(eVoter), "eVoter not allowed to vote."); pLeague->DoVoteAbstain(eVoter, iNumVotes); } //------------------------------------------------------------------------------ @@ -566,12 +566,12 @@ void CvDllNetMessageHandler::ResponseLeagueProposeEnact(LeagueTypes eLeague, Res if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eProposer) || eLeague==NO_LEAGUE) return; - CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid"); - CvAssertMsg(eResolution != NO_RESOLUTION, "eResolution invalid"); - CvAssertMsg(eProposer != NO_PLAYER, "eProposer invalid"); + ASSERT(eLeague != NO_LEAGUE, "eLeague invalid"); + ASSERT(eResolution != NO_RESOLUTION, "eResolution invalid"); + ASSERT(eProposer != NO_PLAYER, "eProposer invalid"); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague); - CvAssertMsg(pLeague->CanProposeEnact(eResolution, eProposer, iChoice), "eProposer not allowed to enact Resolution. Please send Anton your save file and version."); + ASSERT(pLeague->CanProposeEnact(eResolution, eProposer, iChoice), "eProposer not allowed to enact Resolution."); pLeague->DoProposeEnact(eResolution, eProposer, iChoice); } //------------------------------------------------------------------------------ @@ -581,11 +581,11 @@ void CvDllNetMessageHandler::ResponseLeagueProposeRepeal(LeagueTypes eLeague, in if (!GC.getGame().isFinalInitialized() || PlayerInvalid(eProposer) || eLeague==NO_LEAGUE) return; - CvAssertMsg(eLeague != NO_LEAGUE, "eLeague invalid"); - CvAssertMsg(eProposer != NO_PLAYER, "eProposer invalid"); + ASSERT(eLeague != NO_LEAGUE, "eLeague invalid"); + ASSERT(eProposer != NO_PLAYER, "eProposer invalid"); CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague); - CvAssertMsg(pLeague->CanProposeRepeal(iResolutionID, eProposer), "eProposer not allowed to repeal Resolution. Please send Anton your save file and version."); + ASSERT(pLeague->CanProposeRepeal(iResolutionID, eProposer), "eProposer not allowed to repeal Resolution."); pLeague->DoProposeRepeal(iResolutionID, eProposer); } //------------------------------------------------------------------------------ @@ -688,7 +688,7 @@ void CvDllNetMessageHandler::ResponseChangeIdeology(PlayerTypes ePlayer) if (!GC.getGame().isFinalInitialized() || PlayerInvalid(ePlayer)) return; - CvAssertMsg(ePlayer != NO_PLAYER, "ePlayer invalid"); + ASSERT(ePlayer != NO_PLAYER, "ePlayer invalid"); // is this player alive CvPlayer &kPlayer = GET_PLAYER(ePlayer); @@ -1060,10 +1060,10 @@ void CvDllNetMessageHandler::ResponseResearch(PlayerTypes ePlayer, TechTypes eTe else if(ePlayerToStealFrom != NO_PLAYER) { // make sure we can still take a tech - CvAssertMsg(kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom] > 0, "No techs to steal from player"); - CvAssertMsg(kPlayer.GetEspionage()->m_aaPlayerStealableTechList[ePlayerToStealFrom].size() > 0, "No techs to be stolen from this player"); - CvAssertMsg(kPlayer.GetPlayerTechs()->CanResearch(eTech), "Player can't research this technology"); - CvAssertMsg(GET_TEAM(GET_PLAYER(ePlayerToStealFrom).getTeam()).GetTeamTechs()->HasTech(eTech), "ePlayerToStealFrom does not have the requested tech"); + ASSERT(kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom] > 0, "No techs to steal from player"); + ASSERT(kPlayer.GetEspionage()->m_aaPlayerStealableTechList[ePlayerToStealFrom].size() > 0, "No techs to be stolen from this player"); + ASSERT(kPlayer.GetPlayerTechs()->CanResearch(eTech), "Player can't research this technology"); + ASSERT(GET_TEAM(GET_PLAYER(ePlayerToStealFrom).getTeam()).GetTeamTechs()->HasTech(eTech), "ePlayerToStealFrom does not have the requested tech"); if (kPlayer.GetEspionage()->m_aiNumTechsToStealList[ePlayerToStealFrom] > 0) { kTeam.setHasTech(eTech, true, ePlayer, true, true); diff --git a/CvGameCoreDLL_Expansion2/CvDllPlayerColorInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllPlayerColorInfo.cpp index 9e9ecc3b5b..903529a7aa 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPlayerColorInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPlayerColorInfo.cpp @@ -13,7 +13,7 @@ CvDllPlayerColorInfo::CvDllPlayerColorInfo(CvPlayerColorInfo* pPlayerColorInfo) : m_pPlayerColorInfo(pPlayerColorInfo) , m_uiRefCount(1) { - FAssertMsg(pPlayerColorInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pPlayerColorInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllPlayerColorInfo::~CvDllPlayerColorInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllPlayerOptionInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllPlayerOptionInfo.cpp index 75cab69b5c..d19b1fbc85 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPlayerOptionInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPlayerOptionInfo.cpp @@ -13,7 +13,7 @@ CvDllPlayerOptionInfo::CvDllPlayerOptionInfo(CvPlayerOptionInfo* pPlayerOptionIn : m_pPlayerOptionInfo(pPlayerOptionInfo) , m_uiRefCount(1) { - FAssertMsg(pPlayerOptionInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pPlayerOptionInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllPlayerOptionInfo::~CvDllPlayerOptionInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllPlot.cpp b/CvGameCoreDLL_Expansion2/CvDllPlot.cpp index 7bfd8315a8..9e7fbe523a 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPlot.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPlot.cpp @@ -16,7 +16,7 @@ CvDllPlot::CvDllPlot(CvPlot* pPlot) : m_pPlot(pPlot) , m_uiRefCount(1) { - FAssertMsg(pPlot != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pPlot != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllPlot::~CvDllPlot() diff --git a/CvGameCoreDLL_Expansion2/CvDllPolicyInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllPolicyInfo.cpp index af49505fe3..d99abfd5a0 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPolicyInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPolicyInfo.cpp @@ -13,7 +13,7 @@ CvDllPolicyInfo::CvDllPolicyInfo(CvPolicyEntry* pPolicyInfo) : m_pPolicyInfo(pPolicyInfo) , m_uiRefCount(1) { - FAssertMsg(pPolicyInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pPolicyInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllPolicyInfo::~CvDllPolicyInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllPromotionInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllPromotionInfo.cpp index 0492a8ac31..6a68bbcb08 100644 --- a/CvGameCoreDLL_Expansion2/CvDllPromotionInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllPromotionInfo.cpp @@ -14,7 +14,7 @@ CvDllPromotionInfo::CvDllPromotionInfo(CvPromotionEntry* pPromotionInfo) : m_pPromotionInfo(pPromotionInfo) , m_uiRefCount(1) { - FAssertMsg(pPromotionInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pPromotionInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllPromotionInfo::~CvDllPromotionInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllRandom.cpp b/CvGameCoreDLL_Expansion2/CvDllRandom.cpp index 093de860ae..0b9433012a 100644 --- a/CvGameCoreDLL_Expansion2/CvDllRandom.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllRandom.cpp @@ -16,7 +16,7 @@ CvDllRandom::CvDllRandom(CvRandom* pRandom) : m_pRandom(pRandom) , m_uiRefCount(1) { - FAssertMsg(pRandom != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pRandom != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllRandom::~CvDllRandom() diff --git a/CvGameCoreDLL_Expansion2/CvDllResourceInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllResourceInfo.cpp index 48f59263f6..da044fa95a 100644 --- a/CvGameCoreDLL_Expansion2/CvDllResourceInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllResourceInfo.cpp @@ -13,7 +13,7 @@ CvDllResourceInfo::CvDllResourceInfo(CvResourceInfo* pResourceInfo) : m_pResourceInfo(pResourceInfo) , m_uiRefCount(1) { - FAssertMsg(pResourceInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pResourceInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllResourceInfo::~CvDllResourceInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllTerrainInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllTerrainInfo.cpp index 0461e117b0..732092133b 100644 --- a/CvGameCoreDLL_Expansion2/CvDllTerrainInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllTerrainInfo.cpp @@ -13,7 +13,7 @@ CvDllTerrainInfo::CvDllTerrainInfo(CvTerrainInfo* pTerrainInfo) : m_pTerrainInfo(pTerrainInfo) , m_uiRefCount(1) { - FAssertMsg(pTerrainInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pTerrainInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllTerrainInfo::~CvDllTerrainInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllUnit.cpp b/CvGameCoreDLL_Expansion2/CvDllUnit.cpp index fa5bc2bff2..176a8849b4 100644 --- a/CvGameCoreDLL_Expansion2/CvDllUnit.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllUnit.cpp @@ -16,7 +16,7 @@ CvDllUnit::CvDllUnit(CvUnit* pUnit) : m_pUnit(pUnit) , m_uiRefCount(1) { - FAssertMsg(pUnit != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pUnit != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllUnit::~CvDllUnit() diff --git a/CvGameCoreDLL_Expansion2/CvDllUnitCombatClassInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllUnitCombatClassInfo.cpp index d44c1bd1e2..70c79c2c79 100644 --- a/CvGameCoreDLL_Expansion2/CvDllUnitCombatClassInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllUnitCombatClassInfo.cpp @@ -14,7 +14,7 @@ CvDllUnitCombatClassInfo::CvDllUnitCombatClassInfo(CvBaseInfo* pUnitCombatClassI : m_pUnitCombatClassInfo(pUnitCombatClassInfo) , m_uiRefCount(1) { - FAssertMsg(pUnitCombatClassInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pUnitCombatClassInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllUnitCombatClassInfo::~CvDllUnitCombatClassInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllVictoryInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllVictoryInfo.cpp index a7ec3942b1..48472c3bba 100644 --- a/CvGameCoreDLL_Expansion2/CvDllVictoryInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllVictoryInfo.cpp @@ -14,7 +14,7 @@ CvDllVictoryInfo::CvDllVictoryInfo(CvVictoryInfo* pVictoryInfo) : m_pVictoryInfo(pVictoryInfo) , m_uiRefCount(1) { - FAssertMsg(pVictoryInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pVictoryInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllVictoryInfo::~CvDllVictoryInfo() diff --git a/CvGameCoreDLL_Expansion2/CvDllWorldInfo.cpp b/CvGameCoreDLL_Expansion2/CvDllWorldInfo.cpp index 6d140008eb..c912b9b7a7 100644 --- a/CvGameCoreDLL_Expansion2/CvDllWorldInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvDllWorldInfo.cpp @@ -14,7 +14,7 @@ CvDllWorldInfo::CvDllWorldInfo(CvWorldInfo* pWorldInfo) : m_pWorldInfo(pWorldInfo) , m_uiRefCount(1) { - FAssertMsg(pWorldInfo != NULL, "SHOULD NOT HAPPEN"); + ASSERT(pWorldInfo != NULL, "SHOULD NOT HAPPEN"); } //------------------------------------------------------------------------------ CvDllWorldInfo::~CvDllWorldInfo() diff --git a/CvGameCoreDLL_Expansion2/CvEconomicAI.cpp b/CvGameCoreDLL_Expansion2/CvEconomicAI.cpp index 747a425741..36191ea247 100644 --- a/CvGameCoreDLL_Expansion2/CvEconomicAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvEconomicAI.cpp @@ -133,16 +133,16 @@ bool CvEconomicAIStrategyXMLEntry::CacheResults(Database::Results& kResults, CvD /// What player flavors will be added by adopting this Strategy? int CvEconomicAIStrategyXMLEntry::GetPlayerFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPlayerFlavorValue ? m_piPlayerFlavorValue[i] : -1; } /// What city flavors will be added by adopting this Strategy? int CvEconomicAIStrategyXMLEntry::GetCityFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityFlavorValue ? m_piCityFlavorValue[i] : -1; } @@ -155,8 +155,8 @@ int CvEconomicAIStrategyXMLEntry::GetWeightThreshold() const /// How do a player's Personality Flavors affect the Threshold for adopting a Strategy? (if applicable) int CvEconomicAIStrategyXMLEntry::GetPersonalityFlavorThresholdMod(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPersonalityFlavorThresholdMod ? m_piPersonalityFlavorThresholdMod[i] : -1; } @@ -281,10 +281,10 @@ void CvEconomicAI::Init(CvEconomicAIStrategyXMLEntries* pAIStrategies, CvPlayer* m_pPlayer = pPlayer; // Initialize arrays - FAssertMsg(m_pabUsingStrategy==NULL, "about to leak memory, CvStrategyAI::m_pabUsingStrategy"); + ASSERT(m_pabUsingStrategy==NULL, "about to leak memory, CvStrategyAI::m_pabUsingStrategy"); m_pabUsingStrategy = FNEW(bool[m_pAIStrategies->GetNumEconomicAIStrategies()], c_eCiv5GameplayDLL, 0); - FAssertMsg(m_paiTurnStrategyAdopted==NULL, "about to leak memory, CvStrategyAI::m_paiTurnStrategyAdopted"); + ASSERT(m_paiTurnStrategyAdopted==NULL, "about to leak memory, CvStrategyAI::m_paiTurnStrategyAdopted"); m_paiTurnStrategyAdopted = FNEW(int[m_pAIStrategies->GetNumEconomicAIStrategies()], c_eCiv5GameplayDLL, 0); m_aiTempFlavors.init(); @@ -343,9 +343,9 @@ void CvEconomicAI::Reset() template void CvEconomicAI::Serialize(EconomicAI& economicAI, Visitor& visitor) { - CvAssert(economicAI.m_pAIStrategies != NULL); + ASSERT(economicAI.m_pAIStrategies != NULL); const int iNumStrategies = economicAI.m_pAIStrategies->GetNumEconomicAIStrategies(); - CvAssertMsg(iNumStrategies > 0, "Number of AIStrategies to serialize is expected to greater than 0"); + ASSERT(iNumStrategies > 0, "Number of AIStrategies to serialize is expected to greater than 0"); visitor(MakeConstSpan(economicAI.m_pabUsingStrategy, iNumStrategies)); visitor(MakeConstSpan(economicAI.m_paiTurnStrategyAdopted, iNumStrategies)); @@ -1045,7 +1045,7 @@ bool CvEconomicAI::CanWithdrawMoneyForPurchase(PurchaseType ePurchase, int iAmou } } - CvAssert(false); + ASSERT(false); return false; // Should never reach here } @@ -1081,7 +1081,7 @@ int CvEconomicAI::AmountAvailableForPurchase(PurchaseType ePurchase) } } - CvAssert(false); + ASSERT(false); return false; // Should never reach here } @@ -3424,7 +3424,7 @@ bool EconomicAIHelpers::IsTestStrategy_TechLeader(CvPlayer* pPlayer) eFlavorEspionage = eFlavor; } } - CvAssertMsg(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); + ASSERT(eFlavorEspionage != NO_FLAVOR, "Could not find espionage flavor!"); float fRatio = iNumPlayersAheadInTech / (float)iNumOtherPlayers; float fCutOff = (0.05f * pPlayer->GetFlavorManager()->GetPersonalityIndividualFlavor(eFlavorEspionage)); @@ -3904,7 +3904,7 @@ bool EconomicAIHelpers::IsTestStrategy_NeedImprovement(CvPlayer* pPlayer, YieldT UNREACHABLE(); // Only YIELD_FOOD & YIELD_PRODUCTION supported. } - FAssertMsg(eCityStrategy != NO_AICITYSTRATEGY, "No strategy found. What?"); + ASSERT(eCityStrategy != NO_AICITYSTRATEGY, "No strategy found. What?"); if(eCityStrategy == NO_AICITYSTRATEGY) { return false; diff --git a/CvGameCoreDLL_Expansion2/CvEmphasisClasses.cpp b/CvGameCoreDLL_Expansion2/CvEmphasisClasses.cpp index cf783955c2..22a555c933 100644 --- a/CvGameCoreDLL_Expansion2/CvEmphasisClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvEmphasisClasses.cpp @@ -56,8 +56,8 @@ bool CvEmphasisEntry::IsGreatPeople() const // What is the yield change for this yield type? int CvEmphasisEntry::GetYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifiers ? m_piYieldModifiers[i] : -1; } @@ -144,7 +144,7 @@ void CvCityEmphases::Reset() m_iEmphasizeGreatPeopleCount = 0; m_aiEmphasizeYieldCount.init(0); - CvAssertMsg(GC.getNumEmphasisInfos() > 0, "GC.getNumEmphasizeInfos() is not greater than zero but an array is being allocated in CvCityEmphases::Reset"); + ASSERT(GC.getNumEmphasisInfos() > 0, "GC.getNumEmphasizeInfos() is not greater than zero but an array is being allocated in CvCityEmphases::Reset"); m_pbEmphasize.init(false); } @@ -163,8 +163,8 @@ bool CvCityEmphases::IsEmphasizeAvoidGrowth() /// What is this city's yield boost due to emphasis? int CvCityEmphases::GetEmphasizeYieldCount(YieldTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(eIndex >= 0 && eIndex < NUM_YIELD_TYPES) return m_aiEmphasizeYieldCount[eIndex]; return 0; // default set during "reset" @@ -179,9 +179,9 @@ bool CvCityEmphases::IsEmphasizeYield(YieldTypes eIndex) /// Is this emphasis turned on? bool CvCityEmphases::IsEmphasize(EmphasizeTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumEmphasisInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(m_pbEmphasize.valid(), "m_pbEmphasize is expected to be valid"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumEmphasisInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(m_pbEmphasize.valid(), "m_pbEmphasize is expected to be valid"); return m_pbEmphasize[eIndex]; } @@ -189,8 +189,8 @@ bool CvCityEmphases::IsEmphasize(EmphasizeTypes eIndex) /// Turn on this emphasis void CvCityEmphases::SetEmphasize(EmphasizeTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumEmphasisInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumEmphasisInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(IsEmphasize(eIndex) != bNewValue) { @@ -201,7 +201,7 @@ void CvCityEmphases::SetEmphasize(EmphasizeTypes eIndex, bool bNewValue) if(pkEmphasis->IsAvoidGrowth()) { m_iEmphasizeAvoidGrowthCount += ((IsEmphasize(eIndex)) ? 1 : -1); - CvAssert(GetEmphasizeAvoidGrowthCount() >= 0); + ASSERT(GetEmphasizeAvoidGrowthCount() >= 0); } if(pkEmphasis->IsGreatPeople()) @@ -214,7 +214,7 @@ void CvCityEmphases::SetEmphasize(EmphasizeTypes eIndex, bool bNewValue) if(pkEmphasis->GetYieldChange(iI)) { m_aiEmphasizeYieldCount[iI] += ((IsEmphasize(eIndex)) ? 1 : -1); - CvAssert(GetEmphasizeYieldCount((YieldTypes)iI) >= 0); + ASSERT(GetEmphasizeYieldCount((YieldTypes)iI) >= 0); } } diff --git a/CvGameCoreDLL_Expansion2/CvEnumMap.h b/CvGameCoreDLL_Expansion2/CvEnumMap.h index 4e8d6c2a8f..12ea614382 100644 --- a/CvGameCoreDLL_Expansion2/CvEnumMap.h +++ b/CvGameCoreDLL_Expansion2/CvEnumMap.h @@ -25,8 +25,8 @@ class CvEnumMap inline CvEnumMap() : m_values(NULL) { - CvAssert(sizeof(StorageType) == sizeof(T)); - CvAssert(__alignof(StorageType) == __alignof(T)); + ASSERT(sizeof(StorageType) == sizeof(T)); + ASSERT(__alignof(StorageType) == __alignof(T)); } inline ~CvEnumMap() { @@ -44,7 +44,7 @@ class CvEnumMap void init() { - CvAssertMsg(m_values == NULL, "Dynamic CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Memory will leak"); + ASSERT(m_values == NULL, "Dynamic CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Memory will leak"); m_values = FNEW(StorageType[size()], c_eCiv5GameplayDLL, 0); #ifdef VPDEBUG m_initSize = size(); @@ -56,7 +56,7 @@ class CvEnumMap } void init(const T& fill) { - CvAssertMsg(m_values == NULL, "Dynamic CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Memory will leak"); + ASSERT(m_values == NULL, "Dynamic CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Memory will leak"); m_values = FNEW(StorageType[size()], c_eCiv5GameplayDLL, 0); #ifdef VPDEBUG m_initSize = size(); @@ -102,7 +102,7 @@ class CvEnumMap inline const T& operator[](std::size_t idx) const { checkValidAccess(); - CvAssertMsg(idx < size(), "Attempting to access out of range index in CvEnumMap<>"); + ASSERT(idx < size(), "Attempting to access out of range index in CvEnumMap<>"); return data()[idx]; } inline T& operator[](std::size_t idx) @@ -191,8 +191,10 @@ class CvEnumMap inline void checkValidAccess() const { - CvAssertMsg(m_values != NULL, "Attempting to access dynamic CvEnumMap<> without first calling CvEnumMap<>::init()"); - CvAssertMsg(m_values == NULL || m_initSize == size(), "Attempting to access dynamic CvEnumMap<> whose size has changed since CvEnumMap<>::init() was called"); + ASSERT(m_values != NULL, "Attempting to access dynamic CvEnumMap<> without first calling CvEnumMap<>::init()"); +#ifdef VPDEBUG + ASSERT(m_values == NULL || m_initSize == size(), "Attempting to access dynamic CvEnumMap<> whose size has changed since CvEnumMap<>::init() was called"); +#endif } typedef typename CvAlignedStorage::Type StorageType; @@ -220,8 +222,8 @@ class CvEnumMap inline CvEnumMap() : m_initialized(false) { - CvAssert(sizeof(StorageType) == sizeof(T)); - CvAssert(__alignof(StorageType) == __alignof(T)); + ASSERT(sizeof(StorageType) == sizeof(T)); + ASSERT(__alignof(StorageType) == __alignof(T)); } inline ~CvEnumMap() @@ -231,7 +233,7 @@ class CvEnumMap void init() { - CvAssertMsg(m_initialized == false, "Fixed CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Elements will not be destroyed"); + ASSERT(m_initialized == false, "Fixed CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Elements will not be destroyed"); m_initialized = true; for (Iterator it = begin(); it != end(); ++it) { @@ -240,7 +242,7 @@ class CvEnumMap } void init(const T& fill) { - CvAssertMsg(m_initialized == false, "Fixed CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Elements will not be destroyed"); + ASSERT(m_initialized == false, "Fixed CvEnumMap<>::init() called without first calling CvEnumMap<>::uninit() - Elements will not be destroyed"); m_initialized = true; for (Iterator it = begin(); it != end(); ++it) { @@ -283,7 +285,7 @@ class CvEnumMap inline const T& operator[](std::size_t idx) const { checkValidAccess(); - CvAssertMsg(idx < size(), "Attempting to access out of range index in CvEnumMap<>"); + ASSERT(idx < size(), "Attempting to access out of range index in CvEnumMap<>"); return data()[idx]; } inline T& operator[](std::size_t idx) @@ -372,7 +374,7 @@ class CvEnumMap inline void checkValidAccess() const { - CvAssertMsg(m_initialized == true, "Attempting to access fixed CvEnumMap<> without first calling CvEnumMap<>::init()"); + ASSERT(m_initialized == true, "Attempting to access fixed CvEnumMap<> without first calling CvEnumMap<>::init()"); } typedef typename CvAlignedStorage::Type StorageType; diff --git a/CvGameCoreDLL_Expansion2/CvEspionageClasses.cpp b/CvGameCoreDLL_Expansion2/CvEspionageClasses.cpp index e5ee266347..1ccd2d4bdb 100644 --- a/CvGameCoreDLL_Expansion2/CvEspionageClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvEspionageClasses.cpp @@ -828,7 +828,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) break; case SPY_STATE_TRAVELLING: // spy is traveling to location - CvAssertMsg(pCity, "pCity not defined. What?"); + ASSERT(pCity, "pCity not defined. What?"); if(!pCity) { return; @@ -916,7 +916,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) break; case SPY_STATE_SURVEILLANCE: // only used in Community Patch, not in VP - CvAssertMsg(pCity, "pCity not defined. What?"); + ASSERT(pCity, "pCity not defined. What?"); if(!pCity) { return; @@ -999,7 +999,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) } break; case SPY_STATE_GATHERING_INTEL: - CvAssertMsg(pCity, "pCity not defined. What?"); + ASSERT(pCity, "pCity not defined. What?"); if(!pCity) { return; @@ -1127,14 +1127,14 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) } CvPlayerEspionage* pDefendingPlayerEspionage = GET_PLAYER(eCityOwner).GetEspionage(); - CvAssertMsg(pDefendingPlayerEspionage, "Defending player espionage is null"); + ASSERT(pDefendingPlayerEspionage, "Defending player espionage is null"); if (pDefendingPlayerEspionage) { pDefendingPlayerEspionage->AddSpyMessage(pCity->getX(), pCity->getY(), m_pPlayer->GetID(), pCityEspionage->m_aiResult[ePlayer]); } CvDiplomacyAI* pDefendingPlayerDiploAI = GET_PLAYER(eCityOwner).GetDiplomacyAI(); - CvAssertMsg(pDefendingPlayerDiploAI, "Defending player diplo AI is null"); + ASSERT(pDefendingPlayerDiploAI, "Defending player diplo AI is null"); if (pDefendingPlayerDiploAI) { if (pCityEspionage->m_aiResult[ePlayer] == SPY_RESULT_IDENTIFIED || pCityEspionage->m_aiResult[ePlayer] == SPY_RESULT_KILLED) @@ -1161,14 +1161,14 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) } CvEspionageAI* pEspionageAI = m_pPlayer->GetEspionageAI(); - CvAssertMsg(pEspionageAI, "pEspionageAI is null"); + ASSERT(pEspionageAI, "pEspionageAI is null"); if (pEspionageAI) { pEspionageAI->m_aiTurnLastSpyDied[eCityOwner] = GC.getGame().getGameTurn(); pEspionageAI->m_aiNumSpiesDied[eCityOwner]++; } CvEspionageAI* pDefenderEspionageAI = GET_PLAYER(eCityOwner).GetEspionageAI(); - CvAssertMsg(pDefenderEspionageAI, "pDefenderEspionageAI is null"); + ASSERT(pDefenderEspionageAI, "pDefenderEspionageAI is null"); if (pDefenderEspionageAI) { pDefenderEspionageAI->m_aiTurnLastSpyKilled[m_pPlayer->GetID()] = GC.getGame().getGameTurn(); @@ -1185,7 +1185,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) int iDefendingSpy = pCityEspionage->m_aiSpyAssignment[eCityOwner]; if (pDefendingPlayerEspionage) { - CvAssertMsg(iDefendingSpy >= 0, "No defending spy. This is ok if debugging and killing a spy without having a defending spy present, but should not occur when playing the game normally."); + ASSERT(iDefendingSpy >= 0, "No defending spy. This is ok if debugging and killing a spy without having a defending spy present, but should not occur when playing the game normally."); if (iDefendingSpy >= 0) { pDefendingPlayerEspionage->LevelUpSpy(iDefendingSpy); @@ -1236,7 +1236,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) if (pCityEspionage->m_aiResult[ePlayer] == SPY_RESULT_IDENTIFIED) { CvEspionageAI* pDefenderEspionageAI = GET_PLAYER(eCityOwner).GetEspionageAI(); - CvAssertMsg(pDefenderEspionageAI, "pDefenderEspionageAI is null"); + ASSERT(pDefenderEspionageAI, "pDefenderEspionageAI is null"); if (pDefenderEspionageAI) { pDefenderEspionageAI->m_aiTurnLastSpyCaught[m_pPlayer->GetID()] = GC.getGame().getGameTurn(); @@ -1251,7 +1251,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) } // this check was added because m_aiNumTechsToStealList was getting out of whack somehow and this is a check to prevent the UI from going haywire - CvAssertMsg(m_aiNumTechsToStealList[iCityOwner] > 0, "m_aiNumTechsToStealList[iCityOwner] <= 0, which shouldn't happen after you succeed at stealing"); + ASSERT(m_aiNumTechsToStealList[iCityOwner] > 0, "m_aiNumTechsToStealList[iCityOwner] <= 0, which shouldn't happen after you succeed at stealing"); if (m_aiNumTechsToStealList[iCityOwner] > 0) { CvNotifications* pNotifications = m_pPlayer->GetNotifications(); @@ -1329,7 +1329,7 @@ void CvPlayerEspionage::ProcessSpy(uint uiSpyIndex) } break; case SPY_STATE_MAKING_INTRODUCTIONS: - CvAssertMsg(pCity, "pCity not defined. What?"); + ASSERT(pCity, "pCity not defined. What?"); if(!pCity) { return; @@ -1591,9 +1591,9 @@ void CvPlayerEspionage::ProcessSpyMissionResult(PlayerTypes eSpyOwner, CvCity* p CvPlayerEspionage* pDefendingPlayerEspionage = GET_PLAYER(eCityOwner).GetEspionage(); CvDiplomacyAI* pDefendingPlayerDiploAI = GET_PLAYER(eCityOwner).GetDiplomacyAI(); CvEspionageAI* pEspionageAI = m_pPlayer->GetEspionageAI(); - CvAssertMsg(pEspionageAI, "pEspionageAI is null"); + ASSERT(pEspionageAI, "pEspionageAI is null"); CvEspionageAI* pDefenderEspionageAI = GET_PLAYER(eCityOwner).GetEspionageAI(); - CvAssertMsg(pDefenderEspionageAI, "pDefenderEspionageAI is null"); + ASSERT(pDefenderEspionageAI, "pDefenderEspionageAI is null"); @@ -1995,13 +1995,13 @@ void CvPlayerEspionage::UncoverIntrigue(uint uiSpyIndex) pCityEspionage = pCity->GetCityEspionage(); } - CvAssertMsg(pCity, "Spy needs to be in city to uncover intrigue"); + ASSERT(pCity, "Spy needs to be in city to uncover intrigue"); if(!pCity) { return; } - CvAssertMsg(ePlayer != eCityOwner, "Uncover intrigue should not occur when a spy is in their own city"); + ASSERT(ePlayer != eCityOwner, "Uncover intrigue should not occur when a spy is in their own city"); if(ePlayer == eCityOwner) { return; @@ -2145,7 +2145,7 @@ void CvPlayerEspionage::UncoverIntrigue(uint uiSpyIndex) else if (eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { if (::isWorldWonderClass(pBuildingInfo->GetBuildingClassInfo())) @@ -2171,7 +2171,7 @@ void CvPlayerEspionage::UncoverIntrigue(uint uiSpyIndex) } CvDiplomacyAI* pTargetDiploAI = GET_PLAYER(eCityOwner).GetDiplomacyAI(); - CvAssertMsg(pTargetDiploAI, "pTargetDiploAI is null"); + ASSERT(pTargetDiploAI, "pTargetDiploAI is null"); if(!pTargetDiploAI) { return; @@ -2300,13 +2300,13 @@ void CvPlayerEspionage::UncoverCityBuildingWonder(uint uiSpyIndex) pCityEspionage = pCity->GetCityEspionage(); } - CvAssertMsg(pCity, "Spy needs to be in city to uncover intrigue"); + ASSERT(pCity, "Spy needs to be in city to uncover intrigue"); if (!pCity) { return; } - CvAssertMsg(ePlayer != eCityOwner, "Uncover intrigue should not occur when a spy is in their own city"); + ASSERT(ePlayer != eCityOwner, "Uncover intrigue should not occur when a spy is in their own city"); if (ePlayer == eCityOwner) { return; @@ -2329,7 +2329,7 @@ void CvPlayerEspionage::UncoverCityBuildingWonder(uint uiSpyIndex) else if (eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { if (::isWorldWonderClass(pBuildingInfo->GetBuildingClassInfo())) @@ -2421,7 +2421,7 @@ void CvPlayerEspionage::GetRandomIntrigue(CvCity* pCity, uint uiSpyIndex) // deception! CvDiplomacyAI* pTargetDiploAI = GET_PLAYER(eOtherPlayer).GetDiplomacyAI(); - CvAssertMsg(pTargetDiploAI, "pTargetDiploAI is null"); + ASSERT(pTargetDiploAI, "pTargetDiploAI is null"); if(!pTargetDiploAI) { return; @@ -2480,7 +2480,7 @@ void CvPlayerEspionage::GetRandomIntrigue(CvCity* pCity, uint uiSpyIndex) else if (eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { if (::isWorldWonderClass(pBuildingInfo->GetBuildingClassInfo())) @@ -2618,7 +2618,7 @@ void CvPlayerEspionage::GetNextSpyName(CvEspionageSpy* pSpy) /// IsSpyInCity - Checks to see if spy is in a city bool CvPlayerEspionage::IsSpyInCity(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -2629,7 +2629,7 @@ bool CvPlayerEspionage::IsSpyInCity(uint uiSpyIndex) CvCity* CvPlayerEspionage::GetCityWithSpy(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return NULL; @@ -2641,12 +2641,12 @@ CvCity* CvPlayerEspionage::GetCityWithSpy(uint uiSpyIndex) } CvPlot* pCityPlot = GC.getMap().plot(m_aSpyList[uiSpyIndex].m_iCityX, m_aSpyList[uiSpyIndex].m_iCityY); - CvAssertMsg(pCityPlot, "pCityPlot is null. This should have been caught above"); + ASSERT(pCityPlot, "pCityPlot is null. This should have been caught above"); CvCity* pCity = NULL; if(pCityPlot) { pCity = pCityPlot->getPlotCity(); - CvAssertMsg(pCity, "Spy is pointing to empty city, what's up with that"); + ASSERT(pCity, "Spy is pointing to empty city, what's up with that"); } return pCity; @@ -2654,7 +2654,7 @@ CvCity* CvPlayerEspionage::GetCityWithSpy(uint uiSpyIndex) CvEspionageSpy* CvPlayerEspionage::GetSpyByID(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "uiSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return NULL; @@ -2667,7 +2667,7 @@ CvEspionageSpy* CvPlayerEspionage::GetSpyByID(uint uiSpyIndex) int CvPlayerEspionage::GetSpyIndexInCity(CvCity* pCity) { - CvAssertMsg(pCity, "pCity is null. Can't do much with this"); + ASSERT(pCity, "pCity is null. Can't do much with this"); if(!pCity) { return -1; @@ -2687,7 +2687,7 @@ bool CvPlayerEspionage::CanEverMoveSpyTo(CvCity* pCity) } CvPlot* pPlot = pCity->plot(); - CvAssertMsg(pPlot, "No plot() for pCity"); + ASSERT(pPlot, "No plot() for pCity"); if(!pPlot) { return false; @@ -2718,7 +2718,7 @@ bool CvPlayerEspionage::CanEverMoveSpyTo(CvCity* pCity) /// CanMoveSpyTo - May a spy move into this city bool CvPlayerEspionage::CanMoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDiplomat, bool bForce) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return false; @@ -2762,7 +2762,7 @@ bool CvPlayerEspionage::CanMoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDip // check to see if there is someone already there CvCityEspionage* pCityEspionage = pCity->GetCityEspionage(); - CvAssertMsg(pCityEspionage, "pCityEspionage is null"); + ASSERT(pCityEspionage, "pCityEspionage is null"); if(!pCityEspionage) { return false; @@ -2797,7 +2797,7 @@ bool CvPlayerEspionage::CanMoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDip /// MoveSpyTo - Move a spy into this city bool CvPlayerEspionage::MoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDiplomat, bool bForce) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -2820,7 +2820,7 @@ bool CvPlayerEspionage::MoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDiplom if(!ExtractSpyFromCity(uiSpyIndex)) { - CvAssertMsg(false, "Failed to extract spy"); + ASSERT(false, "Failed to extract spy"); return false; } } @@ -2828,7 +2828,7 @@ bool CvPlayerEspionage::MoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDiplom if(pCity) { CvCityEspionage* pCityEspionage = pCity->GetCityEspionage(); - CvAssertMsg(pCityEspionage, "Could not get CvCityEspionage from pCity"); + ASSERT(pCityEspionage, "Could not get CvCityEspionage from pCity"); if(!pCityEspionage) { return false; @@ -2852,7 +2852,7 @@ bool CvPlayerEspionage::MoveSpyTo(CvCity* pCity, uint uiSpyIndex, bool bAsDiplom /// GetNumTurnsSpyMovementBlocked - Get number of remaining turns for which the spy can't move or change missions int CvPlayerEspionage::GetNumTurnsSpyMovementBlocked(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return -1; @@ -2867,7 +2867,7 @@ int CvPlayerEspionage::GetNumTurnsSpyMovementBlocked(uint uiSpyIndex) /// GetNumTurnsSpyActiveMissionsBlocked - Get number of remaining turns for which the spy can't perform active missions int CvPlayerEspionage::GetNumTurnsSpyActiveMissionsBlocked(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return -1; @@ -2882,7 +2882,7 @@ int CvPlayerEspionage::GetNumTurnsSpyActiveMissionsBlocked(uint uiSpyIndex) /// RemoveSpyFromCity - Remove a spy from this city bool CvPlayerEspionage::ExtractSpyFromCity(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -2900,14 +2900,14 @@ bool CvPlayerEspionage::ExtractSpyFromCity(uint uiSpyIndex) int iCityY = pSpy->m_iCityY; CvPlot* pPlot = GC.getMap().plot(iCityX, iCityY); - CvAssertMsg(pPlot, "Spy coordinates did not point to plot"); + ASSERT(pPlot, "Spy coordinates did not point to plot"); if (!pPlot) { return false; } CvCity* pCity = pPlot->getPlotCity(); - CvAssertMsg(pCity, "No city in plot pointed to by spy"); + ASSERT(pCity, "No city in plot pointed to by spy"); if (!pCity) { return false; @@ -3019,7 +3019,7 @@ void CvPlayerEspionage::UpdateSpies() /// UpdateCity - This is called when a city builds a defensive building that will effect the rate of espionage generated void CvPlayerEspionage::UpdateCity(CvCity* pCity) { - CvAssertMsg(pCity, "pCity is null"); + ASSERT(pCity, "pCity is null"); if(pCity == NULL) { return; @@ -3034,7 +3034,7 @@ void CvPlayerEspionage::UpdateCity(CvCity* pCity) } CvCityEspionage* pCityEspionage = pCity->GetCityEspionage(); - CvAssertMsg(pCityEspionage, "pCityEspionage is null"); + ASSERT(pCityEspionage, "pCityEspionage is null"); if(pCityEspionage == NULL) { return; @@ -3047,7 +3047,7 @@ void CvPlayerEspionage::UpdateCity(CvCity* pCity) /// CalcPerTurn - How much the spy will do at this task per turn int CvPlayerEspionage::CalcPerTurn(int iSpyState, CvCity* pCity, int iSpyIndex, bool bGlobalCheck) { - CvAssertMsg(pCity, "pCity is null"); + ASSERT(pCity, "pCity is null"); switch(iSpyState) { case SPY_STATE_TRAVELLING: @@ -3145,7 +3145,7 @@ int CvPlayerEspionage::CalcPerTurn(int iSpyState, CvCity* pCity, int iSpyIndex, break; } - CvAssertMsg(false, "CalcPerTurn cannot handle that iSpyState"); + ASSERT(false, "CalcPerTurn cannot handle that iSpyState"); return -1; } @@ -3153,8 +3153,8 @@ int CvPlayerEspionage::CalcPerTurn(int iSpyState, CvCity* pCity, int iSpyIndex, int CvPlayerEspionage::CalcRequired(int iSpyState, CvCity* pCity, int iSpyIndex, bool bGlobalCheck) { DEBUG_VARIABLE(iSpyIndex); - CvAssertMsg(pCity, "pCity is null"); - CvAssertMsg(iSpyIndex >= 0, "iSpyIndex is out of bounds"); + ASSERT(pCity, "pCity is null"); + ASSERT(iSpyIndex >= 0, "iSpyIndex is out of bounds"); switch (iSpyState) { @@ -3213,8 +3213,8 @@ int CvPlayerEspionage::CalcRequired(int iSpyState, CvCity* pCity, int iSpyIndex, if(pCity) { PlayerTypes ePlayer = pCity->getOwner(); - CvAssertMsg(!GET_PLAYER(ePlayer).isMinorCiv(), "Can't spy on a minor civ"); - CvAssertMsg(!GET_PLAYER(ePlayer).isBarbarian(), "Can't spy on barbarians"); + ASSERT(!GET_PLAYER(ePlayer).isMinorCiv(), "Can't spy on a minor civ"); + ASSERT(!GET_PLAYER(ePlayer).isBarbarian(), "Can't spy on barbarians"); if(GET_PLAYER(ePlayer).isMinorCiv() || GET_PLAYER(ePlayer).isBarbarian()) { return -1; @@ -3276,7 +3276,7 @@ int CvPlayerEspionage::CalcRequired(int iSpyState, CvCity* pCity, int iSpyIndex, break; } - CvAssertMsg(false, "CalcRequired cannot handle that iSpyState"); + ASSERT(false, "CalcRequired cannot handle that iSpyState"); return -1; } @@ -3416,7 +3416,7 @@ const char* CvPlayerEspionage::GetSpyRankName(int iRank) const /// HasEstablishedSurveillance - Has the spy established surveillance in their city bool CvPlayerEspionage::HasEstablishedSurveillance(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -3447,7 +3447,7 @@ bool CvPlayerEspionage::HasEstablishedSurveillance(uint uiSpyIndex) /// HasEstablishedSurveillanceInCity - Has any spy established espionage in this city? bool CvPlayerEspionage::HasEstablishedSurveillanceInCity(CvCity* pCity) { - CvAssertMsg(pCity, "pCity is null"); + ASSERT(pCity, "pCity is null"); if(!pCity) { return false; @@ -3479,13 +3479,13 @@ bool CvPlayerEspionage::IsAnySurveillanceEstablished(PlayerTypes eTargetPlayer) } CvPlot* pPlot = GC.getMap().plot(m_aSpyList[uiSpy].m_iCityX, m_aSpyList[uiSpy].m_iCityY); - CvAssertMsg(pPlot, "Spy coordinates did not point to plot"); + ASSERT(pPlot, "Spy coordinates did not point to plot"); if(!pPlot) { continue; } CvCity* pCity = pPlot->getPlotCity(); - CvAssertMsg(pCity, "There is not a city at the specified plot"); + ASSERT(pCity, "There is not a city at the specified plot"); if(!pCity) { continue; @@ -3513,13 +3513,13 @@ int CvPlayerEspionage::GetSpyReceivingIntrigues(PlayerTypes eTargetPlayer) } CvPlot* pPlot = GC.getMap().plot(m_aSpyList[uiSpy].m_iCityX, m_aSpyList[uiSpy].m_iCityY); - CvAssertMsg(pPlot, "Spy coordinates did not point to plot"); + ASSERT(pPlot, "Spy coordinates did not point to plot"); if (!pPlot) { continue; } CvCity* pCity = pPlot->getPlotCity(); - CvAssertMsg(pCity, "There is not a city at the specified plot"); + ASSERT(pCity, "There is not a city at the specified plot"); if (!pCity) { continue; @@ -3552,7 +3552,7 @@ int CvPlayerEspionage::GetSpyReceivingIntrigues(PlayerTypes eTargetPlayer) bool CvPlayerEspionage::IsDiplomat (uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -3563,7 +3563,7 @@ bool CvPlayerEspionage::IsDiplomat (uint uiSpyIndex) bool CvPlayerEspionage::IsSchmoozing (uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -3583,13 +3583,13 @@ bool CvPlayerEspionage::IsAnySchmoozing (CvCity* pCity) } CvPlot* pPlot = GC.getMap().plot(m_aSpyList[uiSpy].m_iCityX, m_aSpyList[uiSpy].m_iCityY); - CvAssertMsg(pPlot, "Spy coordinates did not point to plot"); + ASSERT(pPlot, "Spy coordinates did not point to plot"); if(!pPlot) { return false; } CvCity* pPlotCity = pPlot->getPlotCity(); - CvAssertMsg(pPlotCity, "There is not a city at the specified plot"); + ASSERT(pPlotCity, "There is not a city at the specified plot"); if(!pPlotCity) { return false; @@ -3605,7 +3605,7 @@ bool CvPlayerEspionage::IsAnySchmoozing (CvCity* pCity) /// CanStageCoup - Can a spy currently stage a coup at a city-state? bool CvPlayerEspionage::CanStageCoup(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return false; @@ -3623,7 +3623,7 @@ bool CvPlayerEspionage::CanStageCoup(uint uiSpyIndex) } CvCity* pCity = GetCityWithSpy(uiSpyIndex); - CvAssertMsg(pCity, "pCity is null!"); + ASSERT(pCity, "pCity is null!"); if(!pCity) { return false; @@ -3695,7 +3695,7 @@ int CvPlayerEspionage::GetCoupChanceOfSuccess(uint uiSpyIndex, bool bIgnoreEnemy } CvCity* pCity = GetCityWithSpy(uiSpyIndex); - CvAssertMsg(pCity, "No city"); + ASSERT(pCity, "No city"); if(!pCity) { return 0; @@ -3713,21 +3713,21 @@ int CvPlayerEspionage::GetTheoreticalChanceOfCoup(CvCity* pCity, int iMySpyRank, } CvCityEspionage* pCityEspionage = pCity->GetCityEspionage(); - CvAssertMsg(pCityEspionage, "No city espionage"); + ASSERT(pCityEspionage, "No city espionage"); if (!pCityEspionage) { return 0; } PlayerTypes eCityOwner = pCity->getOwner(); - CvAssertMsg(GET_PLAYER(eCityOwner).isMinorCiv(), "Owner is not a minor civ"); + ASSERT(GET_PLAYER(eCityOwner).isMinorCiv(), "Owner is not a minor civ"); if (!GET_PLAYER(eCityOwner).isMinorCiv()) { return 0; } CvMinorCivAI* pMinorCivAI = GET_PLAYER(eCityOwner).GetMinorCivAI(); - CvAssertMsg(pMinorCivAI, "pMinorCivAI is null"); + ASSERT(pMinorCivAI, "pMinorCivAI is null"); if (!pMinorCivAI) { return 0; @@ -3821,7 +3821,7 @@ bool CvPlayerEspionage::AttemptCoup(uint uiSpyIndex) } CvCity* pCity = GetCityWithSpy(uiSpyIndex); - CvAssertMsg(pCity, "Spy isn't in a city."); + ASSERT(pCity, "Spy isn't in a city."); if(!pCity) { return false; @@ -3837,7 +3837,7 @@ bool CvPlayerEspionage::AttemptCoup(uint uiSpyIndex) CvMinorCivAI* pMinorCivAI = GET_PLAYER(eCityOwner).GetMinorCivAI(); PlayerTypes ePreviousAlly = pMinorCivAI->GetAlly(); - CvAssertMsg(ePreviousAlly != NO_PLAYER, "City state has no ally. Something's going wrong"); + ASSERT(ePreviousAlly != NO_PLAYER, "City state has no ally. Something's going wrong"); if(ePreviousAlly == NO_PLAYER) { return false; @@ -4080,7 +4080,7 @@ bool CvPlayerEspionage::AttemptCoup(uint uiSpyIndex) /// GetTurnsUntilStateComplete - How many turns until this spy's current state is resolved? int CvPlayerEspionage::GetTurnsUntilStateComplete(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return -2; @@ -4099,7 +4099,7 @@ int CvPlayerEspionage::GetTurnsUntilStateComplete(uint uiSpyIndex) case SPY_STATE_MAKING_INTRODUCTIONS: case SPY_STATE_GATHERING_INTEL: pCity = GetCityWithSpy(uiSpyIndex); - CvAssertMsg(pCity, "GetCityWithSpy returned null. Has the wrong task"); + ASSERT(pCity, "GetCityWithSpy returned null. Has the wrong task"); if (!pCity) { return -1; @@ -4142,7 +4142,7 @@ int CvPlayerEspionage::GetTurnsUntilStateComplete(uint uiSpyIndex) /// GetNetworkPointsStored - How many network points have been collected by the spy on his current mission? int CvPlayerEspionage::GetNetworkPointsStored(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return -2; @@ -4168,7 +4168,7 @@ int CvPlayerEspionage::GetNetworkPointsStored(uint uiSpyIndex) /// GetNetworkPointsStored - What is the highest amount of network points the spy has ever had collected during his current stay? int CvPlayerEspionage::GetMaxNetworkPointsStored(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return -2; @@ -4195,7 +4195,7 @@ int CvPlayerEspionage::GetMaxNetworkPointsStored(uint uiSpyIndex) /// GetNetworkPointsPerTurn - How many network points have been collected by the spy on its current mission? int CvPlayerEspionage::GetNetworkPointsPerTurn(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if (uiSpyIndex >= m_aSpyList.size()) { return -2; @@ -4222,7 +4222,7 @@ int CvPlayerEspionage::GetNetworkPointsPerTurn(uint uiSpyIndex) /// GetPercentOfStateComplete - What percentage of this spy's current state is complete? int CvPlayerEspionage::GetPercentOfStateComplete(uint uiSpyIndex) { - CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); + ASSERT(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds"); if(uiSpyIndex >= m_aSpyList.size()) { return -2; @@ -4256,7 +4256,7 @@ int CvPlayerEspionage::GetPercentOfStateComplete(uint uiSpyIndex) else { pCityEspionage = pCity->GetCityEspionage(); - CvAssertMsg(pCityEspionage->GetGoal(ePlayer) != 0, "Trying to div by zero!"); + ASSERT(pCityEspionage->GetGoal(ePlayer) != 0, "Trying to div by zero!"); if (pCityEspionage->GetGoal(ePlayer) != 0) { return (pCityEspionage->GetAmount(ePlayer) * 100) / pCityEspionage->GetGoal(ePlayer); @@ -4402,7 +4402,7 @@ void CvPlayerEspionage::BuildStealableTechList(PlayerTypes ePlayer) if (ePlayer > MAX_MAJOR_CIVS) return; - CvAssertMsg((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); + ASSERT((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); if((uint)ePlayer >= m_aaPlayerStealableTechList.size()) { return; @@ -4441,7 +4441,7 @@ void CvPlayerEspionage::BuildStealableTechList(PlayerTypes ePlayer) /// IsTechStealable - Check to see if you can steal this tech from an opponent bool CvPlayerEspionage::IsTechStealable(PlayerTypes ePlayer, TechTypes eTech) { - CvAssertMsg((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); + ASSERT((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); if((uint)ePlayer >= m_aaPlayerStealableTechList.size()) { return false; @@ -4461,7 +4461,7 @@ bool CvPlayerEspionage::IsTechStealable(PlayerTypes ePlayer, TechTypes eTech) /// GetNumTechsToSteal - How many techs you can steal from a given player int CvPlayerEspionage::GetNumTechsToSteal(PlayerTypes ePlayer) { - CvAssertMsg((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); + ASSERT((uint)ePlayer < m_aaPlayerStealableTechList.size(), "ePlayer out of bounds"); if((uint)ePlayer >= m_aaPlayerStealableTechList.size()) { return -1; @@ -4471,7 +4471,7 @@ int CvPlayerEspionage::GetNumTechsToSteal(PlayerTypes ePlayer) } int CvPlayerEspionage::GetNumSpyActionsDone(PlayerTypes ePlayer) { - CvAssertMsg((uint)ePlayer < m_aiNumSpyActionsDone.size(), "ePlayer out of bounds"); + ASSERT((uint)ePlayer < m_aiNumSpyActionsDone.size(), "ePlayer out of bounds"); if((uint)ePlayer >= m_aiNumSpyActionsDone.size()) { return -1; @@ -4576,14 +4576,14 @@ void CvPlayerEspionage::ProcessSpyMessages() CvPlot* pPlot = GC.getMap().plot(m_aSpyNotificationMessages[ui].m_iCityX, m_aSpyNotificationMessages[ui].m_iCityY); CvCity* pCity = NULL; CvCityEspionage* pCityEspionage = NULL; - CvAssertMsg(pPlot, "Could not find plot location for SpyNotificationMessages"); + ASSERT(pPlot, "Could not find plot location for SpyNotificationMessages"); if(pPlot) { pCity = pPlot->getPlotCity(); - CvAssertMsg(pCity, "Plot does not contain a city"); + ASSERT(pCity, "Plot does not contain a city"); if(pCity) { - CvAssertMsg(pCity->getOwner() == m_pPlayer->GetID(), "City does not belong to player. This is very strange"); + ASSERT(pCity->getOwner() == m_pPlayer->GetID(), "City does not belong to player. This is very strange"); pCityEspionage = pCity->GetCityEspionage(); } } @@ -4649,7 +4649,7 @@ void CvPlayerEspionage::ProcessSpyMessages() // notify defending player that they killed a spy { int iDefendingSpy = pCityEspionage->m_aiSpyAssignment[m_pPlayer->GetID()]; - CvAssertMsg(iDefendingSpy >= 0, "iDefendingSpy value is out of bounds"); + ASSERT(iDefendingSpy >= 0, "iDefendingSpy value is out of bounds"); if (iDefendingSpy >= 0) { Localization::String strSummary = Localization::Lookup("TXT_KEY_NOTIFICATION_KILLED_A_SPY_S"); @@ -4672,7 +4672,7 @@ void CvPlayerEspionage::ProcessSpyMessages() break; case SPY_RESULT_KILLED_NOT_IDENTIFIED: { - CvAssertMsg(false, "This code was not expected to be called"); + ASSERT(false, "This code was not expected to be called"); } break; } @@ -4729,7 +4729,7 @@ void CvPlayerEspionage::ProcessSpyMessages() case SPY_RESULT_KILLED_NOT_IDENTIFIED: // notify defending player that they killed a spy { - CvAssertMsg(false, "This code was not expected to be called"); + ASSERT(false, "This code was not expected to be called"); } break; } @@ -4907,7 +4907,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe if (bShowNotification) { CvNotifications* pNotifications = m_pPlayer->GetNotifications(); - CvAssertMsg(pNotifications, "No notifications found. This is wrong!"); + ASSERT(pNotifications, "No notifications found. This is wrong!"); if(!pNotifications) { return; @@ -4934,7 +4934,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe strNotification = Localization::Lookup("TXT_KEY_NOTIFICATION_INTRIGUE_PLOTTING_AGAINST_YOU"); strNotification << strDiscoveringSpyRank; strNotification << strDiscoveringSpyName; - CvAssertMsg(pCity, "City should be defined but is null"); + ASSERT(pCity, "City should be defined but is null"); if(pCity) { strNotification << pCity->getNameKey(); @@ -4963,7 +4963,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe strNotification = Localization::Lookup("TXT_KEY_NOTIFICATION_INTRIGUE_PLOTTING_AGAINST_UNKNOWN"); strNotification << strDiscoveringSpyRank; strNotification << strDiscoveringSpyName; - CvAssertMsg(pCity, "City should be defined but is null"); + ASSERT(pCity, "City should be defined but is null"); if(pCity) { strNotification << pCity->getNameKey(); @@ -5001,7 +5001,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe strNotification = Localization::Lookup("TXT_KEY_NOTIFICATION_INTRIGUE_PLOTTING_AGAINST_KNOWN"); strNotification << strDiscoveringSpyRank; strNotification << strDiscoveringSpyName; - CvAssertMsg(pCity, "City should be defined but is null"); + ASSERT(pCity, "City should be defined but is null"); if(pCity) { strNotification << pCity->getNameKey(); @@ -5671,7 +5671,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe if (kMessage.m_eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(kMessage.m_eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { strSummary << pBuildingInfo->GetTextKey(); @@ -5680,7 +5680,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eProject != NO_PROJECT) { CvProjectEntry* pProjectInfo = GC.getProjectInfo(kMessage.m_eProject); - CvAssertMsg(pProjectInfo, "pProjectInfo is null"); + ASSERT(pProjectInfo, "pProjectInfo is null"); if (pProjectInfo) { strSummary << pProjectInfo->GetTextKey(); @@ -5702,7 +5702,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe if (kMessage.m_eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(kMessage.m_eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { strNotification << pBuildingInfo->GetTextKey(); @@ -5711,7 +5711,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eProject != NO_PROJECT) { CvProjectEntry* pProjectInfo = GC.getProjectInfo(kMessage.m_eProject); - CvAssertMsg(pProjectInfo, "pProjectInfo is null"); + ASSERT(pProjectInfo, "pProjectInfo is null"); if (pProjectInfo) { strNotification << pProjectInfo->GetTextKey(); @@ -5741,7 +5741,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe if (kMessage.m_eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(kMessage.m_eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { strSummary << pBuildingInfo->GetTextKey(); @@ -5750,7 +5750,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eProject != NO_PROJECT) { CvProjectEntry* pProjectInfo = GC.getProjectInfo(kMessage.m_eProject); - CvAssertMsg(pProjectInfo, "pProjectInfo is null"); + ASSERT(pProjectInfo, "pProjectInfo is null"); if (pProjectInfo) { strSummary << pProjectInfo->GetTextKey(); @@ -5759,7 +5759,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eUnit != NO_UNIT) { CvUnitEntry* pUnitInfo = GC.getUnitInfo(kMessage.m_eUnit); - CvAssertMsg(pUnitInfo, "pUnitInfo is null"); + ASSERT(pUnitInfo, "pUnitInfo is null"); if (pUnitInfo) { strSummary << pUnitInfo->GetTextKey(); @@ -5781,7 +5781,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe if (kMessage.m_eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(kMessage.m_eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { strNotification << pBuildingInfo->GetTextKey(); @@ -5790,7 +5790,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eProject != NO_PROJECT) { CvProjectEntry* pProjectInfo = GC.getProjectInfo(kMessage.m_eProject); - CvAssertMsg(pProjectInfo, "pProjectInfo is null"); + ASSERT(pProjectInfo, "pProjectInfo is null"); if (pProjectInfo) { strNotification << pProjectInfo->GetTextKey(); @@ -5799,7 +5799,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe else if (kMessage.m_eUnit != NO_UNIT) { CvUnitEntry* pUnitInfo = GC.getUnitInfo(kMessage.m_eUnit); - CvAssertMsg(pUnitInfo, "pUnitInfo is null"); + ASSERT(pUnitInfo, "pUnitInfo is null"); if (pUnitInfo) { strNotification << pUnitInfo->GetTextKey(); @@ -5816,7 +5816,7 @@ void CvPlayerEspionage::AddIntrigueMessage(PlayerTypes eDiscoveringPlayer, Playe /// GetIntrigueMessage - Getting the intrigue message in another text format for the intrigue message display Localization::String CvPlayerEspionage::GetIntrigueMessage(uint uiIndex) { - CvAssertMsg(uiIndex < m_aIntrigueNotificationMessages.size(), "uiIndex out of bounds"); + ASSERT(uiIndex < m_aIntrigueNotificationMessages.size(), "uiIndex out of bounds"); if(uiIndex >= m_aIntrigueNotificationMessages.size()) { return ""; @@ -6259,7 +6259,7 @@ Localization::String CvPlayerEspionage::GetIntrigueMessage(uint uiIndex) if (m_aIntrigueNotificationMessages[uiIndex].m_eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(m_aIntrigueNotificationMessages[uiIndex].m_eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { strResult << pBuildingInfo->GetTextKey(); @@ -6268,7 +6268,7 @@ Localization::String CvPlayerEspionage::GetIntrigueMessage(uint uiIndex) else if (m_aIntrigueNotificationMessages[uiIndex].m_eProject != NO_PROJECT) { CvProjectEntry* pProjectInfo = GC.getProjectInfo(m_aIntrigueNotificationMessages[uiIndex].m_eProject); - CvAssertMsg(pProjectInfo, "pProjectInfo is null"); + ASSERT(pProjectInfo, "pProjectInfo is null"); if (pProjectInfo) { strResult << pProjectInfo->GetTextKey(); @@ -6277,7 +6277,7 @@ Localization::String CvPlayerEspionage::GetIntrigueMessage(uint uiIndex) else if (m_aIntrigueNotificationMessages[uiIndex].m_eUnit != NO_UNIT) { CvUnitEntry* pUnitInfo = GC.getUnitInfo(m_aIntrigueNotificationMessages[uiIndex].m_eUnit); - CvAssertMsg(pUnitInfo, "pUnitInfo is null"); + ASSERT(pUnitInfo, "pUnitInfo is null"); if (pUnitInfo) { strResult << pUnitInfo->GetTextKey(); @@ -6831,9 +6831,9 @@ void CvCityEspionage::Reset(void) /// SetActivity - setting the values that get processed void CvCityEspionage::SetActivity(PlayerTypes ePlayer, int iAmount, int iRate, int iGoal) { - CvAssertMsg(m_aiAmount[ePlayer] == -1, "Amount has not been reset"); - CvAssertMsg(m_aiRate[ePlayer] == -1, "Rate has not been reset"); - CvAssertMsg(m_aiGoal[ePlayer] == -1, "Goal has not been reset"); + ASSERT(m_aiAmount[ePlayer] == -1, "Amount has not been reset"); + ASSERT(m_aiRate[ePlayer] == -1, "Rate has not been reset"); + ASSERT(m_aiGoal[ePlayer] == -1, "Goal has not been reset"); m_aiAmount[ePlayer] = iAmount; m_aiMaxAmount[ePlayer] = iAmount; m_aiRate[ePlayer] = iRate; @@ -6843,9 +6843,9 @@ void CvCityEspionage::SetActivity(PlayerTypes ePlayer, int iAmount, int iRate, i /// Process - move one step of the rate into the amount void CvCityEspionage::Process(PlayerTypes ePlayer) { - CvAssertMsg(m_aiAmount[ePlayer] != -1, "Amount has not been set"); - CvAssertMsg(m_aiRate[ePlayer] != -1, "Rate has not been set"); - CvAssertMsg(m_aiGoal[ePlayer] != -1, "Goal has not been set"); + ASSERT(m_aiAmount[ePlayer] != -1, "Amount has not been set"); + ASSERT(m_aiRate[ePlayer] != -1, "Rate has not been set"); + ASSERT(m_aiGoal[ePlayer] != -1, "Goal has not been set"); ChangeAmount(ePlayer, GetRate(ePlayer)); SetMaxAmount(ePlayer, max(GetMaxAmount(ePlayer), GetAmount(ePlayer))); } @@ -6911,9 +6911,9 @@ void CvCityEspionage::SetNextPassiveBonus(PlayerTypes ePlayer, int iValue) /// HasReachedGoal - is the amount >= the goal bool CvCityEspionage::HasReachedGoal(PlayerTypes ePlayer) { - CvAssertMsg(m_aiAmount[ePlayer] != -1, "Amount has not been set"); - CvAssertMsg(m_aiRate[ePlayer] != -1, "Rate has not been set"); - CvAssertMsg(m_aiGoal[ePlayer] != -1, "Goal has not been set"); + ASSERT(m_aiAmount[ePlayer] != -1, "Amount has not been set"); + ASSERT(m_aiRate[ePlayer] != -1, "Rate has not been set"); + ASSERT(m_aiGoal[ePlayer] != -1, "Goal has not been set"); return GetAmount(ePlayer) >= GetGoal(ePlayer); } @@ -7295,14 +7295,14 @@ int CvCityEspionage::GetSpyResult(PlayerTypes eSpyOwner) void CvCityEspionage::SetPendingEvents(PlayerTypes ePlayer, int iValue) { - CvAssert(iValue >= 0); + ASSERT(iValue >= 0); m_aiPendingEventsForPlayer[ePlayer] = iValue; } void CvCityEspionage::ChangePendingEvents(PlayerTypes ePlayer, int iChange) { m_aiPendingEventsForPlayer[ePlayer] += iChange; - CvAssert(m_aiPendingEventsForPlayer[ePlayer] >= 0); + ASSERT(m_aiPendingEventsForPlayer[ePlayer] >= 0); } int CvCityEspionage::GetPendingEvents(PlayerTypes ePlayer) const @@ -7726,7 +7726,7 @@ struct PlayerAndTechTurnEval { bool operator()(PlayerAndTechTurn const& a, PlayerAndTechTurn const& b) const { - CvAssertMsg(g_eSortPlayer != NO_PLAYER, "g_eSortPlayer not defined when sort was called"); + ASSERT(g_eSortPlayer != NO_PLAYER, "g_eSortPlayer not defined when sort was called"); if(a.iOutOfTechTurn < b.iOutOfTechTurn) return true; if(a.iOutOfTechTurn > b.iOutOfTechTurn) return false; if(a.iLargestProgress > b.iLargestProgress) return true; @@ -8211,7 +8211,7 @@ void CvEspionageAI::StealTechnology() while(pEspionage->m_aiNumTechsToStealList[uiDefendingPlayer] > 0) { // steal a tech - CvAssertMsg(pEspionage->m_aaPlayerStealableTechList[uiDefendingPlayer].size() > 0, "pEspionage->m_aaPlayerStealableTechList[uiPlayer] list is empty. Not good"); + ASSERT(pEspionage->m_aaPlayerStealableTechList[uiDefendingPlayer].size() > 0, "pEspionage->m_aaPlayerStealableTechList[uiPlayer] list is empty. Not good"); TeamTypes eTeam = m_pPlayer->getTeam(); TechTypes eStolenTech = pEspionage->m_aaPlayerStealableTechList[uiDefendingPlayer][0]; GET_TEAM(eTeam).setHasTech(eStolenTech, true, m_pPlayer->GetID(), true, true); @@ -8583,7 +8583,7 @@ int CvEspionageAI::GetMissionScore(CvCity* pCity, CityEventChoiceTypes eMission, if (eBuilding != NO_BUILDING) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null"); + ASSERT(pBuildingInfo, "pBuildingInfo is null"); if (pBuildingInfo) { if (::isWorldWonderClass(pBuildingInfo->GetBuildingClassInfo())) @@ -9035,7 +9035,7 @@ std::vector CvEspionageAI::BuildOffenseCityList(bool bLogAllChoi for (CvCity* pLoopCity = GET_PLAYER(eTargetPlayer).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER(eTargetPlayer).nextCity(&iLoop)) { CvPlot* pCityPlot = pLoopCity->plot(); - CvAssertMsg(pCityPlot, "City plot is null!"); + ASSERT(pCityPlot, "City plot is null!"); if (!pCityPlot || !pLoopCity->isRevealed(m_pPlayer->getTeam(), false, false)) continue; diff --git a/CvGameCoreDLL_Expansion2/CvFlavorManager.cpp b/CvGameCoreDLL_Expansion2/CvFlavorManager.cpp index cb6efb247e..561aafee66 100644 --- a/CvGameCoreDLL_Expansion2/CvFlavorManager.cpp +++ b/CvGameCoreDLL_Expansion2/CvFlavorManager.cpp @@ -48,7 +48,7 @@ bool CvFlavorRecipient::IsCity() const /// Public function that other classes can call to set/reset this recipient's flavors void CvFlavorRecipient::SetFlavors(const CvEnumMap& piUpdatedFlavorValues, const char* reason) { - CvAssertMsg(piUpdatedFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor recipient"); + ASSERT(piUpdatedFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor recipient"); if(!piUpdatedFlavorValues.valid()) return; @@ -65,7 +65,7 @@ void CvFlavorRecipient::SetFlavors(const CvEnumMap& piUpdatedF /// Public function that other classes can call to change this recipient's flavors void CvFlavorRecipient::ChangeFlavors(const CvEnumMap& piDeltaFlavorValues, const char* reason, bool effectstart) { - CvAssertMsg(piDeltaFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor recipient"); + ASSERT(piDeltaFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor recipient"); if(!piDeltaFlavorValues.valid()) return; @@ -86,8 +86,8 @@ void CvFlavorRecipient::ChangeFlavors(const CvEnumMap& piDelta /// LatestFlavorValue Accessor Function int CvFlavorRecipient::GetLatestFlavorValue(FlavorTypes eFlavor, bool bAllowNegative) { - CvAssertMsg(eFlavor > -1, "Out of bounds."); - CvAssertMsg(eFlavor < GC.getNumFlavorTypes(), "Out of bounds."); + ASSERT(eFlavor > -1, "Out of bounds."); + ASSERT(eFlavor < GC.getNumFlavorTypes(), "Out of bounds."); if(m_piLatestFlavorValues[eFlavor] < 0 && !bAllowNegative) { @@ -289,7 +289,7 @@ void CvFlavorManager::ChangeLeader(LeaderHeadTypes eOldLeader, LeaderHeadTypes e /// Update to a new set of flavors void CvFlavorManager::ChangeActivePersonalityFlavors(const CvEnumMap& piDeltaFlavorValues, const char* reason, bool effectstart) { - CvAssertMsg(piDeltaFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor manager"); + ASSERT(piDeltaFlavorValues.valid(), "Invalid map of flavor deltas passed to flavor manager"); if(!piDeltaFlavorValues.valid()) return; @@ -362,7 +362,7 @@ void CvFlavorManager::AdjustWeightsForMap() int iGrowthIndex = GC.getInfoTypeForString("FLAVOR_GROWTH"); // Boost expansion - CvAssert(iExpansionIndex >= 0 && iExpansionIndex < iNumFlavorTypes); + ASSERT(iExpansionIndex >= 0 && iExpansionIndex < iNumFlavorTypes); if (iExpansionIndex >= 0 && iExpansionIndex < iNumFlavorTypes) { m_piPersonalityFlavor[iExpansionIndex] += iAdjust; @@ -373,7 +373,7 @@ void CvFlavorManager::AdjustWeightsForMap() } // Reduce growth - CvAssert(iGrowthIndex >= 0 && iGrowthIndex < iNumFlavorTypes); + ASSERT(iGrowthIndex >= 0 && iGrowthIndex < iNumFlavorTypes); if (iGrowthIndex >= 0 && iGrowthIndex < iNumFlavorTypes) { m_piPersonalityFlavor[iGrowthIndex] -= iAdjust; diff --git a/CvGameCoreDLL_Expansion2/CvFractal.cpp b/CvGameCoreDLL_Expansion2/CvFractal.cpp index 072cd16ed7..40b8292797 100644 --- a/CvGameCoreDLL_Expansion2/CvFractal.cpp +++ b/CvGameCoreDLL_Expansion2/CvFractal.cpp @@ -121,7 +121,7 @@ void CvFractal::fracInitInternal(int iNewXs, int iNewYs, int iGrain, CvRandom& r int iHintsHeight = (1 << (m_iFracYExp - iSmooth)) + ((m_iFlags & FRAC_WRAP_Y) ? 0 : 1); if(pbyHints != NULL) { - CvAssertMsg(iHintsLength == iHintsWidth*iHintsHeight, "pbyHints is the wrong size!") + ASSERT(iHintsLength == iHintsWidth*iHintsHeight, "pbyHints is the wrong size!") } for(iPass = iSmooth; iPass >= 0; iPass--) @@ -209,7 +209,7 @@ void CvFractal::fracInitInternal(int iNewXs, int iNewYs, int iGrain, CvRandom& r int iHintsI = iYY*iHintsWidth + iXX; DEBUG_VARIABLE(iHintsLength); - CvAssertMsg(iHintsI < iHintsLength, "iHintsI out of range"); + ASSERT(iHintsI < iHintsLength, "iHintsI out of range"); m_aaiFrac[iX << iPass][iY << iPass] = pbyHints[iHintsI]; } } @@ -290,10 +290,10 @@ int CvFractal::getHeight(int iX, int iY) int iLowX = 0; int iLowY = 0; - CvAssertMsg(0 <= iX && iX < m_iXs, "iX out of range"); + ASSERT(0 <= iX && iX < m_iXs, "iX out of range"); if(0 > iX || iX >= m_iXs) return 0; - CvAssertMsg(0 <= iY && iY < m_iYs, "iY out of range"); + ASSERT(0 <= iY && iY < m_iYs, "iY out of range"); if(0 > iY || iY >= m_iYs) return 0; iLowX = ((m_iXInc * iX) / FLOAT_PRECISION); diff --git a/CvGameCoreDLL_Expansion2/CvGame.cpp b/CvGameCoreDLL_Expansion2/CvGame.cpp index 7f4718b00e..cc5bfe1f4c 100644 --- a/CvGameCoreDLL_Expansion2/CvGame.cpp +++ b/CvGameCoreDLL_Expansion2/CvGame.cpp @@ -526,7 +526,7 @@ bool CvGame::InitMap(CvGameInitialItemsOverrides& kGameInitialItemsOverrides) else { // Empty map... - FAssertMsg(0, "Empty World Builder Map!"); + ASSERT(0, "Empty World Builder Map!"); // Make the map at least 1 x 1 to avoid crashes CvMapInitData kMapInitData; @@ -1181,7 +1181,7 @@ void CvGame::reset(HandicapTypes eHandicap, bool bConstructorCall) { if(GetLastError() != ERROR_FILE_NOT_FOUND) { - CvAssertMsg(false, "Warning! Cannot delete existing Civ5SavedGameDatabase! Does something have it opened?"); + ASSERT(false, "Warning! Cannot delete existing Civ5SavedGameDatabase! Does something have it opened?"); } } @@ -1192,7 +1192,7 @@ void CvGame::reset(HandicapTypes eHandicap, bool bConstructorCall) } else { - CvAssertMsg(false, "Warning! Cannot create new Civ5SavedGameDatabase."); + ASSERT(false, "Warning! Cannot create new Civ5SavedGameDatabase."); } @@ -1217,9 +1217,9 @@ void CvGame::reset(HandicapTypes eHandicap, bool bConstructorCall) m_paiProjectCreatedCount.init(0); //antonjs: todo: remove unused UN and voting variables and allocations - CvAssertMsg(0 < GC.getNumVoteInfos(), "GC.getNumVoteInfos() is not greater than zero in CvGame::reset"); + ASSERT(0 < GC.getNumVoteInfos(), "GC.getNumVoteInfos() is not greater than zero in CvGame::reset"); - CvAssertMsg(0 < GC.getNumVoteSourceInfos(), "GC.getNumVoteSourceInfos() is not greater than zero in CvGame::reset"); + ASSERT(0 < GC.getNumVoteSourceInfos(), "GC.getNumVoteSourceInfos() is not greater than zero in CvGame::reset"); m_aiVotesCast.init(NO_TEAM); m_aiPreviousVotesCast.init(NO_TEAM); m_aiNumVotesForTeam.init(0); @@ -1243,46 +1243,46 @@ void CvGame::reset(HandicapTypes eHandicap, bool bConstructorCall) } #endif - CvAssertMsg(m_pSettlerSiteEvaluator==NULL, "about to leak memory, CvGame::m_pSettlerSiteEvaluator"); + ASSERT(m_pSettlerSiteEvaluator==NULL, "about to leak memory, CvGame::m_pSettlerSiteEvaluator"); m_pSettlerSiteEvaluator = FNEW(CvSiteEvaluatorForSettler, c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pStartSiteEvaluator==NULL, "about to leak memory, CvGame::m_pStartSiteEvaluator"); + ASSERT(m_pStartSiteEvaluator==NULL, "about to leak memory, CvGame::m_pStartSiteEvaluator"); m_pStartSiteEvaluator = FNEW(CvCitySiteEvaluator, c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pStartPositioner==NULL, "about to leak memory, CvGame::m_pStartPositioner"); + ASSERT(m_pStartPositioner==NULL, "about to leak memory, CvGame::m_pStartPositioner"); m_pStartPositioner = new CvStartPositioner(m_pStartSiteEvaluator); m_kGameDeals.Init(); - CvAssertMsg(m_pGameReligions==NULL, "about to leak memory, CvGame::m_pGameReligions"); + ASSERT(m_pGameReligions==NULL, "about to leak memory, CvGame::m_pGameReligions"); m_pGameReligions = FNEW(CvGameReligions, c_eCiv5GameplayDLL, 0); m_pGameReligions->Init(); #if defined(MOD_BALANCE_CORE) - CvAssertMsg(m_pGameCorporations==NULL, "about to leak memory, CvGame::m_pGameCorporations"); + ASSERT(m_pGameCorporations==NULL, "about to leak memory, CvGame::m_pGameCorporations"); m_pGameCorporations = FNEW(CvGameCorporations, c_eCiv5GameplayDLL, 0); m_pGameCorporations->Init(); - CvAssertMsg(m_pGameContracts==NULL, "about to leak memory, CvGame::m_pGameContracts"); + ASSERT(m_pGameContracts==NULL, "about to leak memory, CvGame::m_pGameContracts"); m_pGameContracts = FNEW(CvGameContracts, c_eCiv5GameplayDLL, 0); m_pGameContracts->Init(); #endif - CvAssertMsg(m_pGameCulture==NULL, "about to leak memory, CvGame::m_pGameCulture"); + ASSERT(m_pGameCulture==NULL, "about to leak memory, CvGame::m_pGameCulture"); m_pGameCulture = FNEW(CvGameCulture, c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pGameLeagues==NULL, "about to leak memory, CvGame::m_pGameLeagues"); + ASSERT(m_pGameLeagues==NULL, "about to leak memory, CvGame::m_pGameLeagues"); m_pGameLeagues = FNEW(CvGameLeagues, c_eCiv5GameplayDLL, 0); m_pGameLeagues->Init(); - CvAssertMsg(m_pGameTrade==NULL, "about to leak memory, CvGame::m_pGameTrade"); + ASSERT(m_pGameTrade==NULL, "about to leak memory, CvGame::m_pGameTrade"); m_pGameTrade = FNEW(CvGameTrade, c_eCiv5GameplayDLL, 0); m_pGameTrade->Init(); - CvAssertMsg(m_pAdvisorCounsel==NULL, "about to leak memory, CvGame::m_pAdvisorCounsel"); + ASSERT(m_pAdvisorCounsel==NULL, "about to leak memory, CvGame::m_pAdvisorCounsel"); m_pAdvisorCounsel = FNEW(CvAdvisorCounsel, c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pAdvisorRecommender==NULL, "about to leak memory, CvGame::m_pAdvisorRecommender"); + ASSERT(m_pAdvisorRecommender==NULL, "about to leak memory, CvGame::m_pAdvisorRecommender"); m_pAdvisorRecommender = FNEW(CvAdvisorRecommender, c_eCiv5GameplayDLL, 0); m_eTechAstronomy = (TechTypes)GC.getInfoTypeForString("TECH_ASTRONOMY"); @@ -1844,7 +1844,7 @@ void CvGame::DoCacheMapScoreMod() CvWorldInfo kWorldInfo; const bool bResult = DB.SelectAt(kResult, "Worlds", eStandardWorld); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "Cannot find world info."); + ASSERT(bResult, "Cannot find world info."); kWorldInfo.CacheResult(kResult); iBaseNumTiles = kWorldInfo.getGridWidth(); @@ -2148,7 +2148,7 @@ void CvGame::updateTestEndTurn() else if(activePlayer.hasReadyUnit()) { const CvUnit* pUnit = activePlayer.GetFirstReadyUnit(); - CvAssertMsg(pUnit, "GetFirstReadyUnit is returning null"); + ASSERT(pUnit, "GetFirstReadyUnit is returning null"); if(pUnit) { if(!pUnit->canHold(pUnit->plot())) @@ -2493,14 +2493,14 @@ void CvGame::cycleUnits(bool bClear, bool bForward, bool bWorkers) if(pNextUnit != NULL && !bWrap) { - CvAssert(pNextUnit->getOwner() == eActivePlayer); + ASSERT(pNextUnit->getOwner() == eActivePlayer); selectUnit(pNextUnit, bClear); bProcessed = true; } if(pNextUnit != NULL /*&& bWrap */&& !pCycleCity && !bProcessed) { - CvAssert(pNextUnit->getOwner() == eActivePlayer); + ASSERT(pNextUnit->getOwner() == eActivePlayer); selectUnit(pNextUnit, bClear); } @@ -2526,7 +2526,7 @@ bool CvGame::cyclePlotUnits(CvPlot* pPlot, bool bForward, bool bAuto, int iCount CvUnit* pSelectedUnit = NULL; CvUnit* pLoopUnit = NULL; - CvAssertMsg(iCount >= -1, "iCount expected to be >= -1"); + ASSERT(iCount >= -1, "iCount expected to be >= -1"); if(iCount == -1) { @@ -2731,7 +2731,7 @@ void CvGame::selectionListGameNetMessage(int eMessage, int iData2, int iData3, i } else { - CvAssert(false); + ASSERT(false); } } } @@ -2750,7 +2750,7 @@ void CvGame::selectedCitiesGameNetMessage(int eMessage, int iData2, int iData3, { pSelectedCity = ::GetPlayerCity(*pSelectedCityNode); pSelectedCityNode = GC.GetEngineUserInterface()->nextSelectedCitiesNode(pSelectedCityNode); - CvAssert(pSelectedCity); + ASSERT(pSelectedCity); if(pSelectedCity != NULL) { @@ -2781,7 +2781,7 @@ void CvGame::selectedCitiesGameNetMessage(int eMessage, int iData2, int iData3, break; default: - CvAssert(false); + ASSERT(false); break; } } @@ -2793,7 +2793,7 @@ void CvGame::selectedCitiesGameNetMessage(int eMessage, int iData2, int iData3, // -------------------------------------------------------------------------------- void CvGame::cityPushOrder(CvCity* pCity, OrderTypes eOrder, int iData, bool bAlt, bool bShift, bool bCtrl) { - CvAssert(pCity); + ASSERT(pCity); if(!pCity) return; gDLL->sendPushOrder(pCity->GetID(), eOrder, iData, bAlt, bShift, bCtrl); } @@ -2801,7 +2801,7 @@ void CvGame::cityPushOrder(CvCity* pCity, OrderTypes eOrder, int iData, bool bAl // -------------------------------------------------------------------------------- void CvGame::CityPurchase(CvCity* pCity, UnitTypes eUnitType, BuildingTypes eBuildingType, ProjectTypes eProjectType, YieldTypes ePurchaseYield) { - CvAssert(pCity); + ASSERT(pCity); if(!pCity) return; // we're trying to buy a unit @@ -2909,7 +2909,7 @@ void CvGame::selectGroup(CvUnit* pUnit, bool bShift, bool bCtrl, bool bAlt) cons CvPlot* pUnitPlot = NULL; bool bGroup = false; - CvAssertMsg(pUnit != NULL, "pUnit == NULL unexpectedly"); + ASSERT(pUnit != NULL, "pUnit == NULL unexpectedly"); if(bAlt || bCtrl) { @@ -3052,7 +3052,7 @@ bool CvGame::canHandleAction(int iAction, CvPlot* pPlot, bool bTestVisible) bool bShift = gDLL->shiftKey(); CvActionInfo* pActionInfo = GC.getActionInfo(iAction); - CvAssert(pActionInfo != NULL); + ASSERT(pActionInfo != NULL); if(!pActionInfo) return false; if(pActionInfo->getControlType() != NO_CONTROL) @@ -3429,7 +3429,7 @@ bool CvGame::canDoControl(ControlTypes eControl) break; default: - CvAssertMsg(false, "eControl did not match any valid options"); + ASSERT(false, "eControl did not match any valid options"); break; } @@ -3951,7 +3951,7 @@ void CvGame::doControl(ControlTypes eControl) break; default: - CvAssertMsg(false, "eControl did not match any valid options"); + ASSERT(false, "eControl did not match any valid options"); break; } } @@ -4377,10 +4377,10 @@ int CvGame::goldenAgeLength(int iManualLength) const // -------------------------------------------------------------------------------- int CvGame::victoryDelay(VictoryTypes eVictory) const { - CvAssert(eVictory >= 0 && eVictory < GC.getNumVictoryInfos()); + ASSERT(eVictory >= 0 && eVictory < GC.getNumVictoryInfos()); CvVictoryInfo* pkVictoryInfo = GC.getVictoryInfo(eVictory); - CvAssert(pkVictoryInfo); + ASSERT(pkVictoryInfo); if(pkVictoryInfo == NULL) return 0; @@ -4437,7 +4437,7 @@ int CvGame::getImprovementUpgradeTimeMod(ImprovementTypes eImprovement, const Cv int CvGame::getImprovementUpgradeTime(ImprovementTypes eImprovement, const CvPlot* pPlot) const { CvImprovementEntry* pkImprovementInfo = GC.getImprovementInfo(eImprovement); - CvAssert(pkImprovementInfo); + ASSERT(pkImprovementInfo); if(pkImprovementInfo == NULL) return 0; @@ -4570,7 +4570,7 @@ bool CvGame::isGameMultiPlayer() const // -------------------------------------------------------------------------------- bool CvGame::isTeamGame() const { - CvAssert(countCivPlayersAlive() >= countCivTeamsAlive()); + ASSERT(countCivPlayersAlive() >= countCivTeamsAlive()); return (countCivPlayersAlive() > countCivTeamsAlive()); } @@ -4641,7 +4641,7 @@ void CvGame::setGameTurn(int iNewValue) gDLL->netMessageDebugLog(turnMessage); CvPreGame::setGameTurn(iNewValue); - CvAssert(getGameTurn() >= 0); + ASSERT(getGameTurn() >= 0); setScoreDirty(true); @@ -4700,7 +4700,7 @@ int CvGame::getMaxTurns() const void CvGame::setMaxTurns(int iNewValue) const { CvPreGame::setMaxTurns(iNewValue); - CvAssert(getMaxTurns() >= 0); + ASSERT(getMaxTurns() >= 0); } @@ -4722,7 +4722,7 @@ int CvGame::getMaxCityElimination() const void CvGame::setMaxCityElimination(int iNewValue) const { CvPreGame::setMaxCityElimination(iNewValue); - CvAssert(getMaxCityElimination() >= 0); + ASSERT(getMaxCityElimination() >= 0); } // -------------------------------------------------------------------------------- @@ -4952,7 +4952,7 @@ int CvGame::getTargetScore() const void CvGame::setTargetScore(int iNewValue) const { CvPreGame::setTargetScore(iNewValue); - CvAssert(getTargetScore() >= 0); + ASSERT(getTargetScore() >= 0); } @@ -5007,7 +5007,7 @@ void CvGame::changeNumGameTurnActive(int iChange, const std::string& why) output += activeBuf; output += " : " + why; gDLL->netMessageDebugLog(output); - CvAssert(getNumGameTurnActive() >= 0); + ASSERT(getNumGameTurnActive() >= 0); } @@ -5029,7 +5029,7 @@ int CvGame::getNumCivCities() const void CvGame::changeNumCities(int iChange) { m_iNumCities = (m_iNumCities + iChange); - CvAssert(getNumCities() >= 0); + ASSERT(getNumCities() >= 0); } @@ -5044,7 +5044,7 @@ int CvGame::getTotalPopulation() const void CvGame::changeTotalPopulation(int iChange) { m_iTotalPopulation = (m_iTotalPopulation + iChange); - CvAssert(getTotalPopulation() >= 0); + ASSERT(getTotalPopulation() >= 0); } // -------------------------------------------------------------------------------- @@ -5058,7 +5058,7 @@ int CvGame::getTotalEconomicValue() const void CvGame::setTotalEconomicValue(int iChange) { m_iTotalEconomicValue = iChange; - CvAssert(getTotalEconomicValue() >= 0); + ASSERT(getTotalEconomicValue() >= 0); } // -------------------------------------------------------------------------------- @@ -5072,7 +5072,7 @@ int CvGame::getHighestEconomicValue() const void CvGame::setHighestEconomicValue(int iChange) { m_iHighestEconomicValue = iChange; - CvAssert(getHighestEconomicValue() >= 0); + ASSERT(getHighestEconomicValue() >= 0); } // -------------------------------------------------------------------------------- @@ -5085,7 +5085,7 @@ int CvGame::getMedianEconomicValue() const void CvGame::setMedianEconomicValue(int iChange) { m_iMedianEconomicValue = iChange; - CvAssert(getMedianEconomicValue() >= 0); + ASSERT(getMedianEconomicValue() >= 0); } // -------------------------------------------------------------------------------- @@ -5106,7 +5106,7 @@ bool CvGame::isNoNukes() const void CvGame::changeNoNukesCount(int iChange) { m_iNoNukesCount = (m_iNoNukesCount + iChange); - CvAssert(getNoNukesCount() >= 0); + ASSERT(getNoNukesCount() >= 0); } // -------------------------------------------------------------------------------- @@ -5494,7 +5494,7 @@ void CvGame::DoUpdateDiploVictory() { LeagueSpecialSessionTypes e = (LeagueSpecialSessionTypes)i; CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(e); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { if (pInfo->IsUnitedNations()) @@ -5709,8 +5709,8 @@ void CvGame::SetNumVictoryVotesExpected(int iValue) // -------------------------------------------------------------------------------- TeamTypes CvGame::GetVoteCast(TeamTypes eVotingTeam) const { - CvAssertMsg(eVotingTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eVotingTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eVotingTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eVotingTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); return (TeamTypes) m_aiVotesCast[eVotingTeam]; } @@ -5720,8 +5720,8 @@ TeamTypes CvGame::GetVoteCast(TeamTypes eVotingTeam) const /// Preliminary votes will be counted, but will not trigger victory void CvGame::SetVoteCast(TeamTypes eVotingTeam, TeamTypes eVote, bool bPreliminaryVote) { - CvAssertMsg(eVotingTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eVotingTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eVotingTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eVotingTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eVote != GetVoteCast(eVotingTeam)) { @@ -5744,8 +5744,8 @@ void CvGame::SetVoteCast(TeamTypes eVotingTeam, TeamTypes eVote, bool bPrelimina /// Get the last vote this team made, for record keeping TeamTypes CvGame::GetPreviousVoteCast(TeamTypes eVotingTeam) const { - CvAssertMsg(eVotingTeam >= 0, "eVotingTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eVotingTeam < MAX_CIV_TEAMS, "eVotingTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eVotingTeam >= 0, "eVotingTeam is expected to be non-negative (invalid Index)"); + ASSERT(eVotingTeam < MAX_CIV_TEAMS, "eVotingTeam is expected to be within maximum bounds (invalid Index)"); if (eVotingTeam < 0 || eVotingTeam >= MAX_CIV_TEAMS) return NO_TEAM; return (TeamTypes) m_aiPreviousVotesCast[eVotingTeam]; @@ -5755,8 +5755,8 @@ TeamTypes CvGame::GetPreviousVoteCast(TeamTypes eVotingTeam) const /// Set the last vote this team made, for record keeping void CvGame::SetPreviousVoteCast(TeamTypes eVotingTeam, TeamTypes eVotingTarget) { - CvAssertMsg(eVotingTeam >= 0, "eVotingTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eVotingTeam < MAX_CIV_TEAMS, "eVotingTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eVotingTeam >= 0, "eVotingTeam is expected to be non-negative (invalid Index)"); + ASSERT(eVotingTeam < MAX_CIV_TEAMS, "eVotingTeam is expected to be within maximum bounds (invalid Index)"); if (eVotingTeam < 0 || eVotingTeam >= MAX_CIV_TEAMS) return; if (eVotingTarget != GetPreviousVoteCast(eVotingTeam)) @@ -5768,8 +5768,8 @@ void CvGame::SetPreviousVoteCast(TeamTypes eVotingTeam, TeamTypes eVotingTarget) // -------------------------------------------------------------------------------- int CvGame::GetNumVotesForTeam(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); return m_aiNumVotesForTeam[eTeam]; } @@ -5777,8 +5777,8 @@ int CvGame::GetNumVotesForTeam(TeamTypes eTeam) const // -------------------------------------------------------------------------------- void CvGame::SetNumVotesForTeam(TeamTypes eTeam, int iValue) { - CvAssertMsg(eTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_CIV_TEAMS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(iValue != GetNumVotesForTeam(eTeam)) { @@ -5808,7 +5808,7 @@ Localization::String CvGame::GetDiploResponse(const char* szLeader, const char* m_pDiploResponseQuery = new Database::Results(); if(!GC.GetGameDatabase()->Execute(*m_pDiploResponseQuery, szSQL, strlen(szSQL))) { - CvAssertMsg(false, "Failed to generate diplo response query."); + ASSERT(false, "Failed to generate diplo response query."); } } @@ -5835,7 +5835,7 @@ Localization::String CvGame::GetDiploResponse(const char* szLeader, const char* tempDatabase = new Database::Results(); if (!GC.GetGameDatabase()->Execute(*tempDatabase, callTemp, strlen(callTemp))) { - CvAssertMsg(false, "Failed to generate diplo response query."); + ASSERT(false, "Failed to generate diplo response query."); } tempDatabase->Bind(1, szLeader); @@ -5867,9 +5867,9 @@ Localization::String CvGame::GetDiploResponse(const char* szLeader, const char* } } - CvAssert(totbias == 0); - CvAssert(biasList.empty()); - CvAssert(probabilities.empty()); + ASSERT(totbias == 0); + ASSERT(biasList.empty()); + ASSERT(probabilities.empty()); m_pDiploResponseQuery->Bind(1, szLeader); m_pDiploResponseQuery->Bind(2, szResponse); @@ -5899,8 +5899,8 @@ Localization::String CvGame::GetDiploResponse(const char* szLeader, const char* } char szMessage[256]; - sprintf_s(szMessage, "Please send Jon this with your last 5 autosaves and what changelist # you're playing. Could not find diplomacy response. Leader - %s, Response - %s", szLeader, szResponse); - CvAssertMsg(false, szMessage); + sprintf_s(szMessage, "Could not find diplomacy response. Leader - %s, Response - %s", szLeader, szResponse); + ASSERT(false, szMessage); // Shouldn't be here return response; @@ -6198,7 +6198,7 @@ const CvHandicapInfo& CvGame::getHandicapInfo() const { const char* szError = "ERROR: Game does not contain valid handicap!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } else @@ -6827,7 +6827,7 @@ void CvGame::setWinner(TeamTypes eNewWinner, VictoryTypes eNewVictory) if(getVictory() != NO_VICTORY && !IsStaticTutorialActive()) { CvVictoryInfo* pkVictoryInfo = GC.getVictoryInfo(getVictory()); - CvAssert(pkVictoryInfo); + ASSERT(pkVictoryInfo); if(pkVictoryInfo == NULL) return; @@ -7812,8 +7812,8 @@ void CvGame::DoPlaceTeamInVictoryCompetition(VictoryTypes eNewVictory, TeamTypes // -------------------------------------------------------------------------------- TeamTypes CvGame::getTeamVictoryRank(VictoryTypes eNewVictory, int iRank) const { - CvAssert(iRank >= 0); - CvAssert(iRank < /*5*/ GD_INT_GET(NUM_VICTORY_POINT_AWARDS)); + ASSERT(iRank >= 0); + ASSERT(iRank < /*5*/ GD_INT_GET(NUM_VICTORY_POINT_AWARDS)); return m_ppaaiTeamVictoryRank[eNewVictory][iRank]; } @@ -7822,8 +7822,8 @@ TeamTypes CvGame::getTeamVictoryRank(VictoryTypes eNewVictory, int iRank) const // -------------------------------------------------------------------------------- void CvGame::setTeamVictoryRank(VictoryTypes eNewVictory, int iRank, TeamTypes eTeam) { - CvAssert(iRank >= 0); - CvAssert(iRank < /*5*/ GD_INT_GET(NUM_VICTORY_POINT_AWARDS)); + ASSERT(iRank >= 0); + ASSERT(iRank < /*5*/ GD_INT_GET(NUM_VICTORY_POINT_AWARDS)); m_ppaaiTeamVictoryRank[eNewVictory][iRank] = eTeam; } @@ -8000,7 +8000,7 @@ const CvGameSpeedInfo& CvGame::getGameSpeedInfo() const { const char* szError = "ERROR: Game does not contain valid game speed!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } @@ -8024,7 +8024,7 @@ const CvEraInfo& CvGame::getStartEraInfo() const { const char* szError = "ERROR: Game does not contain valid start era!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } @@ -8048,8 +8048,8 @@ CalendarTypes CvGame::getCalendar() const // -------------------------------------------------------------------------------- int CvGame::getEndTurnMessagesReceived(int iIndex) { - CvAssertMsg(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(iIndex < MAX_PLAYERS, "iIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); + ASSERT(iIndex < MAX_PLAYERS, "iIndex is expected to be within maximum bounds (invalid Index)"); return m_aiEndTurnMessagesReceived[iIndex]; } @@ -8057,8 +8057,8 @@ int CvGame::getEndTurnMessagesReceived(int iIndex) // -------------------------------------------------------------------------------- void CvGame::incrementEndTurnMessagesReceived(int iIndex) { - CvAssertMsg(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(iIndex < MAX_PLAYERS, "iIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); + ASSERT(iIndex < MAX_PLAYERS, "iIndex is expected to be within maximum bounds (invalid Index)"); m_aiEndTurnMessagesReceived[iIndex]++; } @@ -8066,8 +8066,8 @@ void CvGame::incrementEndTurnMessagesReceived(int iIndex) // -------------------------------------------------------------------------------- PlayerTypes CvGame::getRankPlayer(int iRank) { - CvAssertMsg(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); - CvAssertMsg(iRank < MAX_PLAYERS, "iRank is expected to be within maximum bounds (invalid Rank)"); + ASSERT(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); + ASSERT(iRank < MAX_PLAYERS, "iRank is expected to be within maximum bounds (invalid Rank)"); return (PlayerTypes)m_aiRankPlayer[iRank]; } @@ -8075,8 +8075,8 @@ PlayerTypes CvGame::getRankPlayer(int iRank) // -------------------------------------------------------------------------------- void CvGame::setRankPlayer(int iRank, PlayerTypes ePlayer) { - CvAssertMsg(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); - CvAssertMsg(iRank < MAX_PLAYERS, "iRank is expected to be within maximum bounds (invalid Rank)"); + ASSERT(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); + ASSERT(iRank < MAX_PLAYERS, "iRank is expected to be within maximum bounds (invalid Rank)"); if(getRankPlayer(iRank) != ePlayer) { @@ -8088,8 +8088,8 @@ void CvGame::setRankPlayer(int iRank, PlayerTypes ePlayer) // -------------------------------------------------------------------------------- int CvGame::getPlayerRank(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); return m_aiPlayerRank[ePlayer]; } @@ -8097,18 +8097,18 @@ int CvGame::getPlayerRank(PlayerTypes ePlayer) // -------------------------------------------------------------------------------- void CvGame::setPlayerRank(PlayerTypes ePlayer, int iRank) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); m_aiPlayerRank[ePlayer] = iRank; - CvAssert(getPlayerRank(ePlayer) >= 0); + ASSERT(getPlayerRank(ePlayer) >= 0); } // -------------------------------------------------------------------------------- int CvGame::getPlayerScore(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); return m_aiPlayerScore[ePlayer]; } @@ -8116,13 +8116,13 @@ int CvGame::getPlayerScore(PlayerTypes ePlayer) // -------------------------------------------------------------------------------- void CvGame::setPlayerScore(PlayerTypes ePlayer, int iScore) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(getPlayerScore(ePlayer) != iScore) { m_aiPlayerScore[ePlayer] = iScore; - CvAssert(getPlayerScore(ePlayer) >= 0); + ASSERT(getPlayerScore(ePlayer) >= 0); GC.GetEngineUserInterface()->setDirty(Score_DIRTY_BIT, true); } @@ -8132,8 +8132,8 @@ void CvGame::setPlayerScore(PlayerTypes ePlayer, int iScore) // -------------------------------------------------------------------------------- TeamTypes CvGame::getRankTeam(int iRank) { - CvAssertMsg(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); - CvAssertMsg(iRank < MAX_TEAMS, "iRank is expected to be within maximum bounds (invalid Index)"); + ASSERT(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); + ASSERT(iRank < MAX_TEAMS, "iRank is expected to be within maximum bounds (invalid Index)"); return (TeamTypes)m_aiRankTeam[iRank]; } @@ -8141,8 +8141,8 @@ TeamTypes CvGame::getRankTeam(int iRank) // -------------------------------------------------------------------------------- void CvGame::setRankTeam(int iRank, TeamTypes eTeam) { - CvAssertMsg(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); - CvAssertMsg(iRank < MAX_TEAMS, "iRank is expected to be within maximum bounds (invalid Index)"); + ASSERT(iRank >= 0, "iRank is expected to be non-negative (invalid Rank)"); + ASSERT(iRank < MAX_TEAMS, "iRank is expected to be within maximum bounds (invalid Index)"); if(getRankTeam(iRank) != eTeam) { @@ -8154,8 +8154,8 @@ void CvGame::setRankTeam(int iRank, TeamTypes eTeam) // -------------------------------------------------------------------------------- int CvGame::getTeamRank(TeamTypes eTeam) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_aiTeamRank[eTeam]; } @@ -8163,18 +8163,18 @@ int CvGame::getTeamRank(TeamTypes eTeam) // -------------------------------------------------------------------------------- void CvGame::setTeamRank(TeamTypes eTeam, int iRank) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); m_aiTeamRank[eTeam] = iRank; - CvAssert(getTeamRank(eTeam) >= 0); + ASSERT(getTeamRank(eTeam) >= 0); } // -------------------------------------------------------------------------------- int CvGame::getTeamScore(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_aiTeamScore[eTeam]; } @@ -8182,10 +8182,10 @@ int CvGame::getTeamScore(TeamTypes eTeam) const // -------------------------------------------------------------------------------- void CvGame::setTeamScore(TeamTypes eTeam, int iScore) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); m_aiTeamScore[eTeam] = iScore; - CvAssert(getTeamScore(eTeam) >= 0); + ASSERT(getTeamScore(eTeam) >= 0); } @@ -8236,8 +8236,8 @@ void CvGame::setMPOption(MultiplayerOptionTypes eIndex, bool bEnabled) // -------------------------------------------------------------------------------- int CvGame::getUnitCreatedCount(UnitTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitCreatedCount[eIndex]; } @@ -8245,8 +8245,8 @@ int CvGame::getUnitCreatedCount(UnitTypes eIndex) // -------------------------------------------------------------------------------- void CvGame::incrementUnitCreatedCount(UnitTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitCreatedCount[eIndex]++; } @@ -8254,8 +8254,8 @@ void CvGame::incrementUnitCreatedCount(UnitTypes eIndex) // -------------------------------------------------------------------------------- int CvGame::getUnitClassCreatedCount(UnitClassTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitClassCreatedCount[eIndex]; } @@ -8263,8 +8263,8 @@ int CvGame::getUnitClassCreatedCount(UnitClassTypes eIndex) // -------------------------------------------------------------------------------- bool CvGame::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eIndex); if(pkUnitClassInfo == NULL) @@ -8277,7 +8277,7 @@ bool CvGame::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) return false; } - CvAssertMsg(getUnitClassCreatedCount(eIndex) <= pkUnitClassInfo->getMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); + ASSERT(getUnitClassCreatedCount(eIndex) <= pkUnitClassInfo->getMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); return ((getUnitClassCreatedCount(eIndex) + iExtra) >= pkUnitClassInfo->getMaxGlobalInstances()); } @@ -8286,8 +8286,8 @@ bool CvGame::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) // -------------------------------------------------------------------------------- void CvGame::incrementUnitClassCreatedCount(UnitClassTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitClassCreatedCount[eIndex]++; } @@ -8295,8 +8295,8 @@ void CvGame::incrementUnitClassCreatedCount(UnitClassTypes eIndex) // -------------------------------------------------------------------------------- int CvGame::getBuildingClassCreatedCount(BuildingClassTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassCreatedCount[eIndex]; } @@ -8304,13 +8304,13 @@ int CvGame::getBuildingClassCreatedCount(BuildingClassTypes eIndex) // -------------------------------------------------------------------------------- bool CvGame::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvBuildingClassInfo* pkBuildingClassInfo = GC.getBuildingClassInfo(eIndex); if(pkBuildingClassInfo == NULL) { - CvAssertMsg(false, "BuildingClassInfo does not exist for type. NOT GOOD"); + ASSERT(false, "BuildingClassInfo does not exist for type. NOT GOOD"); return false; } @@ -8320,7 +8320,7 @@ bool CvGame::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) return false; } - CvAssertMsg(getBuildingClassCreatedCount(eIndex) <= pkBuildingClassInfo->getMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); + ASSERT(getBuildingClassCreatedCount(eIndex) <= pkBuildingClassInfo->getMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); return ((getBuildingClassCreatedCount(eIndex) + iExtra) >= pkBuildingClassInfo->getMaxGlobalInstances()); } @@ -8329,16 +8329,16 @@ bool CvGame::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) // -------------------------------------------------------------------------------- void CvGame::incrementBuildingClassCreatedCount(BuildingClassTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCreatedCount[eIndex]++; } // -------------------------------------------------------------------------------- void CvGame::decrementBuildingClassCreatedCount(BuildingClassTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCreatedCount[eIndex]--; } @@ -8346,8 +8346,8 @@ void CvGame::decrementBuildingClassCreatedCount(BuildingClassTypes eIndex) // -------------------------------------------------------------------------------- int CvGame::getProjectCreatedCount(ProjectTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiProjectCreatedCount[eIndex]; } @@ -8355,15 +8355,15 @@ int CvGame::getProjectCreatedCount(ProjectTypes eIndex) // -------------------------------------------------------------------------------- bool CvGame::isProjectMaxedOut(ProjectTypes eIndex, int iExtra) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(!isWorldProject(eIndex)) { return false; } - CvAssertMsg(getProjectCreatedCount(eIndex) <= GC.getProjectInfo(eIndex)->GetMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); + ASSERT(getProjectCreatedCount(eIndex) <= GC.getProjectInfo(eIndex)->GetMaxGlobalInstances(), "Index is expected to be within maximum bounds (invalid Index)"); return ((getProjectCreatedCount(eIndex) + iExtra) >= GC.getProjectInfo(eIndex)->GetMaxGlobalInstances()); } @@ -8372,24 +8372,24 @@ bool CvGame::isProjectMaxedOut(ProjectTypes eIndex, int iExtra) // -------------------------------------------------------------------------------- void CvGame::incrementProjectCreatedCount(ProjectTypes eIndex, int iExtra) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiProjectCreatedCount[eIndex] += iExtra; } // -------------------------------------------------------------------------------- bool CvGame::isVictoryValid(VictoryTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return CvPreGame::isVictory(eIndex); } // -------------------------------------------------------------------------------- void CvGame::setVictoryValid(VictoryTypes eIndex, bool bValid) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvPreGame::setVictory(eIndex, bValid); } @@ -8418,8 +8418,8 @@ bool CvGame::areNoVictoriesValid() const // -------------------------------------------------------------------------------- bool CvGame::isSpecialUnitValid(SpecialUnitTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumSpecialUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumSpecialUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabSpecialUnitValid[eIndex]; } @@ -8427,8 +8427,8 @@ bool CvGame::isSpecialUnitValid(SpecialUnitTypes eIndex) // -------------------------------------------------------------------------------- void CvGame::makeSpecialUnitValid(SpecialUnitTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumSpecialUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumSpecialUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_pabSpecialUnitValid[eIndex] = true; } @@ -8529,7 +8529,7 @@ void CvGame::doTurn() for (int iI = 0; iI < MAX_MAJOR_CIVS; iI++) { CvPlayerAI& kPlayer = GET_PLAYER((PlayerTypes)iI); - CvAssertMsg((kPlayer.isLocalPlayer() && !kPlayer.GetDiplomacyRequests()->HasPendingRequests()) || !kPlayer.isLocalPlayer(), "Clearing requests, expected local player to be empty."); + ASSERT((kPlayer.isLocalPlayer() && !kPlayer.GetDiplomacyRequests()->HasPendingRequests()) || !kPlayer.isLocalPlayer(), "Clearing requests, expected local player to be empty."); kPlayer.GetDiplomacyRequests()->ClearAllRequests(); if (isNetworkMultiPlayer && !kPlayer.isHuman()) { @@ -8688,7 +8688,7 @@ void CvGame::doTurn() else { GET_PLAYER((PlayerTypes)iI).setTurnActive(true); - CvAssert(getNumGameTurnActive() == 1); + ASSERT(getNumGameTurnActive() == 1); } break; @@ -8858,7 +8858,7 @@ UnitTypes CvGame::GetRandomUniqueUnitType(bool bIncludeCivsInGame, bool bInclude if(pkUnitClassInfo == NULL) { - CvAssertMsg(false, "UnitClassInfo is NULL. Please send Anton your save file and version."); + ASSERT(false, "UnitClassInfo is NULL."); continue; } @@ -8909,7 +8909,7 @@ UnitTypes CvGame::GetRandomUniqueUnitType(bool bIncludeCivsInGame, bool bInclude if (ePrereqTech != NO_TECH) { CvTechEntry* pkTechInfo = GC.getTechInfo(ePrereqTech); - CvAssertMsg(pkTechInfo, "Tech info not found when picking unique unit for minor civ. Please send Anton your save file and version!"); + ASSERT(pkTechInfo, "Tech info not found when picking unique unit for minor civ."); if (pkTechInfo) { ePrereqEra = (EraTypes) pkTechInfo->GetEra(); @@ -9125,9 +9125,9 @@ void CvGame::updateMoves() CvString strTemp = entry->GetDescription(); CvString szAssertMessage; szAssertMessage.Format( - "GAME HANG - Please show Ed and send save. Stuck units will have their turn ended so game can advance. [DETAILS: Player %i %s. First stuck unit is %s at (%d, %d)]", + "GAME HANG - Stuck units will have their turn ended so game can advance. [DETAILS: Player %i %s. First stuck unit is %s at (%d, %d)]", player.GetID(), player.getName(), strTemp.GetCString(), pReadyUnit->getX(), pReadyUnit->getY()); - CvAssertMsg(false, szAssertMessage); + ASSERT(false, szAssertMessage); NET_MESSAGE_DEBUG_OSTR_ALWAYS(szAssertMessage); } player.EndTurnsForReadyUnits(); @@ -9193,7 +9193,7 @@ void CvGame::updateMoves() } else { - CvAssertMsg(GC.getGame().getActivePlayer() == player.GetID(), "slewis - We should not need to resolve ambiguous end turns for the AI or remotely."); + ASSERT(GC.getGame().getActivePlayer() == player.GetID(), "slewis - We should not need to resolve ambiguous end turns for the AI or remotely."); if(player.isLocalPlayer() && gDLL->sendTurnUnready()) player.setEndTurn(false); } @@ -9332,7 +9332,7 @@ void CvGame::UpdatePlayers() ++numActive; } } - CvAssert(numActive == getNumGameTurnActive()); + ASSERT(numActive == getNumGameTurnActive()); } // ----------------------------------------------------------------------------------------------- @@ -9346,9 +9346,9 @@ void CvGame::testAlive() bool CvGame::testVictory(VictoryTypes eVictory, TeamTypes eTeam, bool* pbEndScore) const { - CvAssert(eVictory >= 0 && eVictory < GC.getNumVictoryInfos()); - CvAssert(eTeam >=0 && eTeam < MAX_CIV_TEAMS); - CvAssert(GET_TEAM(eTeam).isAlive()); + ASSERT(eVictory >= 0 && eVictory < GC.getNumVictoryInfos()); + ASSERT(eTeam >=0 && eTeam < MAX_CIV_TEAMS); + ASSERT(GET_TEAM(eTeam).isAlive()); CvVictoryInfo* pkVictoryInfo = GC.getVictoryInfo(eVictory); if(pkVictoryInfo == NULL) @@ -11145,7 +11145,7 @@ void CvGame::readSaveGameDB(FDataStream& kStream) } else { - CvAssertMsg(false, "Cannot open Civ5SavedGameDatabase.db for write! Does something have this opened?"); + ASSERT(false, "Cannot open Civ5SavedGameDatabase.db for write! Does something have this opened?"); } } } @@ -11181,12 +11181,12 @@ void CvGame::writeSaveGameDB(FDataStream& kStream) const } else { - CvAssertMsg(false, "Saved game database exists, but could not get file size???"); + ASSERT(false, "Saved game database exists, but could not get file size???"); } if (CloseHandle(hFile) == FALSE) { - CvAssertMsg(false, "Could not close file handle to saved game database!"); + ASSERT(false, "Could not close file handle to saved game database!"); } } else @@ -11194,7 +11194,7 @@ void CvGame::writeSaveGameDB(FDataStream& kStream) const WIN32_FILE_ATTRIBUTE_DATA fileAttributes; if (GetFileAttributesExW(savePath, GetFileExInfoStandard, &fileAttributes) != INVALID_FILE_ATTRIBUTES) { - CvAssertMsg(false, "Saved game database exists, but could not open it!"); + ASSERT(false, "Saved game database exists, but could not open it!"); } DWORD nilSize = 0; @@ -11257,7 +11257,7 @@ void CvGame::addPlayer(PlayerTypes eNewPlayer, LeaderHeadTypes eLeader, Civiliza if(pkCivilizationInfo == NULL || pkBarbarianCivInfo == NULL) { //Should never happen. - CvAssert(false); + ASSERT(false); return; } @@ -11800,14 +11800,14 @@ void CvGame::endTurnTimerReset() /// Called when a major changes its protection status towards a minor void CvGame::DoMinorPledgeProtection(PlayerTypes eMajor, PlayerTypes eMinor, bool bProtect, bool bPledgeNowBroken) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); if (bProtect) { - CvAssertMsg(GET_PLAYER(eMinor).GetMinorCivAI()->CanMajorProtect(eMajor, false), "eMajor is not allowed to protect this minor! Please send Anton your save file and version."); + ASSERT(GET_PLAYER(eMinor).GetMinorCivAI()->CanMajorProtect(eMajor, false), "eMajor is not allowed to protect this minor!"); } gDLL->sendMinorPledgeProtection(eMajor, eMinor, bProtect, bPledgeNowBroken); @@ -11817,8 +11817,8 @@ void CvGame::DoMinorPledgeProtection(PlayerTypes eMajor, PlayerTypes eMinor, boo /// Amount of Gold being gifted to the Minor by the active player void CvGame::DoMinorGiftGold(PlayerTypes eMinor, int iNumGold) { - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); gDLL->sendMinorGiftGold(eMinor, iNumGold); } @@ -11827,10 +11827,10 @@ void CvGame::DoMinorGiftGold(PlayerTypes eMinor, int iNumGold) /// Do the action of a major gifting a tile improvement to a minor's plot, to improve its resource void CvGame::DoMinorGiftTileImprovement(PlayerTypes eMajor, PlayerTypes eMinor, int iPlotX, int iPlotY) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); gDLL->sendMinorGiftTileImprovement(eMajor, eMinor, iPlotX, iPlotY); } @@ -11840,10 +11840,10 @@ void CvGame::DoMinorGiftTileImprovement(PlayerTypes eMajor, PlayerTypes eMinor, /// Demanded gold and a calculated bully metric are not provided (ex. from Lua, Player UI), so calculate them here void CvGame::DoMinorBullyGold(PlayerTypes eBully, PlayerTypes eMinor) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); int iGold = GET_PLAYER(eMinor).GetMinorCivAI()->GetBullyGoldAmount(eBully); if (iGold <= 0) @@ -11856,10 +11856,10 @@ void CvGame::DoMinorBullyGold(PlayerTypes eBully, PlayerTypes eMinor) /// Do the action of a major bullying a unit from a minor void CvGame::DoMinorBullyUnit(PlayerTypes eBully, PlayerTypes eMinor) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is not in expected range (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is not in expected range (invalid Index)"); UnitClassTypes eUnitClassType = GET_PLAYER(eMinor).GetMinorCivAI()->GetBullyUnit(); UnitTypes eUnitType = GET_PLAYER(eBully).GetSpecificUnitType(eUnitClassType); @@ -11968,10 +11968,10 @@ void CvGame::DoResearchAgreementNotification(PlayerTypes eFirstPlayer, PlayerTyp // -------------------------------------------------------------------------------- int CvGame::GetResearchAgreementCost(PlayerTypes ePlayer1, PlayerTypes ePlayer2) const { - CvAssertMsg(ePlayer1 > NO_PLAYER, "Invalid player. Please show Jon this."); - CvAssertMsg(ePlayer1 <= MAX_MAJOR_CIVS, "Invalid player. Please show Jon this."); - CvAssertMsg(ePlayer2 > NO_PLAYER, "Invalid player. Please show Jon this."); - CvAssertMsg(ePlayer2 <= MAX_MAJOR_CIVS, "Invalid player. Please show Jon this."); + ASSERT(ePlayer1 > NO_PLAYER, "Invalid player."); + ASSERT(ePlayer1 <= MAX_MAJOR_CIVS, "Invalid player."); + ASSERT(ePlayer2 > NO_PLAYER, "Invalid player."); + ASSERT(ePlayer2 <= MAX_MAJOR_CIVS, "Invalid player."); EraTypes ePlayer1Era = GET_TEAM(GET_PLAYER(ePlayer1).getTeam()).GetCurrentEra(); EraTypes ePlayer2Era = GET_TEAM(GET_PLAYER(ePlayer2).getTeam()).GetCurrentEra(); @@ -13000,7 +13000,7 @@ int CalculateDigSiteWeight(int iIndex, vector& inputData, vec // -------------------------------------------------------------------------------- void CalculateDigSiteWeights(int iGridSize, vector& inputData, vector& chosenDigSites, vector& currentWeights) { - CvAssertMsg(NO_GREAT_WORK_ARTIFACT_CLASS == 0, "Value of NO_ARTIFACT has changed"); + ASSERT(NO_GREAT_WORK_ARTIFACT_CLASS == 0, "Value of NO_ARTIFACT has changed"); for (int i = 0; i < iGridSize; i++) { currentWeights[i] = CalculateDigSiteWeight(i, inputData, chosenDigSites); @@ -13222,7 +13222,7 @@ void CvGame::SpawnArchaeologySitesHistorically() vector historicalDigSites; vector scratchDigSites; int iGridSize = theMap.numPlots(); - CvAssertMsg(iGridSize > 0, "iGridSize is zero"); + ASSERT(iGridSize > 0, "iGridSize is zero"); historicalDigSites.resize(iGridSize); scratchDigSites.resize(iGridSize); for (int i = 0; i < iGridSize; i++) @@ -13964,8 +13964,8 @@ bool CvGame::AnyoneHasUnitClass(UnitClassTypes iUnitClassType) const void CvGame::SetContractUnits(ContractTypes eContract, UnitTypes eUnit, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eContract > -1 && eContract < GC.getNumContractInfos(), "Invalid eContract index."); - CvAssertMsg(eUnit > -1 && eUnit < GC.getNumUnitInfos(), "Invalid eUnit index."); + ASSERT(eContract > -1 && eContract < GC.getNumContractInfos(), "Invalid eContract index."); + ASSERT(eUnit > -1 && eUnit < GC.getNumUnitInfos(), "Invalid eUnit index."); if(m_ppaiContractUnits[eContract][eUnit] != iValue) { @@ -13975,8 +13975,8 @@ void CvGame::SetContractUnits(ContractTypes eContract, UnitTypes eUnit, int iVal int CvGame::GetContractUnits(ContractTypes eContract, UnitTypes eUnit) const { VALIDATE_OBJECT - CvAssertMsg(eContract > -1 && eContract < GC.getNumContractInfos(), "Invalid eContract index."); - CvAssertMsg(eUnit > -1 && eUnit < GC.getNumUnitInfos(), "Invalid eUnit index."); + ASSERT(eContract > -1 && eContract < GC.getNumContractInfos(), "Invalid eContract index."); + ASSERT(eUnit > -1 && eUnit < GC.getNumUnitInfos(), "Invalid eUnit index."); return m_ppaiContractUnits[eContract][eUnit]; } diff --git a/CvGameCoreDLL_Expansion2/CvGameCoreDLL.cpp b/CvGameCoreDLL_Expansion2/CvGameCoreDLL.cpp index 1de5dc8a36..4be396df16 100644 --- a/CvGameCoreDLL_Expansion2/CvGameCoreDLL.cpp +++ b/CvGameCoreDLL_Expansion2/CvGameCoreDLL.cpp @@ -34,7 +34,7 @@ BOOL APIENTRY DllMain(HANDLE hModule, // set timer precision MMRESULT iTimeSet = timeBeginPeriod(1); // set timeGetTime and sleep resolution to 1 ms, otherwise it's 10-16ms DEBUG_VARIABLE(iTimeSet); - CvAssertMsg(iTimeSet==TIMERR_NOERROR, "failed setting timer resolution to 1 ms"); + ASSERT(iTimeSet==TIMERR_NOERROR, "failed setting timer resolution to 1 ms"); CvDllGameContext::InitializeSingleton(); } break; diff --git a/CvGameCoreDLL_Expansion2/CvGameCoreDLLPCH.h b/CvGameCoreDLL_Expansion2/CvGameCoreDLLPCH.h index b1983e653b..1ad183bfe1 100644 --- a/CvGameCoreDLL_Expansion2/CvGameCoreDLLPCH.h +++ b/CvGameCoreDLL_Expansion2/CvGameCoreDLLPCH.h @@ -62,15 +62,6 @@ #define NODISCARD #endif // __cplusplus >= 201703L -/// Asserts that the given expression is true. -/// -/// Failure to assert that the expression is `true` will result in the program trapping. -/// -/// Although it is typically expected that the expression will be evaluated, please do not write code that may -/// depend on the expression always being evaluated. Doing so makes it more difficult to swap this macro safely -/// with similar ones which may not evaluate the expression. -#define ASSERT(expr) if (!(expr)) do { ASSERT_DIALOGUE(#expr); BUILTIN_TRAP(); } while(0) - /// Similar to `ASSERT` but with the option to disable the runtime overhead by defining `STRONG_ASSUMPTIONS`. /// /// When `STRONG_ASSUMPTIONS` is defined, instead of trapping when the expression is `false`, the compiler is @@ -85,6 +76,11 @@ #define ASSUME(expr) ASSERT(expr) #endif // STRONG_ASSUMPTIONS + +/// Similar to `ASSERT`, calling PRECONDITION with an expression that is `false` will cause the game to crash. +// Depending on the project settings (see `CVASSERT_ENABLE` in CvAssert.h) a message dialog may be shown in both debug and release configurations. + +#define PRECONDITION(expr, ...) if (!(expr)) {CvString str; CvString::format(str, __VA_ARGS__); CvPreconditionDlg(#expr, __FILE__, __LINE__, str.c_str()); BUILTIN_TRAP();} /// Indicates that some location is unreachable. /// /// Reaching this location during execution will result in the program trapping. @@ -93,7 +89,8 @@ /// that a conditional expression be provided and can more clearly represent what was meant when a code author /// placed it at a location. This makes it primarily useful as a statement within a `switch` `case` or `else` branch /// when it can be assumed that the location is unreachable. -#define UNREACHABLE() do { ASSERT_DIALOGUE("UNREACHABLE()"); BUILTIN_TRAP(); } while(0) +/// +#define UNREACHABLE() PRECONDITION(false, "UNREACHABLE") /// Similar to `UNREACHABLE` but with the option to disable the runtime overhead by defining `STRONG_ASSUMPTIONS`. /// @@ -106,7 +103,7 @@ #ifdef STRONG_ASSUMPTIONS #define UNREACHABLE_UNCHECKED() BUILTIN_UNREACHABLE() #else -#define UNREACHABLE_UNCHECKED() do { ASSERT_DIALOGUE("UNREACHABLE_UNCHECKED()"); BUILTIN_TRAP(); } while(0) +#define UNREACHABLE_UNCHECKED() UNREACHABLE PRECONDITION(false, "UNREACHABLE_UNCHECKED") #endif // STRONG_ASSUMPTIONS // Take off iterator security checks diff --git a/CvGameCoreDLL_Expansion2/CvGameCoreStructs.cpp b/CvGameCoreDLL_Expansion2/CvGameCoreStructs.cpp index 230e6baffe..c3fb03a6ce 100644 --- a/CvGameCoreDLL_Expansion2/CvGameCoreStructs.cpp +++ b/CvGameCoreDLL_Expansion2/CvGameCoreStructs.cpp @@ -158,7 +158,7 @@ FDataStream& operator<<(FDataStream& kStream, const BuildingGreatWork& readFrom) void checkBattleUnitType(BattleUnitTypes unitType) { DEBUG_VARIABLE(unitType); - CvAssertMsg((unitType >= 0) && (unitType < BATTLE_UNIT_COUNT), "Invalid battle unit type."); + ASSERT((unitType >= 0) && (unitType < BATTLE_UNIT_COUNT), "Invalid battle unit type."); } //------------------------------------------------------------------------------------------------ @@ -524,7 +524,7 @@ int CvCombatInfo::getMaxDamageMemberCount() void CvCombatInfo::setDamageMemberCount(int iDamageMemberCount) { - CvAssertMsg(iDamageMemberCount >=0 && iDamageMemberCount <= MAX_DAMAGE_MEMBER_COUNT, "Invalid damage member count!"); + ASSERT(iDamageMemberCount >=0 && iDamageMemberCount <= MAX_DAMAGE_MEMBER_COUNT, "Invalid damage member count!"); m_iDamageMemberCount = std::min(iDamageMemberCount, (int)MAX_DAMAGE_MEMBER_COUNT); } @@ -638,7 +638,7 @@ void CvAirMissionDefinition::setDamage(BattleUnitTypes unitType, int damage) bool CvAirMissionDefinition::isDead(BattleUnitTypes unitType) const { checkBattleUnitType(unitType); - CvAssertMsg(getUnit(unitType) != NULL, "[Jason] Invalid battle unit type."); + ASSERT(getUnit(unitType) != NULL, "[Jason] Invalid battle unit type."); return getDamage(unitType) >= getUnit(unitType)->GetMaxHitPoints(); } diff --git a/CvGameCoreDLL_Expansion2/CvGameCoreUtils.cpp b/CvGameCoreDLL_Expansion2/CvGameCoreUtils.cpp index 94c8e9d416..d91cdf46d6 100644 --- a/CvGameCoreDLL_Expansion2/CvGameCoreUtils.cpp +++ b/CvGameCoreDLL_Expansion2/CvGameCoreUtils.cpp @@ -28,17 +28,24 @@ // must be included after all other headers #include "LintFree.h" -// CvAssertDlg implementation -#if defined(VPDEBUG) && !defined(DISABLE_CVASSERT) +// CvAssertDlg and CvPreconditionDlg implementation +#ifdef CVASSERT_ENABLE #ifdef WIN32 // MessageBox constants -#define MB_OK 0x00000000L +#define MB_OK 0x00000000L #define MB_OKCANCEL 0x00000001L -#define MB_ABORTRETRYIGNORE 0x00000002L +#define MB_ABORTRETRYIGNORE 0x00000002L #define MB_YESNOCANCEL 0x00000003L #define MB_ICONERROR 0x00000010L +#define MB_SYSTEMMODAL 0x00001000L #define MB_TASKMODAL 0x00002000L +#define MB_SETFOREGROUND 0x00010000L + +// MessageBox default buttons +#define MB_DEFBUTTON1 0x00000000L +#define MB_DEFBUTTON2 0x00000100L +#define MB_DEFBUTTON3 0x00000200L // MessageBox return values #define IDOK 1 @@ -127,6 +134,8 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool { if (!expr) return false; + bool bMsg = msg && msg[0] != '\0'; + // Get unique key for this assert std::string assertKey = g_AssertTracker.GetAssertKey(szFile, uiLine, expr); @@ -146,6 +155,61 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool // Update statistics g_AssertTracker.UpdateStats(assertKey); +#if defined(VPRELEASE_ERRORMSG) + if (GC.getGame().isReallyNetworkMultiPlayer()) + { + char szBuffer[4096]; + _snprintf_s(szBuffer, _countof(szBuffer), _TRUNCATE, + "Assert hit. " + "%s%s%s" + "Expression: %s, " + "File: %s, " + "Line: %u", + bMsg ? "Message: " : "", bMsg ? msg : "", bMsg ? ", " : "", + expr, szFile, uiLine + ); + GC.getDLLIFace()->sendChat(CvString(szBuffer), CHATTARGET_ALL, NO_PLAYER); + return false; + } + else + { + char szBuffer[4096]; + _snprintf_s(szBuffer, _countof(szBuffer), _TRUNCATE, + "An error in the code has occured. Please report the issue on https://github.com/LoneGazebo/Community-Patch-DLL so it can be fixed.\n\n" + "You may continue playing, but unexpected behavior might occur. It is recommended to wait until a hotfix has been released that resolves the issue.\n\n" + "==================\n" + "Detailed information:\n" + "%s%s%s" + "Expression: %s\n" + "File: %s\n" + "Line: %u\n\n" + + "==================\n" + "Cancel - Exit the game \n" + "OK - Continue playing. This warning will not be shown again in the current session.", + bMsg ? "Message: " : "", bMsg ? msg : "", bMsg ? "\n" : "", + expr, szFile, uiLine + ); + + // Show dialog + int nResult = MessageBoxA(NULL, szBuffer, "Assertion Failed", + MB_OKCANCEL | MB_ICONERROR | MB_SYSTEMMODAL | MB_SETFOREGROUND | MB_DEFBUTTON2); + + // Handle result + switch (nResult) + { + case IDOK: // Continue execution and ignore this error + g_AssertTracker.asserts[assertKey].isPermanentlyIgnored = true; + bIgnoreAlways = true; + return false; + + default: + BUILTIN_TRAP(); + } + } + +#else // VPRELEASE_ERRORMSG + // Get assert info const AssertInfo& info = g_AssertTracker.asserts[assertKey]; @@ -176,7 +240,7 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool "No - Continue execution\n" "Cancel - Ignore this assert", expr, szFile, uiLine, - msg ? "\nMessage: " : "", msg ? msg : "", msg ? "\n" : "", + bMsg ? "Message: " : "", bMsg ? msg : "", bMsg ? "\n" : "", info.count, timeSinceFirst / 1000.0f, timeSinceLast / 1000.0f, @@ -201,10 +265,44 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool bIgnoreAlways = true; return false; } +#endif // VPRELEASE_ERRORMSG +} + +#endif WIN32 +#endif CVASSERT_ENABLE + +void CvPreconditionDlg(const char* expr, const char* szFile, unsigned int uiLine, const char* msg) +{ + if (!expr) return; +#ifdef CVASSERT_ENABLE +#ifdef WIN32 +#if defined(VPRELEASE_ERRORMSG) + bool bMsg = msg && msg[0] != '\0'; + char szBuffer[4096]; + _snprintf_s(szBuffer, _countof(szBuffer), _TRUNCATE, + "An error in the code has occured, forcing the game to crash. Please report the issue on https://github.com/LoneGazebo/Community-Patch-DLL so it can be fixed.\n\n" + "==================\n" + "Detailed information:\n" + "Expression: %s\n" + "File: %s\n" + "Line: %u\n" + "%s%s%s\n", + expr, szFile, uiLine, + bMsg ? "Message: " : "", bMsg ? msg : "", bMsg ? "\n" : "" + ); + + // Show dialog + MessageBoxA(NULL, szBuffer, "Error", + MB_OK | MB_ICONERROR | MB_SYSTEMMODAL | MB_SETFOREGROUND); + +#else // VPRELEASE_ERRORMSG + bool bIgnoreAlways = false; + CvAssertDlg(expr, szFile, uiLine, bIgnoreAlways, msg); +#endif +#endif WIN32 +#endif CVASSERT_ENABLE } -#endif // WIN32 -#endif // defined(VPDEBUG) && !defined(DISABLE_CVASSERT) int RING_PLOTS[6] = {RING0_PLOTS,RING1_PLOTS,RING2_PLOTS,RING3_PLOTS,RING4_PLOTS,RING5_PLOTS}; @@ -560,9 +658,9 @@ CvUnit* GetPlayerUnit(const IDInfo& unit) bool isBeforeUnitCycle(const CvUnit* pFirstUnit, const CvUnit* pSecondUnit) { - CvAssert(pFirstUnit != NULL); - CvAssert(pSecondUnit != NULL); - CvAssert(pFirstUnit != pSecondUnit); + ASSERT(pFirstUnit != NULL); + ASSERT(pSecondUnit != NULL); + ASSERT(pFirstUnit != pSecondUnit); if(!pFirstUnit || !pSecondUnit) return false; @@ -843,7 +941,7 @@ int getWonderScore(BuildingClassTypes eWonderClass) ImprovementTypes finalImprovementUpgrade(ImprovementTypes eImprovement, int iCount) { - CvAssertMsg(eImprovement != NO_IMPROVEMENT, "Improvement is not assigned a valid value"); + ASSERT(eImprovement != NO_IMPROVEMENT, "Improvement is not assigned a valid value"); if(iCount > GC.getNumImprovementInfos()) { @@ -1031,33 +1129,33 @@ TechTypes getDiscoveryTech(UnitTypes eUnit, PlayerTypes ePlayer) bool PUF_isPlayer(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->getOwner() == iData1); } bool PUF_isTeam(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->getTeam() == iData1); } bool PUF_isCombatTeam(const CvUnit* pUnit, int iData1, int iData2) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); - CvAssertMsg(iData2 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData2 != -1, "Invalid data argument, should be >= 0"); return (GET_PLAYER(pUnit->getCombatOwner((TeamTypes)iData2, *(pUnit->plot()))).getTeam() == iData1 && !pUnit->isInvisible((TeamTypes)iData2, false, false)); } bool PUF_isOtherPlayer(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->getOwner() != iData1); } bool PUF_isOtherTeam(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); TeamTypes eTeam = GET_PLAYER((PlayerTypes)iData1).getTeam(); if(pUnit->canCoexistWithEnemyUnit(eTeam)) { @@ -1069,8 +1167,8 @@ bool PUF_isOtherTeam(const CvUnit* pUnit, int iData1, int) bool PUF_isEnemy(const CvUnit* pUnit, int iData1, int iData2) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); - CvAssertMsg(iData2 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData2 != -1, "Invalid data argument, should be >= 0"); TeamTypes eOtherTeam = GET_PLAYER((PlayerTypes)iData1).getTeam(); TeamTypes eOurTeam = GET_PLAYER(pUnit->getCombatOwner(eOtherTeam, *(pUnit->plot()))).getTeam(); @@ -1085,26 +1183,26 @@ bool PUF_isEnemy(const CvUnit* pUnit, int iData1, int iData2) bool PUF_isVisible(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return !(pUnit->isInvisible(GET_PLAYER((PlayerTypes)iData1).getTeam(), false)); } bool PUF_isVisibleDebug(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return !(pUnit->isInvisible(GET_PLAYER((PlayerTypes)iData1).getTeam(), true)); } bool PUF_canSiege(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return pUnit->canSiege(GET_PLAYER((PlayerTypes)iData1).getTeam()); } bool PUF_canDeclareWar(const CvUnit* pUnit, int iData1, int iData2) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); - CvAssertMsg(iData2 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData2 != -1, "Invalid data argument, should be >= 0"); TeamTypes eOtherTeam = GET_PLAYER((PlayerTypes)iData1).getTeam(); TeamTypes eOurTeam = GET_PLAYER(pUnit->getCombatOwner(eOtherTeam, *(pUnit->plot()))).getTeam(); @@ -1129,8 +1227,8 @@ bool PUF_cannotDefend(const CvUnit* pUnit, int, int) bool PUF_canDefendEnemy(const CvUnit* pUnit, int iData1, int iData2) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); - CvAssertMsg(iData2 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData2 != -1, "Invalid data argument, should be >= 0"); return (PUF_canDefend(pUnit, iData1, iData2) && PUF_isEnemy(pUnit, iData1, iData2)); } @@ -1141,19 +1239,19 @@ bool PUF_isFighting(const CvUnit* pUnit, int, int) bool PUF_isDomainType(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->getDomainType() == iData1); } bool PUF_isUnitType(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->getUnitType() == iData1); } bool PUF_isUnitAIType(const CvUnit* pUnit, int iData1, int) { - CvAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0"); + ASSERT(iData1 != -1, "Invalid data argument, should be >= 0"); return (pUnit->AI_getUnitAIType() == iData1); } @@ -1209,7 +1307,7 @@ int getTurnMonthForGame(int iGameTurn, int iStartYear, CalendarTypes eCalendar, if(pkGameSpeedInfo == NULL) { //This function requires a valid game speed type! - CvAssert(pkGameSpeedInfo); + ASSERT(pkGameSpeedInfo); return 0; } @@ -1270,7 +1368,7 @@ int getTurnMonthForGame(int iGameTurn, int iStartYear, CalendarTypes eCalendar, break; default: - CvAssert(false); + ASSERT(false); } return iTurnMonth; @@ -1292,7 +1390,7 @@ void boolsToString(const bool* pBools, int iNumBools, CvString* szOut) // void stringToBools(const char* szString, int* iNumBools, bool** ppBools) { - CvAssertMsg(szString, "null string"); + ASSERT(szString, "null string"); if(szString) { *iNumBools = strlen(szString); @@ -1718,7 +1816,7 @@ fraction& fraction::operator/=(const fraction &rhs) { // N / D = nA/dA / nB/dB // = (nA*dB) / (dA*nB) - CvAssert(rhs.num != 0); + ASSERT(rhs.num != 0); num *= rhs.den; den *= rhs.num; return *this; diff --git a/CvGameCoreDLL_Expansion2/CvGameCoreUtils.h b/CvGameCoreDLL_Expansion2/CvGameCoreUtils.h index 8f313cad6c..d4599fbde6 100644 --- a/CvGameCoreDLL_Expansion2/CvGameCoreUtils.h +++ b/CvGameCoreDLL_Expansion2/CvGameCoreUtils.h @@ -15,6 +15,8 @@ #undef min +void CvPreconditionDlg(const char* expr, const char* szFile, unsigned int uiLine, const char* msg); + inline int sqrti(int input) { return int(sqrt((float)abs(input))); @@ -22,7 +24,7 @@ inline int sqrti(int input) inline int range(int iNum, int iLow, int iHigh) { - CvAssertMsg(iHigh >= iLow, "High should be higher than low"); + ASSERT(iHigh >= iLow, "High should be higher than low"); if(iNum < iLow) { @@ -40,7 +42,7 @@ inline int range(int iNum, int iLow, int iHigh) inline float range(float fNum, float fLow, float fHigh) { - CvAssertMsg(fHigh >= fLow, "High should be higher than low"); + ASSERT(fHigh >= fLow, "High should be higher than low"); if(fNum < fLow) { @@ -472,7 +474,7 @@ class fraction int gcd(int a, int b); public: - fraction(int num = 0, int den = 1): num(num), den(den) { CvAssert(den != 0); } + fraction(int num = 0, int den = 1): num(num), den(den) { ASSERT(den != 0); } fraction operator+(const fraction &rhs); fraction operator-(const fraction &rhs); diff --git a/CvGameCoreDLL_Expansion2/CvGameQueries.cpp b/CvGameCoreDLL_Expansion2/CvGameQueries.cpp index 649d00547c..afe8f54969 100644 --- a/CvGameCoreDLL_Expansion2/CvGameQueries.cpp +++ b/CvGameCoreDLL_Expansion2/CvGameQueries.cpp @@ -171,7 +171,7 @@ int CvGameQueries::GetTeamClosenessScore(int** aaiDistances, int* aiStartingLocs } else if(iPlayerStart == iOtherPlayerStart) { - CvAssertMsg(false, "Two players are (hypothetically) assigned to the same starting location!"); + ASSERT(false, "Two players are (hypothetically) assigned to the same starting location!"); } iTeamTotalDist += aaiDistances[iPlayerStart][iOtherPlayerStart]; } diff --git a/CvGameCoreDLL_Expansion2/CvGameTextMgr.cpp b/CvGameCoreDLL_Expansion2/CvGameTextMgr.cpp index c7c5128bff..08cca3ce5a 100644 --- a/CvGameCoreDLL_Expansion2/CvGameTextMgr.cpp +++ b/CvGameCoreDLL_Expansion2/CvGameTextMgr.cpp @@ -178,6 +178,6 @@ void CvGameTextMgr::setDateStr(CvString& strString, int iGameTurn, bool bSave, C break; default: - CvAssert(false); + ASSERT(false); } } diff --git a/CvGameCoreDLL_Expansion2/CvGlobals.cpp b/CvGameCoreDLL_Expansion2/CvGlobals.cpp index 7eaee8104a..8f1990a699 100644 --- a/CvGameCoreDLL_Expansion2/CvGlobals.cpp +++ b/CvGameCoreDLL_Expansion2/CvGlobals.cpp @@ -2695,7 +2695,7 @@ void CvGlobals::init() DIRECTION_WEST, // DIRECTION_NORTHWEST }; - CvAssertMsg(gDLL != NULL, "Civ app needs to set gDLL"); + ASSERT(gDLL != NULL, "Civ app needs to set gDLL"); m_asyncRand = FNEW(CvRandom("UiRng"), c_eCiv5GameplayDLL, 0); gDLL->InitGlobals(); // some globals need to be allocated outside the dll @@ -2916,8 +2916,8 @@ std::vector& CvGlobals::getInterfaceModeInfo() CvInterfaceModeInfo* CvGlobals::getInterfaceModeInfo(InterfaceModeTypes e) { - CvAssert(e > -1); - CvAssert(e < NUM_INTERFACEMODE_TYPES); + ASSERT(e > -1); + ASSERT(e < NUM_INTERFACEMODE_TYPES); if(e > -1 && e < (int)m_paInterfaceModeInfo.size()) return m_paInterfaceModeInfo[e]; else @@ -3052,12 +3052,12 @@ int* CvGlobals::getRingFromLinearOffset() int CvGlobals::getRingIterationIndexHex(int i, int j) { - CvAssertMsg(i < (2*MAX_CITY_RADIUS+1), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < (2*MAX_CITY_RADIUS+1), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i < 0 || i >= (2*MAX_CITY_RADIUS+1)) return -1; - CvAssertMsg(j < (2*MAX_CITY_RADIUS+1), "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(j < (2*MAX_CITY_RADIUS+1), "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); if(j < 0 || j >= (2*MAX_CITY_RADIUS+1)) return -1; return m_aaiRingPlotIndex[i][j]; @@ -3070,8 +3070,8 @@ DirectionTypes* CvGlobals::getTurnLeftDirection() DirectionTypes CvGlobals::getTurnLeftDirection(int i) { - CvAssertMsg(i < NUM_DIRECTION_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DIRECTION_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i < 0 || i >= NUM_DIRECTION_TYPES) return NO_DIRECTION; @@ -3085,8 +3085,8 @@ DirectionTypes* CvGlobals::getTurnRightDirection() DirectionTypes CvGlobals::getTurnRightDirection(int i) { - CvAssertMsg(i < NUM_DIRECTION_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DIRECTION_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i < 0 || i >= NUM_DIRECTION_TYPES) return NO_DIRECTION; @@ -3120,8 +3120,8 @@ std::vector& CvGlobals::GetColorInfo() CvColorInfo* CvGlobals::GetColorInfo(ColorTypes e) { - CvAssert(e > -1); - CvAssert(e < GetNumColorInfos()); + ASSERT(e > -1); + ASSERT(e < GetNumColorInfos()); if(e > -1 && e < (int)m_paColorInfo.size()) return m_paColorInfo[e]; else @@ -3141,8 +3141,8 @@ std::vector& CvGlobals::GetPlayerColorInfo() CvPlayerColorInfo* CvGlobals::GetPlayerColorInfo(PlayerColorTypes e) { - CvAssert(e > -1); - CvAssert(e < GetNumPlayerColorInfos()); + ASSERT(e > -1); + ASSERT(e < GetNumPlayerColorInfos()); if(e > -1 && e < (int)m_paPlayerColorInfo.size()) return m_paPlayerColorInfo[e]; else @@ -3161,8 +3161,8 @@ std::vector& CvGlobals::getEntityEventInfo() CvEntityEventInfo* CvGlobals::getEntityEventInfo(EntityEventTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumEntityEventInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumEntityEventInfos()); if(e > -1 && e < (int)m_paEntityEventInfo.size()) return m_paEntityEventInfo[e]; else @@ -3181,8 +3181,8 @@ std::vector& CvGlobals::getMultiUnitFormationInfo() CvMultiUnitFormationInfo* CvGlobals::getMultiUnitFormationInfo(int i) { - CvAssert(i > -1); - CvAssert(i < GC.getNumMultiUnitFormationInfos()); + ASSERT(i > -1); + ASSERT(i < GC.getNumMultiUnitFormationInfos()); if(i > -1 && i < (int)m_paMultiUnitFormationInfo.size()) return m_paMultiUnitFormationInfo[i]; else @@ -3201,8 +3201,8 @@ std::vector& CvGlobals::getPlotInfo() CvPlotInfo* CvGlobals::getPlotInfo(PlotTypes ePlotNum) { - CvAssert(ePlotNum > -1); - CvAssert(ePlotNum < GC.getNumPlotInfos()); + ASSERT(ePlotNum > -1); + ASSERT(ePlotNum < GC.getNumPlotInfos()); if(ePlotNum > -1 && ePlotNum < (int)m_paPlotInfo.size()) return m_paPlotInfo[ePlotNum]; else @@ -3221,8 +3221,8 @@ std::vector& CvGlobals::getGreatPersonInfo() CvGreatPersonInfo* CvGlobals::getGreatPersonInfo(GreatPersonTypes eGreatPersonNum) { - CvAssert(eGreatPersonNum > -1); - CvAssert(eGreatPersonNum < GC.getNumGreatPersonInfos()); + ASSERT(eGreatPersonNum > -1); + ASSERT(eGreatPersonNum < GC.getNumGreatPersonInfos()); if (eGreatPersonNum > -1 && eGreatPersonNum < (int)m_paGreatPersonInfo.size()) return m_paGreatPersonInfo[eGreatPersonNum]; else @@ -3241,8 +3241,8 @@ std::vector& CvGlobals::getTerrainInfo() CvTerrainInfo* CvGlobals::getTerrainInfo(TerrainTypes eTerrainNum) { - CvAssert(eTerrainNum > -1); - CvAssert(eTerrainNum < GC.getNumTerrainInfos()); + ASSERT(eTerrainNum > -1); + ASSERT(eTerrainNum < GC.getNumTerrainInfos()); if(eTerrainNum > -1 && eTerrainNum < (int)m_paTerrainInfo.size()) return m_paTerrainInfo[eTerrainNum]; else @@ -3261,8 +3261,8 @@ std::vector& CvGlobals::getResourceClassInfo() CvResourceClassInfo* CvGlobals::getResourceClassInfo(ResourceClassTypes eResourceNum) { - CvAssert(eResourceNum > -1); - CvAssert(eResourceNum < GC.getNumResourceClassInfos()); + ASSERT(eResourceNum > -1); + ASSERT(eResourceNum < GC.getNumResourceClassInfos()); if(eResourceNum > -1 && eResourceNum < (int)m_paResourceClassInfo.size()) return m_paResourceClassInfo[eResourceNum]; else @@ -3282,8 +3282,8 @@ std::vector& CvGlobals::getResourceInfo() CvResourceInfo* CvGlobals::getResourceInfo(ResourceTypes eResourceNum) { - CvAssert(eResourceNum > -1); - CvAssert(eResourceNum < GC.getNumResourceInfos()); + ASSERT(eResourceNum > -1); + ASSERT(eResourceNum < GC.getNumResourceInfos()); if(eResourceNum > -1 && eResourceNum < (int)m_paResourceInfo.size()) return m_paResourceInfo[eResourceNum]; else @@ -3302,8 +3302,8 @@ std::vector& CvGlobals::getFeatureInfo() CvFeatureInfo* CvGlobals::getFeatureInfo(FeatureTypes eFeatureNum) { - CvAssert(eFeatureNum > -1); - CvAssert(eFeatureNum < GC.getNumFeatureInfos()); + ASSERT(eFeatureNum > -1); + ASSERT(eFeatureNum < GC.getNumFeatureInfos()); if(eFeatureNum > -1 && eFeatureNum < (int)m_paFeatureInfo.size()) return m_paFeatureInfo[eFeatureNum]; else @@ -3332,8 +3332,8 @@ std::vector& CvGlobals::getCivilizationInfo() CvCivilizationInfo* CvGlobals::getCivilizationInfo(CivilizationTypes eCivilizationNum) { - CvAssert(eCivilizationNum > -1); - CvAssert(eCivilizationNum < GC.getNumCivilizationInfos()); + ASSERT(eCivilizationNum > -1); + ASSERT(eCivilizationNum < GC.getNumCivilizationInfos()); if(eCivilizationNum > -1 && eCivilizationNum < (int)m_paCivilizationInfo.size()) return m_paCivilizationInfo[eCivilizationNum]; else @@ -3342,7 +3342,7 @@ CvCivilizationInfo* CvGlobals::getCivilizationInfo(CivilizationTypes eCivilizati CivilizationTypes CvGlobals::getCivilizationInfoIndex(const char* pszType) { - CvAssert(pszType != NULL); + ASSERT(pszType != NULL); if(pszType != NULL) { int iIndex = 0; @@ -3384,8 +3384,8 @@ std::vector& CvGlobals::getMinorCivInfo() CvMinorCivInfo* CvGlobals::getMinorCivInfo(MinorCivTypes eMinorCivNum) { - CvAssert(eMinorCivNum > -1); - CvAssert(eMinorCivNum < GC.getNumMinorCivInfos()); + ASSERT(eMinorCivNum > -1); + ASSERT(eMinorCivNum < GC.getNumMinorCivInfos()); if(eMinorCivNum > -1 && eMinorCivNum < (int)m_paMinorCivInfo.size()) return m_paMinorCivInfo[eMinorCivNum]; else @@ -3404,8 +3404,8 @@ std::vector& CvGlobals::getLeaderHeadInfo() CvLeaderHeadInfo* CvGlobals::getLeaderHeadInfo(LeaderHeadTypes eLeaderHeadNum) { - CvAssert(eLeaderHeadNum > -1); - CvAssert(eLeaderHeadNum < GC.getNumLeaderHeadInfos()); + ASSERT(eLeaderHeadNum > -1); + ASSERT(eLeaderHeadNum < GC.getNumLeaderHeadInfos()); if(eLeaderHeadNum > -1 && eLeaderHeadNum < (int)m_paLeaderHeadInfo.size()) return m_paLeaderHeadInfo[eLeaderHeadNum]; else @@ -3424,8 +3424,8 @@ std::vector& CvGlobals::getUnitInfo() CvUnitEntry* CvGlobals::getUnitInfo(UnitTypes eUnitNum) { - CvAssert(eUnitNum > -1); - CvAssert(eUnitNum < GC.getNumUnitInfos()); + ASSERT(eUnitNum > -1); + ASSERT(eUnitNum < GC.getNumUnitInfos()); if(eUnitNum > -1 && eUnitNum < GC.getNumUnitInfos()) return m_pUnits->GetUnitEntries()[eUnitNum]; else @@ -3449,8 +3449,8 @@ std::vector& CvGlobals::getSpecialUnitInfo() CvSpecialUnitInfo* CvGlobals::getSpecialUnitInfo(SpecialUnitTypes eSpecialUnitNum) { - CvAssert(eSpecialUnitNum > -1); - CvAssert(eSpecialUnitNum < GC.getNumSpecialUnitInfos()); + ASSERT(eSpecialUnitNum > -1); + ASSERT(eSpecialUnitNum < GC.getNumSpecialUnitInfos()); if(eSpecialUnitNum > -1 && eSpecialUnitNum < (int)m_paSpecialUnitInfo.size()) return m_paSpecialUnitInfo[eSpecialUnitNum]; else @@ -3469,8 +3469,8 @@ std::vector& CvGlobals::getVoteSourceInfo() CvVoteSourceInfo* CvGlobals::getVoteSourceInfo(VoteSourceTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumVoteSourceInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumVoteSourceInfos()); if(e > -1 && e < (int)m_paVoteSourceInfo.size()) return m_paVoteSourceInfo[e]; else @@ -3490,8 +3490,8 @@ std::vector& CvGlobals::getEventInfo() CvModEventInfo* CvGlobals::getEventInfo(EventTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumEventInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumEventInfos()); if(e > -1 && e < (int)m_paEventInfo.size()) return m_paEventInfo[e]; else @@ -3510,8 +3510,8 @@ std::vector& CvGlobals::getEventChoiceInfo() CvModEventChoiceInfo* CvGlobals::getEventChoiceInfo(EventChoiceTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumEventChoiceInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumEventChoiceInfos()); if(e > -1 && e < (int)m_paEventChoiceInfo.size()) return m_paEventChoiceInfo[e]; else @@ -3529,8 +3529,8 @@ std::vector& CvGlobals::getCityEventInfo() CvModCityEventInfo* CvGlobals::getCityEventInfo(CityEventTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumCityEventInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumCityEventInfos()); if(e > -1 && e < (int)m_paCityEventInfo.size()) return m_paCityEventInfo[e]; else @@ -3549,8 +3549,8 @@ std::vector& CvGlobals::getCityEventChoiceInfo() CvModEventCityChoiceInfo* CvGlobals::getCityEventChoiceInfo(CityEventChoiceTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumCityEventChoiceInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumCityEventChoiceInfos()); if(e > -1 && e < (int)m_paCityEventChoiceInfo.size()) return m_paCityEventChoiceInfo[e]; else @@ -3569,8 +3569,8 @@ std::vector& CvGlobals::getEventLinkingInfo() CvEventLinkingInfo* CvGlobals::getEventLinkingInfo(EventTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumEventLinkingInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumEventLinkingInfos()); if(e > -1 && e < (int)m_paEventLinkingInfo.size()) return m_paEventLinkingInfo[e]; else @@ -3589,8 +3589,8 @@ std::vector& CvGlobals::getEventChoiceLinkingInfo() CvEventChoiceLinkingInfo* CvGlobals::getEventChoiceLinkingInfo(EventChoiceTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumEventChoiceLinkingInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumEventChoiceLinkingInfos()); if(e > -1 && e < (int)m_paEventChoiceLinkingInfo.size()) return m_paEventChoiceLinkingInfo[e]; else @@ -3609,8 +3609,8 @@ std::vector& CvGlobals::getCityEventLinkingInfo() CvCityEventLinkingInfo* CvGlobals::getCityEventLinkingInfo(CityEventTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumCityEventLinkingInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumCityEventLinkingInfos()); if(e > -1 && e < (int)m_paCityEventLinkingInfo.size()) return m_paCityEventLinkingInfo[e]; else @@ -3629,8 +3629,8 @@ std::vector& CvGlobals::getCityEventChoiceLinking CvCityEventChoiceLinkingInfo* CvGlobals::getCityEventChoiceLinkingInfo(CityEventChoiceTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumCityEventChoiceLinkingInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumCityEventChoiceLinkingInfos()); if(e > -1 && e < (int)m_paCityEventChoiceLinkingInfo.size()) return m_paCityEventChoiceLinkingInfo[e]; else @@ -3650,8 +3650,8 @@ std::vector& CvGlobals::getUnitCombatClassInfo() CvBaseInfo* CvGlobals::getUnitCombatClassInfo(UnitCombatTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumUnitCombatClassInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumUnitCombatClassInfos()); if(e > -1 && e < (int)m_paUnitCombatClassInfo.size()) return m_paUnitCombatClassInfo[e]; else @@ -3665,8 +3665,8 @@ std::vector& CvGlobals::getUnitAIInfo() CvBaseInfo* CvGlobals::getUnitAIInfo(UnitAITypes eUnitAINum) { - CvAssert(eUnitAINum >= 0); - CvAssert(eUnitAINum < NUM_UNITAI_TYPES); + ASSERT(eUnitAINum >= 0); + ASSERT(eUnitAINum < NUM_UNITAI_TYPES); if(eUnitAINum > -1 && eUnitAINum < (int)m_paUnitAIInfos.size()) return m_paUnitAIInfos[eUnitAINum]; else @@ -3685,8 +3685,8 @@ std::vector& CvGlobals::getGameOptionInfo() CvGameOptionInfo* CvGlobals::getGameOptionInfo(GameOptionTypes eGameOptionNum) { - CvAssert(eGameOptionNum >= 0); - CvAssert(eGameOptionNum < GC.getNumGameOptionInfos()); + ASSERT(eGameOptionNum >= 0); + ASSERT(eGameOptionNum < GC.getNumGameOptionInfos()); if(eGameOptionNum > -1 && eGameOptionNum < (int)m_paGameOptionInfos.size()) return m_paGameOptionInfos[eGameOptionNum]; else @@ -3705,8 +3705,8 @@ std::vector& CvGlobals::getMPOptionInfo() CvMPOptionInfo* CvGlobals::getMPOptionInfo(MultiplayerOptionTypes eMPOptionNum) { - CvAssert(eMPOptionNum >= 0); - CvAssert(eMPOptionNum < GC.getNumMPOptionInfos()); + ASSERT(eMPOptionNum >= 0); + ASSERT(eMPOptionNum < GC.getNumMPOptionInfos()); if(eMPOptionNum > -1 && eMPOptionNum < (int)m_paMPOptionInfos.size()) return m_paMPOptionInfos[eMPOptionNum]; else @@ -3720,7 +3720,7 @@ std::vector& CvGlobals::getPlayerOptionInfo() CvPlayerOptionInfo* CvGlobals::getPlayerOptionInfo(PlayerOptionTypes ePlayerOptionNum) { - CvAssert(ePlayerOptionNum >= 0); + ASSERT(ePlayerOptionNum >= 0); if(ePlayerOptionNum > -1 && ePlayerOptionNum < (int)m_paPlayerOptionInfos.size()) return m_paPlayerOptionInfos[ePlayerOptionNum]; else @@ -3734,8 +3734,8 @@ std::vector& CvGlobals::getYieldInfo() CvYieldInfo* CvGlobals::getYieldInfo(YieldTypes eYieldNum) { - CvAssert(eYieldNum > -1); - CvAssert(eYieldNum < NUM_YIELD_TYPES); + ASSERT(eYieldNum > -1); + ASSERT(eYieldNum < NUM_YIELD_TYPES); if(eYieldNum > -1 && eYieldNum < (int)m_paYieldInfo.size()) return m_paYieldInfo[eYieldNum]; else @@ -3754,8 +3754,8 @@ std::vector& CvGlobals::getRouteInfo() CvRouteInfo* CvGlobals::getRouteInfo(RouteTypes eRouteNum) { - CvAssert(eRouteNum > -1); - CvAssert(eRouteNum < GC.getNumRouteInfos()); + ASSERT(eRouteNum > -1); + ASSERT(eRouteNum < GC.getNumRouteInfos()); if(eRouteNum > -1 && eRouteNum < (int)m_paRouteInfo.size()) return m_paRouteInfo[eRouteNum]; else @@ -3774,8 +3774,8 @@ std::vector& CvGlobals::getImprovementInfo() CvImprovementEntry* CvGlobals::getImprovementInfo(ImprovementTypes eImprovementNum) { - CvAssert(eImprovementNum > -1); - CvAssert(eImprovementNum < GC.getNumImprovementInfos()); + ASSERT(eImprovementNum > -1); + ASSERT(eImprovementNum < GC.getNumImprovementInfos()); if(eImprovementNum > -1 && eImprovementNum < GC.getNumImprovementInfos()) return m_pImprovements->GetImprovementEntries()[eImprovementNum]; else @@ -3799,8 +3799,8 @@ std::vector& CvGlobals::getBuildInfo() CvBuildInfo* CvGlobals::getBuildInfo(BuildTypes eBuildNum) { - CvAssert(eBuildNum > -1); - CvAssert(eBuildNum < GC.getNumBuildInfos()); + ASSERT(eBuildNum > -1); + ASSERT(eBuildNum < GC.getNumBuildInfos()); if(eBuildNum > -1 && eBuildNum < (int)m_paBuildInfo.size()) return m_paBuildInfo[eBuildNum]; else @@ -3819,8 +3819,8 @@ std::vector& CvGlobals::getHandicapInfo() CvHandicapInfo* CvGlobals::getHandicapInfo(HandicapTypes eHandicapNum) { - CvAssert(eHandicapNum > -1); - CvAssert(eHandicapNum < GC.getNumHandicapInfos()); + ASSERT(eHandicapNum > -1); + ASSERT(eHandicapNum < GC.getNumHandicapInfos()); if(eHandicapNum > -1 && eHandicapNum < (int)m_paHandicapInfo.size()) return m_paHandicapInfo[eHandicapNum]; else @@ -3839,8 +3839,8 @@ std::vector& CvGlobals::getGameSpeedInfo() CvGameSpeedInfo* CvGlobals::getGameSpeedInfo(GameSpeedTypes eGameSpeedNum) { - CvAssert(eGameSpeedNum > -1); - CvAssert(eGameSpeedNum < GC.getNumGameSpeedInfos()); + ASSERT(eGameSpeedNum > -1); + ASSERT(eGameSpeedNum < GC.getNumGameSpeedInfos()); if(eGameSpeedNum > -1 && eGameSpeedNum < (int)m_paGameSpeedInfo.size()) return m_paGameSpeedInfo[eGameSpeedNum]; else @@ -3860,8 +3860,8 @@ std::vector& CvGlobals::getDiploModifierInfo() CvDiploModifierInfo* CvGlobals::getDiploModifierInfo(DiploModifierTypes eDiploModifierNum) { - CvAssert(eDiploModifierNum > -1); - CvAssert(eDiploModifierNum < GC.getNumDiploModifierInfos()); + ASSERT(eDiploModifierNum > -1); + ASSERT(eDiploModifierNum < GC.getNumDiploModifierInfos()); if(eDiploModifierNum > -1 && eDiploModifierNum < (int)m_paDiploModifierInfo.size()) return m_paDiploModifierInfo[eDiploModifierNum]; else @@ -3882,8 +3882,8 @@ std::vector& CvGlobals::getProcessInfo() CvProcessInfo* CvGlobals::getProcessInfo(ProcessTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumProcessInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumProcessInfos()); if(e > -1 && e < (int)m_paProcessInfo.size()) return m_paProcessInfo[e]; else @@ -3902,8 +3902,8 @@ std::vector& CvGlobals::getVoteInfo() CvVoteInfo* CvGlobals::getVoteInfo(VoteTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumVoteInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumVoteInfos()); if(e > -1 && e < (int)m_paVoteInfo.size()) return m_paVoteInfo[e]; else @@ -3922,8 +3922,8 @@ std::vector& CvGlobals::getProjectInfo() CvProjectEntry* CvGlobals::getProjectInfo(ProjectTypes e) { - CvAssert(e > -1); - CvAssert(e < GC.getNumProjectInfos()); + ASSERT(e > -1); + ASSERT(e < GC.getNumProjectInfos()); if(e > -1 && e < GC.getNumProjectInfos()) return m_pProjects->GetProjectEntries()[e]; else @@ -3947,8 +3947,8 @@ std::vector& CvGlobals::getBuildingClassInfo() CvBuildingClassInfo* CvGlobals::getBuildingClassInfo(BuildingClassTypes eBuildingClassNum) { - CvAssert(eBuildingClassNum > -1); - CvAssert(eBuildingClassNum < GC.getNumBuildingClassInfos()); + ASSERT(eBuildingClassNum > -1); + ASSERT(eBuildingClassNum < GC.getNumBuildingClassInfos()); if(eBuildingClassNum > -1 && eBuildingClassNum < (int)m_paBuildingClassInfo.size()) return m_paBuildingClassInfo[eBuildingClassNum]; else @@ -3967,8 +3967,8 @@ std::vector& CvGlobals::getBuildingInfo() CvBuildingEntry* CvGlobals::getBuildingInfo(BuildingTypes eBuildingNum) { - CvAssert(eBuildingNum > -1); - CvAssert(eBuildingNum < GC.getNumBuildingInfos()); + ASSERT(eBuildingNum > -1); + ASSERT(eBuildingNum < GC.getNumBuildingInfos()); if(eBuildingNum > -1 && eBuildingNum < GC.getNumBuildingInfos()) return m_pBuildings->GetBuildingEntries()[eBuildingNum]; else @@ -4166,8 +4166,8 @@ std::vector& CvGlobals::getUnitClassInfo() CvUnitClassInfo* CvGlobals::getUnitClassInfo(UnitClassTypes eUnitClassNum) { - CvAssert(eUnitClassNum > -1); - CvAssert(eUnitClassNum < GC.getNumUnitClassInfos()); + ASSERT(eUnitClassNum > -1); + ASSERT(eUnitClassNum < GC.getNumUnitClassInfos()); if(eUnitClassNum > -1 && eUnitClassNum < (int)m_paUnitClassInfo.size()) return m_paUnitClassInfo[eUnitClassNum]; else @@ -4186,8 +4186,8 @@ std::vector& CvGlobals::getActionInfo() CvActionInfo* CvGlobals::getActionInfo(int i) { - CvAssertMsg(i < getNumActionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < getNumActionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < (int)m_paActionInfo.size()) return m_paActionInfo[i]; else @@ -4201,8 +4201,8 @@ std::vector& CvGlobals::getMissionInfo() CvMissionInfo* CvGlobals::getMissionInfo(MissionTypes eMissionNum) { - CvAssert(eMissionNum > -1); - CvAssert(static_cast(eMissionNum) < CvTypes::getNUM_MISSION_TYPES()); + ASSERT(eMissionNum > -1); + ASSERT(static_cast(eMissionNum) < CvTypes::getNUM_MISSION_TYPES()); if(eMissionNum > -1 && eMissionNum < (int)m_paMissionInfo.size()) return m_paMissionInfo[eMissionNum]; else @@ -4216,8 +4216,8 @@ std::vector& CvGlobals::getControlInfo() CvControlInfo* CvGlobals::getControlInfo(ControlTypes eControlNum) { - CvAssert(eControlNum > -1); - CvAssert(eControlNum < NUM_CONTROL_TYPES); + ASSERT(eControlNum > -1); + ASSERT(eControlNum < NUM_CONTROL_TYPES); if(eControlNum > -1 && eControlNum < (int)m_paControlInfo.size()) return m_paControlInfo[eControlNum]; else @@ -4231,8 +4231,8 @@ std::vector& CvGlobals::getCommandInfo() CvCommandInfo* CvGlobals::getCommandInfo(CommandTypes eCommandNum) { - CvAssert(eCommandNum > -1); - CvAssert(eCommandNum < NUM_COMMAND_TYPES); + ASSERT(eCommandNum > -1); + ASSERT(eCommandNum < NUM_COMMAND_TYPES); if(eCommandNum > -1 && eCommandNum < (int)m_paCommandInfo.size()) return m_paCommandInfo[eCommandNum]; else @@ -4251,8 +4251,8 @@ std::vector& CvGlobals::getAutomateInfo() CvAutomateInfo* CvGlobals::getAutomateInfo(int iAutomateNum) { - CvAssertMsg(iAutomateNum < getNumAutomateInfos(), "Index out of bounds"); - CvAssertMsg(iAutomateNum > -1, "Index out of bounds"); + ASSERT(iAutomateNum < getNumAutomateInfos(), "Index out of bounds"); + ASSERT(iAutomateNum > -1, "Index out of bounds"); if(iAutomateNum > -1 && iAutomateNum < (int)m_paAutomateInfo.size()) return m_paAutomateInfo[iAutomateNum]; else @@ -4271,8 +4271,8 @@ std::vector& CvGlobals::getPromotionInfo() CvPromotionEntry* CvGlobals::getPromotionInfo(PromotionTypes ePromotionNum) { - CvAssert(ePromotionNum > -1); - CvAssert(ePromotionNum < GC.getNumPromotionInfos()); + ASSERT(ePromotionNum > -1); + ASSERT(ePromotionNum < GC.getNumPromotionInfos()); if(ePromotionNum > -1 && ePromotionNum < GC.getNumPromotionInfos()) return m_pPromotions->GetPromotionEntries()[ePromotionNum]; else @@ -4296,8 +4296,8 @@ std::vector& CvGlobals::getSpecialistInfo() CvSpecialistInfo* CvGlobals::getSpecialistInfo(SpecialistTypes eSpecialistNum) { - CvAssert(eSpecialistNum > -1); - CvAssert(eSpecialistNum < GC.getNumSpecialistInfos()); + ASSERT(eSpecialistNum > -1); + ASSERT(eSpecialistNum < GC.getNumSpecialistInfos()); if(eSpecialistNum > -1 && eSpecialistNum < (int)m_paSpecialistInfo.size()) return m_paSpecialistInfo[eSpecialistNum]; else @@ -4341,8 +4341,8 @@ std::vector& CvGlobals::getCitySpecializationInfo CvCitySpecializationXMLEntry* CvGlobals::getCitySpecializationInfo(CitySpecializationTypes eCitySpecialization) { - CvAssert(eCitySpecialization > -1); - CvAssert(eCitySpecialization < GC.getNumCitySpecializationInfos()); + ASSERT(eCitySpecialization > -1); + ASSERT(eCitySpecialization < GC.getNumCitySpecializationInfos()); if(eCitySpecialization > -1 && eCitySpecialization < GC.getNumCitySpecializationInfos()) return m_pCitySpecializations->GetCitySpecializationEntries()[eCitySpecialization]; else @@ -4410,8 +4410,8 @@ std::vector& CvGlobals::getAICityStrategyInfo() CvAICityStrategyEntry* CvGlobals::getAICityStrategyInfo(AICityStrategyTypes eAICityStrategyNum) { - CvAssert(eAICityStrategyNum > -1); - CvAssert(eAICityStrategyNum < GC.getNumAICityStrategyInfos()); + ASSERT(eAICityStrategyNum > -1); + ASSERT(eAICityStrategyNum < GC.getNumAICityStrategyInfos()); return m_pAICityStrategies->GetAICityStrategyEntries()[eAICityStrategyNum]; } @@ -4432,8 +4432,8 @@ std::vector& CvGlobals::getPolicyInfo() CvPolicyEntry* CvGlobals::getPolicyInfo(PolicyTypes ePolicyNum) { - CvAssert(ePolicyNum > -1); - CvAssert(ePolicyNum < GC.getNumPolicyInfos()); + ASSERT(ePolicyNum > -1); + ASSERT(ePolicyNum < GC.getNumPolicyInfos()); return m_pPolicies->GetPolicyEntries()[ePolicyNum]; } @@ -4454,8 +4454,8 @@ std::vector& CvGlobals::getPolicyBranchInfo() CvPolicyBranchEntry* CvGlobals::getPolicyBranchInfo(PolicyBranchTypes ePolicyBranchNum) { - CvAssert(ePolicyBranchNum > -1); - CvAssert(ePolicyBranchNum < GC.getNumPolicyBranchInfos()); + ASSERT(ePolicyBranchNum > -1); + ASSERT(ePolicyBranchNum < GC.getNumPolicyBranchInfos()); return m_pPolicies->GetPolicyBranchEntries()[ePolicyBranchNum]; } @@ -4471,8 +4471,8 @@ std::vector& CvGlobals::getEmphasisInfo() CvEmphasisEntry* CvGlobals::getEmphasisInfo(EmphasizeTypes eEmphasisNum) { - CvAssert(eEmphasisNum > -1); - CvAssert(eEmphasisNum < GC.getNumEmphasisInfos()); + ASSERT(eEmphasisNum > -1); + ASSERT(eEmphasisNum < GC.getNumEmphasisInfos()); return m_pEmphases->GetEmphasisEntries()[eEmphasisNum]; } @@ -4493,8 +4493,8 @@ std::vector& CvGlobals::getTraitInfo() CvTraitEntry* CvGlobals::getTraitInfo(TraitTypes eTraitNum) { - CvAssert(eTraitNum > -1); - CvAssert(eTraitNum < GC.getNumTraitInfos()); + ASSERT(eTraitNum > -1); + ASSERT(eTraitNum < GC.getNumTraitInfos()); return m_pTraits->GetTraitEntries()[eTraitNum]; } @@ -4515,8 +4515,8 @@ std::vector& CvGlobals::getReligionInfo() CvReligionEntry* CvGlobals::getReligionInfo(ReligionTypes eReligionNum) { - CvAssert(eReligionNum > -1); - CvAssert(eReligionNum < GC.getNumReligionInfos()); + ASSERT(eReligionNum > -1); + ASSERT(eReligionNum < GC.getNumReligionInfos()); return m_pReligions->GetReligionEntries()[eReligionNum]; } @@ -4537,8 +4537,8 @@ std::vector& CvGlobals::getBeliefInfo() CvBeliefEntry* CvGlobals::getBeliefInfo(BeliefTypes eBeliefNum) { - CvAssert(eBeliefNum > -1); - CvAssert(eBeliefNum < GC.getNumBeliefInfos()); + ASSERT(eBeliefNum > -1); + ASSERT(eBeliefNum < GC.getNumBeliefInfos()); return m_pBeliefs->GetBeliefEntries()[eBeliefNum]; } @@ -4560,8 +4560,8 @@ std::vector& CvGlobals::getCorporationInfo() CvCorporationEntry* CvGlobals::getCorporationInfo(CorporationTypes eCorporationNum) { - CvAssert(eCorporationNum > -1); - CvAssert(eCorporationNum < GC.getNumCorporationInfos()); + ASSERT(eCorporationNum > -1); + ASSERT(eCorporationNum < GC.getNumCorporationInfos()); return m_pCorporations->GetCorporationEntries()[eCorporationNum]; } @@ -4582,8 +4582,8 @@ std::vector& CvGlobals::getContractInfo() CvContractEntry* CvGlobals::getContractInfo(ContractTypes eContract) { - CvAssert(eContract > -1); - CvAssert(eContract < GC.getNumContractInfos()); + ASSERT(eContract > -1); + ASSERT(eContract < GC.getNumContractInfos()); return m_paContractInfo[eContract]; } @@ -4605,8 +4605,8 @@ std::vector& CvGlobals::getSpyPassiveBonusInfo() _Ret_maybenull_ CvSpyPassiveBonusEntry* CvGlobals::getSpyPassiveBonusInfo(SpyPassiveBonusTypes eSpyPassiveBonusNum) { - CvAssert(eSpyPassiveBonusNum > -1); - CvAssert(eSpyPassiveBonusNum < GC.getNumSpyPassiveBonusInfos()); + ASSERT(eSpyPassiveBonusNum > -1); + ASSERT(eSpyPassiveBonusNum < GC.getNumSpyPassiveBonusInfos()); return m_pSpyPassiveBonuses->GetSpyPassiveBonusEntries()[eSpyPassiveBonusNum]; } @@ -4627,8 +4627,8 @@ std::vector& CvGlobals::getSpyPassiveBonusDiplo _Ret_maybenull_ CvSpyPassiveBonusDiplomatEntry* CvGlobals::getSpyPassiveBonusDiplomatInfo(SpyPassiveBonusDiplomatTypes eSpyPassiveBonusDiplomatNum) { - CvAssert(eSpyPassiveBonusDiplomatNum > -1); - CvAssert(eSpyPassiveBonusDiplomatNum < GC.getNumSpyPassiveBonusDiplomatInfos()); + ASSERT(eSpyPassiveBonusDiplomatNum > -1); + ASSERT(eSpyPassiveBonusDiplomatNum < GC.getNumSpyPassiveBonusDiplomatInfos()); return m_pSpyPassiveBonusesDiplomat->GetSpyPassiveBonusDiplomatEntries()[eSpyPassiveBonusDiplomatNum]; } @@ -4649,8 +4649,8 @@ std::vector& CvGlobals::getLeagueSpecialSessionInf _Ret_maybenull_ CvLeagueSpecialSessionEntry* CvGlobals::getLeagueSpecialSessionInfo(LeagueSpecialSessionTypes eLeagueSpecialSessionNum) { - CvAssert(eLeagueSpecialSessionNum > -1); - CvAssert(eLeagueSpecialSessionNum < GC.getNumLeagueSpecialSessionInfos()); + ASSERT(eLeagueSpecialSessionNum > -1); + ASSERT(eLeagueSpecialSessionNum < GC.getNumLeagueSpecialSessionInfos()); return m_pLeagueSpecialSessions->GetLeagueSpecialSessionEntries()[eLeagueSpecialSessionNum]; } @@ -4671,8 +4671,8 @@ std::vector& CvGlobals::getLeagueNameInfo() CvLeagueNameEntry* CvGlobals::getLeagueNameInfo(LeagueNameTypes eLeagueNameNum) { - CvAssert(eLeagueNameNum > -1); - CvAssert(eLeagueNameNum < GC.getNumLeagueNameInfos()); + ASSERT(eLeagueNameNum > -1); + ASSERT(eLeagueNameNum < GC.getNumLeagueNameInfos()); return m_pLeagueNames->GetLeagueNameEntries()[eLeagueNameNum]; } @@ -4693,8 +4693,8 @@ std::vector& CvGlobals::getLeagueProjectInfo() CvLeagueProjectEntry* CvGlobals::getLeagueProjectInfo(LeagueProjectTypes eLeagueProjectNum) { - CvAssert(eLeagueProjectNum > -1); - CvAssert(eLeagueProjectNum < GC.getNumLeagueProjectInfos()); + ASSERT(eLeagueProjectNum > -1); + ASSERT(eLeagueProjectNum < GC.getNumLeagueProjectInfos()); return m_pLeagueProjects->GetLeagueProjectEntries()[eLeagueProjectNum]; } @@ -4715,8 +4715,8 @@ std::vector& CvGlobals::getLeagueProjectRewardInfo( CvLeagueProjectRewardEntry* CvGlobals::getLeagueProjectRewardInfo(LeagueProjectRewardTypes eLeagueProjectRewardNum) { - CvAssert(eLeagueProjectRewardNum > -1); - CvAssert(eLeagueProjectRewardNum < GC.getNumLeagueProjectRewardInfos()); + ASSERT(eLeagueProjectRewardNum > -1); + ASSERT(eLeagueProjectRewardNum < GC.getNumLeagueProjectRewardInfos()); return m_pLeagueProjectRewards->GetLeagueProjectRewardEntries()[eLeagueProjectRewardNum]; } @@ -4760,8 +4760,8 @@ std::vector& CvGlobals::getTechInfo() CvTechEntry* CvGlobals::getTechInfo(TechTypes eTechNum) { - CvAssert(eTechNum > -1); - CvAssert(eTechNum < GC.getNumTechInfos()); + ASSERT(eTechNum > -1); + ASSERT(eTechNum < GC.getNumTechInfos()); return m_pTechs->GetTechEntries()[eTechNum]; } @@ -4782,8 +4782,8 @@ std::vector& CvGlobals::getEraInfo() CvEraInfo* CvGlobals::getEraInfo(EraTypes eEraNum) { - CvAssert(eEraNum > -1); - CvAssert(eEraNum < GC.getNumEraInfos()); + ASSERT(eEraNum > -1); + ASSERT(eEraNum < GC.getNumEraInfos()); return m_aEraInfo[eEraNum]; } @@ -4799,8 +4799,8 @@ std::vector& CvGlobals::getHurryInfo() CvHurryInfo* CvGlobals::getHurryInfo(HurryTypes eHurryNum) { - CvAssert(eHurryNum > -1); - CvAssert(eHurryNum < GC.getNumHurryInfos()); + ASSERT(eHurryNum > -1); + ASSERT(eHurryNum < GC.getNumHurryInfos()); return m_paHurryInfo[eHurryNum]; } @@ -4816,8 +4816,8 @@ std::vector& CvGlobals::getVictoryInfo() CvVictoryInfo* CvGlobals::getVictoryInfo(VictoryTypes eVictoryNum) { - CvAssert(eVictoryNum > -1); - CvAssert(eVictoryNum < GC.getNumVictoryInfos()); + ASSERT(eVictoryNum > -1); + ASSERT(eVictoryNum < GC.getNumVictoryInfos()); return m_paVictoryInfo[eVictoryNum]; } @@ -4833,8 +4833,8 @@ std::vector& CvGlobals::getSmallAwardInfo() // For Moose - XM CvSmallAwardInfo* CvGlobals::getSmallAwardInfo(SmallAwardTypes eSmallAwardNum) { - CvAssert(eSmallAwardNum > -1); - CvAssert(eSmallAwardNum < GC.getNumSmallAwardInfos()); + ASSERT(eSmallAwardNum > -1); + ASSERT(eSmallAwardNum < GC.getNumSmallAwardInfos()); return m_paSmallAwardInfo[eSmallAwardNum]; } @@ -4851,8 +4851,8 @@ std::vector& CvGlobals::getUnitDomainInfo() CvDomainInfo* CvGlobals::getUnitDomainInfo(DomainTypes eDomainNum) { - CvAssert(eDomainNum > -1); - CvAssert(eDomainNum < GC.getNumUnitDomainInfos()); + ASSERT(eDomainNum > -1); + ASSERT(eDomainNum < GC.getNumUnitDomainInfos()); return m_paUnitDomainInfo[eDomainNum]; } @@ -4884,8 +4884,8 @@ std::vector& CvGlobals::getAchievementInfo() CvAchievementInfo* CvGlobals::getAchievementInfo(EAchievement eAchievementNum) { - CvAssert(eAchievementNum > -1); - CvAssert(eAchievementNum < GC.getNumAchievementInfos()); + ASSERT(eAchievementNum > -1); + ASSERT(eAchievementNum < GC.getNumAchievementInfos()); if(eAchievementNum > -1 && eAchievementNum < GC.getNumAchievementInfos()) return m_pAchievements->GetAchievementEntries()[eAchievementNum]; else @@ -4904,8 +4904,8 @@ CvString*& CvGlobals::getFootstepAudioTags() CvString& CvGlobals::getFootstepAudioTags(int i) { -// CvAssertMsg(i < getNumFootstepAudioTags(), "Index out of bounds") - CvAssertMsg(i > -1, "Index out of bounds"); +// ASSERT(i < getNumFootstepAudioTags(), "Index out of bounds") + ASSERT(i > -1, "Index out of bounds"); return m_paszFootstepAudioTags[i]; } @@ -7317,7 +7317,7 @@ bool CvGlobals::getDatabaseValue(const char* szName, int& iValue, bool bReportEr if(bReportErrors) { - CvAssertFmt(bSuccess, "Integer Define Value not found for %s", szName); + ASSERT(bSuccess, "Integer Define Value not found for %s", szName); } return bSuccess; @@ -7339,7 +7339,7 @@ bool CvGlobals::getDatabaseValue(const char* szName, float& fValue, bool bReport if(bReportErrors) { - CvAssertFmt(bSuccess, "Float Define Value not found for %s", szName); + ASSERT(bSuccess, "Float Define Value not found for %s", szName); } return bSuccess; @@ -7361,7 +7361,7 @@ bool CvGlobals::getDatabaseValue(const char* szName, CvString& strValue, bool bR if(bReportErrors) { - CvAssertFmt(bSuccess, "String Define Value not found for %s", szName); + ASSERT(bSuccess, "String Define Value not found for %s", szName); } return bSuccess; @@ -7460,7 +7460,7 @@ int CvGlobals::getInfoTypeForString(const char* szType, bool hideAssert) const { if(!hideAssert) { - CvAssertMsg(szType, "null info type string"); + ASSERT(szType, "null info type string"); } if(szType == NULL) @@ -7480,7 +7480,7 @@ int CvGlobals::getInfoTypeForString(const char* szType, bool hideAssert) const // CvString strError; strError.Format("Info type %s not found.", szType); - CvAssertMsg(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0, strError.c_str()); + ASSERT(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0, strError.c_str()); // gDLL->logMsg("xml.log", szError); } @@ -7489,16 +7489,16 @@ int CvGlobals::getInfoTypeForString(const char* szType, bool hideAssert) const void CvGlobals::setInfoTypeFromString(const char* szType, int idx) { - CvAssertMsg(szType, "null info type string"); + ASSERT(szType, "null info type string"); uint uiHash = FString::Hash(szType); #ifdef _DEBUG InfosMap::const_iterator it = m_infosMap.find(szType); int iExisting = (it!=m_infosMap.end()) ? it->second : -1; - CvAssertMsg(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str()); + ASSERT(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str()); InfosHashMap::const_iterator ith = m_infosHashMap.find(uiHash); iExisting = (ith!=m_infosHashMap.end()) ? ith->second : -1; - CvAssertMsg(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str()); + ASSERT(iExisting==-1 || iExisting==idx || strcmp(szType ? szType : "", "ERROR")==0, CvString::format("xml info type entry %s already exists", szType).c_str()); #endif m_infosMap[szType] = idx; m_infosHashMap[uiHash] = idx; @@ -7522,7 +7522,7 @@ int CvGlobals::getInfoTypeForHash(uint uiHash, bool hideAssert) const if(!hideAssert) { - CvAssertMsg(uiHash==0, "Could not find resource hash"); + ASSERT(uiHash==0, "Could not find resource hash"); } return -1; diff --git a/CvGameCoreDLL_Expansion2/CvGlobals.h b/CvGameCoreDLL_Expansion2/CvGlobals.h index 899afcac7f..5a4550440e 100644 --- a/CvGameCoreDLL_Expansion2/CvGlobals.h +++ b/CvGameCoreDLL_Expansion2/CvGlobals.h @@ -672,7 +672,7 @@ class CvGlobals } CvString& getFlavorTypes(FlavorTypes e) { - CvAssert(e > -1); /*CvAssert(e < GC.getNumFlavorTypes())*/; + ASSERT(e > -1); /*ASSERT(e < GC.getNumFlavorTypes())*/; return m_paszFlavorTypes[e]; } diff --git a/CvGameCoreDLL_Expansion2/CvGrandStrategyAI.cpp b/CvGameCoreDLL_Expansion2/CvGrandStrategyAI.cpp index b6ecc51fa3..ce5c97f0d6 100644 --- a/CvGameCoreDLL_Expansion2/CvGrandStrategyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvGrandStrategyAI.cpp @@ -49,24 +49,24 @@ bool CvAIGrandStrategyXMLEntry::CacheResults(Database::Results& kResults, CvData /// What Flavors will be added by adopting this Grand Strategy? int CvAIGrandStrategyXMLEntry::GetFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : -1; } /// What Flavors will be added by adopting this Grand Strategy? int CvAIGrandStrategyXMLEntry::GetSpecializationBoost(YieldTypes eYield) const { - FAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - FAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piSpecializationBoost ? m_piSpecializationBoost[(int)eYield] : 0; } /// What Flavors will be added by adopting this Grand Strategy? int CvAIGrandStrategyXMLEntry::GetFlavorModValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorModValue ? m_piFlavorModValue[i] : 0; } @@ -141,7 +141,7 @@ void CvGrandStrategyAI::Init(CvAIGrandStrategyXMLEntries* pAIGrandStrategies, Cv m_pPlayer = pPlayer; // Initialize AIGrandStrategy status array - FAssertMsg(m_paiGrandStrategyPriority==NULL, "about to leak memory, CvGrandStrategyAI::m_paiGrandStrategyPriority"); + ASSERT(m_paiGrandStrategyPriority==NULL, "about to leak memory, CvGrandStrategyAI::m_paiGrandStrategyPriority"); m_paiGrandStrategyPriority = FNEW(int[m_pAIGrandStrategies->GetNumAIGrandStrategies()], c_eCiv5GameplayDLL, 0); Reset(); @@ -191,7 +191,7 @@ void CvGrandStrategyAI::Serialize(GrandStrategyAI& grandStrategyAI, Visitor& vis visitor(grandStrategyAI.m_iNumTurnsSinceActiveSet); visitor(grandStrategyAI.m_eActiveGrandStrategy); - CvAssertMsg(grandStrategyAI.m_pAIGrandStrategies != NULL && grandStrategyAI.m_pAIGrandStrategies->GetNumAIGrandStrategies() > 0, "Number of AIGrandStrategies to serialize is expected to greater than 0"); + ASSERT(grandStrategyAI.m_pAIGrandStrategies != NULL && grandStrategyAI.m_pAIGrandStrategies->GetNumAIGrandStrategies() > 0, "Number of AIGrandStrategies to serialize is expected to greater than 0"); visitor(MakeConstSpan(grandStrategyAI.m_paiGrandStrategyPriority, grandStrategyAI.m_pAIGrandStrategies->GetNumAIGrandStrategies())); visitor(grandStrategyAI.m_eGuessOtherPlayerActiveGrandStrategy); @@ -1272,7 +1272,7 @@ int CvGrandStrategyAI::GetUnitedNationsPriority() else { CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (pLeague != NULL) { // Votes we control diff --git a/CvGameCoreDLL_Expansion2/CvHomelandAI.cpp b/CvGameCoreDLL_Expansion2/CvHomelandAI.cpp index 79e2fadf72..3d08d8b1bc 100644 --- a/CvGameCoreDLL_Expansion2/CvHomelandAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvHomelandAI.cpp @@ -2879,7 +2879,7 @@ vector>> CvHomelandAI::GetWeight std::stable_sort(aWeightedDirectives.begin(), aWeightedDirectives.end()); - CvAssert(aWeightedDirectives.size() == aDirectives.size()); + ASSERT(aWeightedDirectives.size() == aDirectives.size()); return aWeightedDirectives; } @@ -4554,7 +4554,7 @@ void CvHomelandAI::ExecuteGeneralMoves() break; } - CvAssertMsg(eSelectedBuildType != NO_BUILD, "Great General trying to build something it doesn't qualify for"); + ASSERT(eSelectedBuildType != NO_BUILD, "Great General trying to build something it doesn't qualify for"); if (eSelectedBuildType != NO_BUILD) { pUnit->PushMission(CvTypes::getMISSION_BUILD(), eSelectedBuildType, -1, 0, false, false, MISSIONAI_BUILD, pTargetPlot); @@ -6078,7 +6078,7 @@ bool CvHomelandAI::ExecuteSpecialExploreMove(CvUnit* pUnit, CvPlot* pTargetPlot) CvPlot* pPlot = PathHelpers::GetPathEndFirstTurnPlot(path); if(pPlot) { - CvAssert(!pUnit->atPlot(*pPlot)); + ASSERT(!pUnit->atPlot(*pPlot)); if(GC.getLogging() && GC.getAILogging()) { CvString strLogString; diff --git a/CvGameCoreDLL_Expansion2/CvImprovementClasses.cpp b/CvGameCoreDLL_Expansion2/CvImprovementClasses.cpp index 9a6f6f91a9..e8bfbcaa5c 100644 --- a/CvGameCoreDLL_Expansion2/CvImprovementClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvImprovementClasses.cpp @@ -54,8 +54,8 @@ bool CvImprovementResourceInfo::isResourceTrade() const //------------------------------------------------------------------------------ int CvImprovementResourceInfo::getYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } //------------------------------------------------------------------------------ @@ -533,15 +533,15 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while (pResults->Step()) { const YieldTypes yield_idx = YieldTypes(pResults->GetInt(0)); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const ImprovementTypes improvement_idx = ImprovementTypes(pResults->GetInt(1)); - CvAssert(improvement_idx > -1); + ASSERT(improvement_idx > -1); const int yield = pResults->GetInt(2); const int nRequired = pResults->GetInt(3); - CvAssert(nRequired > 0); + ASSERT(nRequired > 0); m_YieldPerXAdjacentImprovement[yield_idx][improvement_idx] += fraction(yield, nRequired); } @@ -563,15 +563,15 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while (pResults->Step()) { const YieldTypes yield_idx = YieldTypes(pResults->GetInt(0)); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const TerrainTypes terrain_idx = TerrainTypes(pResults->GetInt(1)); - CvAssert(terrain_idx > -1); + ASSERT(terrain_idx > -1); const int yield = pResults->GetInt(2); const int nRequired = pResults->GetInt(3); - CvAssert(nRequired > 0); + ASSERT(nRequired > 0); m_YieldPerXAdjacentTerrain[yield_idx][terrain_idx] += fraction(yield, nRequired); } @@ -582,7 +582,7 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti //m_ppiAdjacentResourceYieldChanges { const int iNumResources = kUtility.MaxRows("Resources"); - CvAssertMsg(iNumResources > 0, "Num Resource Infos <= 0"); + ASSERT(iNumResources > 0, "Num Resource Infos <= 0"); kUtility.Initialize2DArray(m_ppiAdjacentResourceYieldChanges, iNumResources, iNumYields); std::string strKey = "Improvements - AdjacentResourceYieldChanges"; @@ -597,10 +597,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int resource_idx = pResults->GetInt(1); - CvAssert(resource_idx > -1); + ASSERT(resource_idx > -1); const int yield = pResults->GetInt(2); @@ -612,7 +612,7 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti //m_ppiAdjacentTerrainYieldChanges { const int iNumTerrains = kUtility.MaxRows("Terrains"); - CvAssertMsg(iNumTerrains > 0, "Num Terrain Infos <= 0"); + ASSERT(iNumTerrains > 0, "Num Terrain Infos <= 0"); kUtility.Initialize2DArray(m_ppiAdjacentTerrainYieldChanges, iNumTerrains, iNumYields); std::string strKey = "Terrains - AdjacentTerrainYieldChanges"; @@ -627,10 +627,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int terrain_idx = pResults->GetInt(1); - CvAssert(terrain_idx > -1); + ASSERT(terrain_idx > -1); const int yield = pResults->GetInt(2); @@ -643,7 +643,7 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti //m_ppiAdjacentFeatureYieldChanges { const int iNumFeatures = kUtility.MaxRows("Features"); - CvAssertMsg(iNumFeatures > 0, "Num Feature Infos <= 0"); + ASSERT(iNumFeatures > 0, "Num Feature Infos <= 0"); kUtility.Initialize2DArray(m_ppiAdjacentFeatureYieldChanges, iNumFeatures, iNumYields); std::string strKey = "Features - AdjacentFeatureYieldChanges"; @@ -658,10 +658,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while (pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int feature_idx = pResults->GetInt(1); - CvAssert(feature_idx > -1); + ASSERT(feature_idx > -1); const int yield = pResults->GetInt(2); @@ -674,7 +674,7 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti //m_ppiFeatureYieldChanges { const int iNumFeatures = kUtility.MaxRows("Features"); - CvAssertMsg(iNumFeatures > 0, "Num Feature Infos <= 0"); + ASSERT(iNumFeatures > 0, "Num Feature Infos <= 0"); kUtility.Initialize2DArray(m_ppiFeatureYieldChanges, iNumFeatures, iNumYields); std::string strKey = "Features - FeatureYieldChanges"; @@ -689,10 +689,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while (pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int feature_idx = pResults->GetInt(1); - CvAssert(feature_idx > -1); + ASSERT(feature_idx > -1); const int yield = pResults->GetInt(2); @@ -703,7 +703,7 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti } const int iNumTechs = GC.getNumTechInfos(); - CvAssertMsg(iNumTechs > 0, "Num Tech Infos <= 0"); + ASSERT(iNumTechs > 0, "Num Tech Infos <= 0"); //TechYieldChanges { @@ -721,10 +721,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int tech_idx = pResults->GetInt(1); - CvAssert(tech_idx > -1); + ASSERT(tech_idx > -1); const int yield = pResults->GetInt(2); @@ -748,10 +748,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int tech_idx = pResults->GetInt(1); - CvAssert(tech_idx > -1); + ASSERT(tech_idx > -1); const int yield = pResults->GetInt(2); @@ -778,10 +778,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int tech_idx = pResults->GetInt(1); - CvAssert(tech_idx > -1); + ASSERT(tech_idx > -1); const int yield = pResults->GetInt(2); @@ -809,10 +809,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int route_idx = pResults->GetInt(1); - CvAssert(route_idx > -1); + ASSERT(route_idx > -1); const int yield = pResults->GetInt(2); @@ -840,10 +840,10 @@ bool CvImprovementEntry::CacheResults(Database::Results& kResults, CvDatabaseUti while (pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int accomplishment_idx = pResults->GetInt(1); - CvAssert(accomplishment_idx > -1); + ASSERT(accomplishment_idx > -1); const int yield = pResults->GetInt(2); @@ -900,10 +900,10 @@ int CvImprovementEntry::GetAdditionalUnits() const /// Bonus yield if another improvement is adjacent fraction CvImprovementEntry::GetYieldPerXAdjacentImprovement(YieldTypes eYield, ImprovementTypes eImprovement) const { - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eImprovement > -1, "Index out of Bounds"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eImprovement > -1, "Index out of Bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); fraction fYield = 0; map>::const_iterator itImprovement = m_YieldPerXAdjacentImprovement.find(eYield); @@ -919,8 +919,8 @@ fraction CvImprovementEntry::GetYieldPerXAdjacentImprovement(YieldTypes eYield, } bool CvImprovementEntry::IsYieldPerXAdjacentImprovement(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield >= -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield >= -1, "Index out of bounds"); if (eYield == NO_YIELD) return !m_YieldPerXAdjacentImprovement.empty(); @@ -933,10 +933,10 @@ bool CvImprovementEntry::IsYieldPerXAdjacentImprovement(YieldTypes eYield) const /// Bonus yield if a terrain is adjacent fraction CvImprovementEntry::GetYieldPerXAdjacentTerrain(YieldTypes eYield, TerrainTypes eTerrain) const { - CvAssertMsg(eTerrain < NUM_TERRAIN_TYPES, "Index out of bounds"); - CvAssertMsg(eTerrain > -1, "Index out of Bounds"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eTerrain < NUM_TERRAIN_TYPES, "Index out of bounds"); + ASSERT(eTerrain > -1, "Index out of Bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); fraction fYield = 0; map>::const_iterator itTerrain = m_YieldPerXAdjacentTerrain.find(eYield); @@ -952,8 +952,8 @@ fraction CvImprovementEntry::GetYieldPerXAdjacentTerrain(YieldTypes eYield, Terr } bool CvImprovementEntry::IsYieldPerXAdjacentTerrain(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield >= -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield >= -1, "Index out of bounds"); if (eYield == NO_YIELD) return !m_YieldPerXAdjacentTerrain.empty(); @@ -1417,16 +1417,16 @@ int CvImprovementEntry::GetWorldSoundscapeScriptId() const /// What resource is required to build this improvement? int CvImprovementEntry::GetResourceQuantityRequirement(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityRequirements ? m_piResourceQuantityRequirements[i] : -1; } /// How much of a resource yield is required before this improvement can be built int CvImprovementEntry::GetPrereqNatureYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPrereqNatureYield ? m_piPrereqNatureYield[i] : -1; } @@ -1438,8 +1438,8 @@ int* CvImprovementEntry::GetPrereqNatureYieldArray() /// How much this improvement improves a certain yield int CvImprovementEntry::GetYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : 0; } @@ -1451,16 +1451,16 @@ int* CvImprovementEntry::GetYieldChangeArray() /// How much this improvement improves a certain yield for each era of age int CvImprovementEntry::GetYieldChangePerEra(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerEra ? m_piYieldPerEra[i] : 0; } // How much the city having a We Love the King Day improves the yield of this improvement int CvImprovementEntry::GetWLTKDYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piWLTKDYieldChange ? m_piWLTKDYieldChange[i] : 0; } @@ -1472,8 +1472,8 @@ int* CvImprovementEntry::GetWLTKDYieldChangeArray() // How much the city having a Golden Age improves the yield of this improvement int CvImprovementEntry::GetGoldenAgeYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoldenAgeYieldChange ? m_piGoldenAgeYieldChange[i] : 0; } @@ -1485,8 +1485,8 @@ int* CvImprovementEntry::GetGoldenAgeYieldChangeArray() /// How much being next to a river improves the yield of this improvement int CvImprovementEntry::GetRiverSideYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piRiverSideYieldChange ? m_piRiverSideYieldChange[i] : 0; } @@ -1498,8 +1498,8 @@ int* CvImprovementEntry::GetRiverSideYieldChangeArray() /// How much being on a coastal tile improves the yield of this improvement int CvImprovementEntry::GetCoastalLandYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCoastalLandYieldChange ? m_piCoastalLandYieldChange[i] : 0; } @@ -1511,8 +1511,8 @@ int* CvImprovementEntry::GetCoastalLandYieldChangeArray() /// How much being on a hill tile improves the yield of this improvement int CvImprovementEntry::GetHillsYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piHillsYieldChange ? m_piHillsYieldChange[i] : 0; } @@ -1524,8 +1524,8 @@ int* CvImprovementEntry::GetHillsYieldChangeArray() /// How much having access to fresh water improves the yield of this improvement int CvImprovementEntry::GetFreshWaterYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFreshWaterChange ? m_piFreshWaterChange[i] : 0; } @@ -1537,8 +1537,8 @@ int* CvImprovementEntry::GetFreshWaterYieldChangeArray() // For Moose - CvWidget /// How much being adjacent to a city improves the yield of this improvement int CvImprovementEntry::GetAdjacentCityYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piAdjacentCityYieldChange ? m_piAdjacentCityYieldChange[i] : 0; } @@ -1550,8 +1550,8 @@ int* CvImprovementEntry::GetAdjacentCityYieldChangeArray() /// How much being adjacent to a mountain improves the yield of this improvement int CvImprovementEntry::GetAdjacentMountainYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piAdjacentMountainYieldChange ? m_piAdjacentMountainYieldChange[i] : 0; } @@ -1563,34 +1563,34 @@ int* CvImprovementEntry::GetAdjacentMountainYieldChangeArray() /// If this improvement requires a terrain type to be valid bool CvImprovementEntry::GetTerrainMakesValid(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbTerrainMakesValid ? m_pbTerrainMakesValid[i] : false; } /// If this improvement requires a feature to be valid bool CvImprovementEntry::GetFeatureMakesValid(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbFeatureMakesValid ? m_pbFeatureMakesValid[i] : false; } /// If this improvement requires a different improvement to be valid bool CvImprovementEntry::GetImprovementMakesValid(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbImprovementMakesValid ? m_pbImprovementMakesValid[i] : false; } /// How much an improvement yields if built next to a resource int CvImprovementEntry::GetAdjacentResourceYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiAdjacentResourceYieldChanges[i][j]; } @@ -1602,10 +1602,10 @@ int* CvImprovementEntry::GetAdjacentResourceYieldChangesArray(int i) /// How much bonus yields an improvement gives to adjacent tiles with a certain terrain int CvImprovementEntry::GetAdjacentTerrainYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiAdjacentTerrainYieldChanges[i][j]; } @@ -1617,10 +1617,10 @@ int* CvImprovementEntry::GetAdjacentTerrainYieldChangesArray(int i) /// How much an improvement yields if built next to a feature int CvImprovementEntry::GetAdjacentFeatureYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiAdjacentFeatureYieldChanges[i][j]; } @@ -1631,10 +1631,10 @@ int* CvImprovementEntry::GetAdjacentFeatureYieldChangesArray(int i) int CvImprovementEntry::GetFeatureYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiFeatureYieldChanges[i][j]; } int* CvImprovementEntry::GetFeatureYieldChangesArray(int i) @@ -1645,10 +1645,10 @@ int* CvImprovementEntry::GetFeatureYieldChangesArray(int i) /// How much a tech improves the yield of this improvement int CvImprovementEntry::GetTechYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechYieldChanges[i][j]; } @@ -1660,10 +1660,10 @@ int* CvImprovementEntry::GetTechYieldChangesArray(int i) /// How much a tech improves the yield of this improvement if it DOES NOT have fresh water int CvImprovementEntry::GetTechNoFreshWaterYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechNoFreshWaterYieldChanges[i][j]; } @@ -1675,10 +1675,10 @@ int* CvImprovementEntry::GetTechNoFreshWaterYieldChangesArray(int i) /// How much a tech improves the yield of this improvement if it has fresh water int CvImprovementEntry::GetTechFreshWaterYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechFreshWaterYieldChanges[i][j]; } @@ -1690,10 +1690,10 @@ int* CvImprovementEntry::GetTechFreshWaterYieldChangesArray(int i) /// How much a type of route improves the yield of this improvement int CvImprovementEntry::GetRouteYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumRouteInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumRouteInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiRouteYieldChanges[i][j]; } @@ -1705,10 +1705,10 @@ int* CvImprovementEntry::GetRouteYieldChangesArray(int i) // For Moose - CvWi /// Improvement yields from completing accomplishments int CvImprovementEntry::GetAccomplishmentYieldChanges(int i, int j) const { - CvAssertMsg(i < NUM_ACCOMPLISHMENTS_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < NUM_ACCOMPLISHMENTS_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiAccomplishmentYieldChanges[i][j]; } @@ -1720,33 +1720,33 @@ int* CvImprovementEntry::GetAccomplishmentYieldChangesArray(int i) // For Moo /// How much a yield improves when a resource is present with the improvement int CvImprovementEntry::GetImprovementResourceYield(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_paImprovementResource[i].m_piYieldChange ? m_paImprovementResource[i].getYieldChange(j) : 0; } /// What resources does this improvement require to be built bool CvImprovementEntry::IsImprovementResourceMakesValid(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paImprovementResource[i].m_bResourceMakesValid; } /// Does this improvement enable a tradeable resource bool CvImprovementEntry::IsImprovementResourceTrade(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paImprovementResource[i].m_bResourceTrade; } bool CvImprovementEntry::IsConnectsResource(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i >= 0 && i < GC.getNumResourceInfos()) { if (m_paImprovementResource[i].m_bResourceTrade) @@ -1767,32 +1767,32 @@ ResourceTypes CvImprovementEntry::SpawnsAdjacentResource() const /// the chance of the specified Resource appearing randomly when the Improvement is present with no current Resource int CvImprovementEntry::GetImprovementResourceDiscoverRand(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paImprovementResource[i].m_iDiscoverRand; } /// Gets the flavor value of the improvement int CvImprovementEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Indes out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Indes out of bounds"); return m_piFlavorValue[i]; } // Production modifier from improvement for given domain int CvImprovementEntry::GetDomainProductionModifier(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Indes out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Indes out of bounds"); return m_piDomainProductionModifier[i]; } // Free unit experience from improvement for given domain int CvImprovementEntry::GetDomainFreeExperience(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Indes out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Indes out of bounds"); return m_piDomainFreeExperience[i]; } @@ -1879,7 +1879,7 @@ void ImprovementArrayHelpers::Read(FDataStream& kStream, int* paiImprovementArra CvString szError; szError.Format("LOAD ERROR: Improvement Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; @@ -1935,7 +1935,7 @@ void ImprovementArrayHelpers::ReadYieldArray(FDataStream& kStream, int** ppaaiIm CvString szError; szError.Format("LOAD ERROR: Improvement Type not found: %08x", iHash); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); for(int jJ = 0; jJ < iNumYields; jJ++) { diff --git a/CvGameCoreDLL_Expansion2/CvInfos.cpp b/CvGameCoreDLL_Expansion2/CvInfos.cpp index 5f04ab4ec4..d6da24fe84 100644 --- a/CvGameCoreDLL_Expansion2/CvInfos.cpp +++ b/CvGameCoreDLL_Expansion2/CvInfos.cpp @@ -776,8 +776,8 @@ int CvSpecialistInfo::getExperience() const //------------------------------------------------------------------------------ int CvSpecialistInfo::getYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } //------------------------------------------------------------------------------ @@ -1297,7 +1297,7 @@ CvHotKeyInfo* CvActionInfo::getHotkeyInfo() const break; } - CvAssertMsg((0) ,"Unknown Action Subtype in CvActionInfo::getHotkeyInfo"); + ASSERT((0) ,"Unknown Action Subtype in CvActionInfo::getHotkeyInfo"); return NULL; } //------------------------------------------------------------------------------ @@ -1622,15 +1622,15 @@ bool CvSpecialUnitInfo::isCityLoad() const //------------------------------------------------------------------------------ bool CvSpecialUnitInfo::isCarrierUnitAIType(int i) const { - CvAssertMsg(i < NUM_UNITAI_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_UNITAI_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbCarrierUnitAITypes ? m_pbCarrierUnitAITypes[i] : false; } //------------------------------------------------------------------------------ int CvSpecialUnitInfo::getProductionTraits(int i) const { - CvAssertMsg(i < GC.getNumTraitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTraitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piProductionTraits ? m_piProductionTraits[i] : -1; } //------------------------------------------------------------------------------ @@ -1786,8 +1786,8 @@ bool CvBuildingClassInfo::isMonument() const //------------------------------------------------------------------------------ int CvBuildingClassInfo::getVictoryThreshold(int i) const { - CvAssertMsg(i < GC.getNumVictoryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumVictoryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piVictoryThreshold ? m_piVictoryThreshold[i] : -1; } #if defined(MOD_BALANCE_CORE) @@ -1857,7 +1857,7 @@ void BuildingClassArrayHelpers::Read(FDataStream& kStream, int* paiArray) CvString szError; szError.Format("LOAD ERROR: Building Class Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; // Skip it. } @@ -1909,7 +1909,7 @@ void UnitClassArrayHelpers::Read(FDataStream& kStream, int* paiArray) CvString szError; szError.Format("LOAD ERROR: Unit Class Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; @@ -2202,50 +2202,50 @@ ReligionTypes CvCivilizationInfo::GetReligion() const //------------------------------------------------------------------------------ int CvCivilizationInfo::getCivilizationBuildings(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCivilizationBuildings && i>=0 ? m_piCivilizationBuildings[i] : -1; } //------------------------------------------------------------------------------ int CvCivilizationInfo::getCivilizationUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCivilizationUnits && i>=0 ? m_piCivilizationUnits[i] : -1; } //------------------------------------------------------------------------------ bool CvCivilizationInfo::isCivilizationBuildingOverridden(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_CivilizationBuildingOverridden[i]; } //------------------------------------------------------------------------------ bool CvCivilizationInfo::isCivilizationUnitOverridden(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_CivilizationUnitOverridden[i]; } //------------------------------------------------------------------------------ int CvCivilizationInfo::getCivilizationFreeUnitsClass(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCivilizationFreeUnitsClass && i>=0 ? m_piCivilizationFreeUnitsClass[i] : -1; } //------------------------------------------------------------------------------ int CvCivilizationInfo::getCivilizationFreeUnitsDefaultUnitAI(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCivilizationFreeUnitsDefaultUnitAI && i>=0 ? m_piCivilizationFreeUnitsDefaultUnitAI[i] : -1; } //------------------------------------------------------------------------------ bool CvCivilizationInfo::isLeaders(int i) const { - CvAssertMsg(i < GC.getNumLeaderHeadInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumLeaderHeadInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbLeaders && i>=0 ? m_pbLeaders[i] : false; } //------------------------------------------------------------------------------ @@ -2256,22 +2256,22 @@ bool CvCivilizationInfo::IsBlocksMinor(int i) const //------------------------------------------------------------------------------ bool CvCivilizationInfo::isCivilizationFreeBuildingClass(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbCivilizationFreeBuildingClass && i>=0 ? m_pbCivilizationFreeBuildingClass[i] : false; } //------------------------------------------------------------------------------ bool CvCivilizationInfo::isCivilizationFreeTechs(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbCivilizationFreeTechs && i>=0 ? m_pbCivilizationFreeTechs[i] : false; } //------------------------------------------------------------------------------ bool CvCivilizationInfo::isCivilizationDisableTechs(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbCivilizationDisableTechs && i>=0 ? m_pbCivilizationDisableTechs[i] : false; } //------------------------------------------------------------------------------ @@ -2723,7 +2723,7 @@ bool CvVictoryInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& int i = 0; while(pVictoryPointResults->Step()) { - CvAssert(i < iNumVictoryPoints); + ASSERT(i < iNumVictoryPoints); m_piVictoryPointAwards[i++] = pVictoryPointResults->GetInt(0); } @@ -4245,22 +4245,22 @@ int CvHandicapInfo::getNumGoodies() const //------------------------------------------------------------------------------ int CvHandicapInfo::getGoodies(int i) const { - CvAssertMsg(i < getNumGoodies(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < getNumGoodies(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoodies[i]; } //------------------------------------------------------------------------------ int CvHandicapInfo::isFreeTechs(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbFreeTechs[i]; } //------------------------------------------------------------------------------ int CvHandicapInfo::isAIFreeTechs(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbAIFreeTechs[i]; } @@ -4541,13 +4541,13 @@ bool CvHandicapInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility while (pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int historicevent_idx = pResults->GetInt(1); - CvAssert(historicevent_idx > -1); + ASSERT(historicevent_idx > -1); const int era_idx = pResults->GetInt(2); - CvAssert(era_idx > -1); + ASSERT(era_idx > -1); const int amount = pResults->GetInt(3); @@ -4572,13 +4572,13 @@ bool CvHandicapInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility while (pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int historicevent_idx = pResults->GetInt(1); - CvAssert(historicevent_idx > -1); + ASSERT(historicevent_idx > -1); const int era_idx = pResults->GetInt(2); - CvAssert(era_idx > -1); + ASSERT(era_idx > -1); const int amount = pResults->GetInt(3); @@ -5272,58 +5272,58 @@ bool CvBuildInfo::IsCanBeEmbarked() const //------------------------------------------------------------------------------ int CvBuildInfo::getFeatureTech(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFeatureTech ? m_paiFeatureTech[i] : -1; } //------------------------------------------------------------------------------ int CvBuildInfo::getFeatureTime(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFeatureTime ? m_paiFeatureTime[i] : -1; } //------------------------------------------------------------------------------ int CvBuildInfo::getFeatureProduction(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFeatureProduction ? m_paiFeatureProduction[i] : -1; } //------------------------------------------------------------------------------ int CvBuildInfo::getFeatureCost(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFeatureCost ? m_paiFeatureCost[i] : -1; } //------------------------------------------------------------------------------ int CvBuildInfo::getTechTimeChange(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiTechTimeChange ? m_paiTechTimeChange[i] : -1; } //------------------------------------------------------------------------------ bool CvBuildInfo::isFeatureRemove(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pabFeatureRemove ? m_pabFeatureRemove[i] : false; } //------------------------------------------------------------------------------ int CvBuildInfo::getFeatureObsoleteTech(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFeatureObsoleteTech ? m_paiFeatureObsoleteTech[i] : -1; } //------------------------------------------------------------------------------ bool CvBuildInfo::isFeatureRemoveOnly(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pabFeatureRemoveOnly ? m_pabFeatureRemoveOnly[i] : false; } @@ -5391,7 +5391,7 @@ bool CvBuildInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& k const char* szFeatureTech = kArrayResults.GetText("PrereqTech"); - CvAssert(iFeatureIdx > -1); + ASSERT(iFeatureIdx > -1); m_paiFeatureTech[iFeatureIdx] = GC.getInfoTypeForString(szFeatureTech, true); m_paiFeatureTime[iFeatureIdx] = kArrayResults.GetInt("Time"); m_paiFeatureProduction[iFeatureIdx] = kArrayResults.GetInt("Production"); @@ -5432,7 +5432,7 @@ void BuildArrayHelpers::Read(FDataStream& kStream, short* paiBuildArray) CvString szError; szError.Format("LOAD ERROR: Build Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; @@ -5780,22 +5780,22 @@ bool CvRouteInfo::IsIndustrial() const //------------------------------------------------------------------------------ int CvRouteInfo::getYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvRouteInfo::getTechMovementChange(int i) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piTechMovementChange ? m_piTechMovementChange[i] : -1; } //------------------------------------------------------------------------------ int CvRouteInfo::getResourceQuantityRequirement(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityRequirements ? m_piResourceQuantityRequirements[i] : -1; } //------------------------------------------------------------------------------ @@ -6108,8 +6108,8 @@ void CvResourceInfo::setAltArtDefineTagHeavy(const char* szVal) //------------------------------------------------------------------------------ int CvResourceInfo::getYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } //------------------------------------------------------------------------------ @@ -6121,8 +6121,8 @@ int* CvResourceInfo::getYieldChangeArray() //------------------------------------------------------------------------------ int CvResourceInfo::getYieldChangeFromMonopoly(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeFromMonopoly ? m_piYieldChangeFromMonopoly[i] : -1; } //------------------------------------------------------------------------------ @@ -6133,8 +6133,8 @@ int* CvResourceInfo::getYieldChangeFromMonopolyArray() //------------------------------------------------------------------------------ int CvResourceInfo::getCityYieldModFromMonopoly(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityYieldModFromMonopoly ? m_piCityYieldModFromMonopoly[i] : -1; } //------------------------------------------------------------------------------ @@ -6369,11 +6369,11 @@ bool CvResourceInfo::isHasUnitCombatProductionCostModifiersLocal() const //------------------------------------------------------------------------------ int CvResourceInfo::getUnitCombatProductionCostModifiersLocal(UnitCombatTypes eUnitCombat, EraTypes eUnitEra) const { - CvAssertMsg(eUnitCombat < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(eUnitCombat > -1, "Index out of bounds"); + ASSERT(eUnitCombat < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(eUnitCombat > -1, "Index out of bounds"); - CvAssertMsg(eUnitEra < GC.getNumEraInfos(), "Index out of bounds"); - CvAssertMsg(eUnitEra > -1, "Index out of bounds"); + ASSERT(eUnitEra < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(eUnitEra > -1, "Index out of bounds"); int iUnitCombat = (int)eUnitCombat; int iUnitEra = (int)eUnitEra; @@ -6411,8 +6411,8 @@ int CvResourceInfo::getUnitCombatProductionCostModifiersLocal(UnitCombatTypes eU //------------------------------------------------------------------------------ std::vector CvResourceInfo::getUnitCombatProductionCostModifiersLocal(UnitCombatTypes eUnitCombat) const { - CvAssertMsg(eUnitCombat < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(eUnitCombat > -1, "Index out of bounds"); + ASSERT(eUnitCombat < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(eUnitCombat > -1, "Index out of bounds"); int iUnitCombat = (int)eUnitCombat; @@ -6432,8 +6432,8 @@ bool CvResourceInfo::isHasBuildingProductionCostModifiersLocal() const //------------------------------------------------------------------------------ int CvResourceInfo::getBuildingProductionCostModifiersLocal(EraTypes eBuildingEra) const { - CvAssertMsg(eBuildingEra < GC.getNumEraInfos(), "Index out of bounds"); - CvAssertMsg(eBuildingEra > -1, "Index out of bounds"); + ASSERT(eBuildingEra < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(eBuildingEra > -1, "Index out of bounds"); int iBuildingEra = (int)eBuildingEra; int iMod = 0; @@ -6473,36 +6473,36 @@ std::vector CvResourceInfo::getBuildingProductionCostMo //------------------------------------------------------------------------------ int CvResourceInfo::getResourceQuantityType(int i) const { - CvAssertMsg(i < /*4*/ GD_INT_GET(NUM_RESOURCE_QUANTITY_TYPES), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < /*4*/ GD_INT_GET(NUM_RESOURCE_QUANTITY_TYPES), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityTypes ? m_piResourceQuantityTypes[i] : -1; } int CvResourceInfo::getImprovementChange(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piImprovementChange ? m_piImprovementChange[i] : -1; } //------------------------------------------------------------------------------ bool CvResourceInfo::isTerrain(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbTerrain ? m_pbTerrain[i] : false; } //------------------------------------------------------------------------------ bool CvResourceInfo::isFeature(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbFeature ? m_pbFeature[i] : false; } //------------------------------------------------------------------------------ bool CvResourceInfo::isFeatureTerrain(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbFeatureTerrain ? m_pbFeatureTerrain[i] : false; } //------------------------------------------------------------------------------ @@ -6611,7 +6611,7 @@ bool CvResourceInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility int i = 0; while(kArrayResults.Step()) { - CvAssertMsg(i < iNumQuantityTypes, "Too many resource quantities."); + ASSERT(i < iNumQuantityTypes, "Too many resource quantities."); const int quantity = kArrayResults.GetInt(0); m_piResourceQuantityTypes[i++] = quantity; } @@ -7062,66 +7062,66 @@ int CvFeatureInfo::getEffectProbability() const //------------------------------------------------------------------------------ int CvFeatureInfo::getYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChange ? m_piYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::getRiverYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piRiverYieldChange ? m_piRiverYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::getHillsYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piHillsYieldChange ? m_piHillsYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::getCoastalLandYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCoastalLandYieldChange ? m_piCoastalLandYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::getFreshWaterYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFreshWaterChange ? m_piFreshWaterChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::GetTechYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechYieldChanges[i][j]; } //------------------------------------------------------------------------------ int CvFeatureInfo::GetEraYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piEraYieldChange ? m_piEraYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvFeatureInfo::get3DAudioScriptFootstepIndex(int i) const { - // CvAssertMsg(i < ?, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + // ASSERT(i < ?, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pi3DAudioScriptFootstepIndex ? m_pi3DAudioScriptFootstepIndex[i] : -1; } //------------------------------------------------------------------------------ bool CvFeatureInfo::isTerrain(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbTerrain ? m_pbTerrain[i] : false; } @@ -7235,7 +7235,7 @@ bool CvFeatureInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& const int iNumYields = kUtility.MaxRows("Yields"); const int iNumTechs = GC.getNumTechInfos(); - CvAssertMsg(iNumTechs > 0, "Num Tech Infos <= 0"); + ASSERT(iNumTechs > 0, "Num Tech Infos <= 0"); //TechYieldChanges { @@ -7253,10 +7253,10 @@ bool CvFeatureInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int tech_idx = pResults->GetInt(1); - CvAssert(tech_idx > -1); + ASSERT(tech_idx > -1); const int yield = pResults->GetInt(2); @@ -7583,52 +7583,52 @@ const char* CvTerrainInfo::getEffectTypeTag() const //------------------------------------------------------------------------------ int CvTerrainInfo::getYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYields ? m_piYields[i] : -1; } //------------------------------------------------------------------------------ int CvTerrainInfo::getRiverYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piRiverYieldChange ? m_piRiverYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvTerrainInfo::getHillsYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piHillsYieldChange ? m_piHillsYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvTerrainInfo::getCoastalLandYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCoastalLandYieldChange ? m_piCoastalLandYieldChange[i] : -1; } //------------------------------------------------------------------------------ int CvTerrainInfo::getFreshWaterYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFreshWaterChange ? m_piFreshWaterChange[i] : -1; } //------------------------------------------------------------------------------ int CvTerrainInfo::GetTechYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTechInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTechInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechYieldChanges[i][j]; } //------------------------------------------------------------------------------ int CvTerrainInfo::get3DAudioScriptFootstepIndex(int i) const { -// CvAssertMsg(i < ?, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); +// ASSERT(i < ?, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pi3DAudioScriptFootstepIndex ? m_pi3DAudioScriptFootstepIndex[i] : -1; } //------------------------------------------------------------------------------ @@ -7691,7 +7691,7 @@ bool CvTerrainInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& const int iNumYields = kUtility.MaxRows("Yields"); const int iNumTechs = GC.getNumTechInfos(); - CvAssertMsg(iNumTechs > 0, "Num Tech Infos <= 0"); + ASSERT(iNumTechs > 0, "Num Tech Infos <= 0"); //TechYieldChanges { @@ -7709,10 +7709,10 @@ bool CvTerrainInfo::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int yield_idx = pResults->GetInt(0); - CvAssert(yield_idx > -1); + ASSERT(yield_idx > -1); const int tech_idx = pResults->GetInt(1); - CvAssert(tech_idx > -1); + ASSERT(tech_idx > -1); const int yield = pResults->GetInt(2); @@ -7999,15 +7999,15 @@ VictoryPursuitTypes CvLeaderHeadInfo::VictoryPursuitTypeFromString(const char* s //------------------------------------------------------------------------------ bool CvLeaderHeadInfo::hasTrait(int i) const { - CvAssertMsg(i < GC.getNumTraitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTraitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbTraits ? m_pbTraits[i] : false; } //------------------------------------------------------------------------------ int CvLeaderHeadInfo::getFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : 0; } //------------------------------------------------------------------------------ @@ -8582,16 +8582,16 @@ CivilizationTypes CvProcessInfo::GetRequiredCivilization() const //------------------------------------------------------------------------------ int CvProcessInfo::getProductionToYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiProductionToYieldModifier ? m_paiProductionToYieldModifier[i] : -1; } //------------------------------------------------------------------------------ int CvProcessInfo::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFlavorValue ? m_paiFlavorValue[i] : -1; } @@ -8717,8 +8717,8 @@ bool CvVoteInfo::isAssignCity() const //------------------------------------------------------------------------------ bool CvVoteInfo::isVoteSourceType(int i) const { - CvAssertMsg(i < GC.getNumVoteSourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumVoteSourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_abVoteSourceTypes ? m_abVoteSourceTypes[i] : false; } //------------------------------------------------------------------------------ @@ -9604,22 +9604,22 @@ bool CvModEventInfo::isRequiresHolyCity() const //------------------------------------------------------------------------------ int CvModEventInfo::getYieldMinimum(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piMinimumYield ? m_piMinimumYield[eYield] : -1; } //------------------------------------------------------------------------------ int CvModEventInfo::getResourceRequired(ResourceTypes eResource) const { - CvAssertMsg(eResource < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(eResource > -1, "Index out of bounds"); + ASSERT(eResource < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(eResource > -1, "Index out of bounds"); return m_piRequiredResource ? m_piRequiredResource[eResource] : -1; } //------------------------------------------------------------------------------ int CvModEventInfo::getFeatureRequired(FeatureTypes eFeature) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eFeature > -1, "Index out of bounds"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eFeature > -1, "Index out of bounds"); return m_piRequiredFeature ? m_piRequiredFeature[eFeature] : -1; } //------------------------------------------------------------------------------ @@ -9664,8 +9664,8 @@ bool CvModEventInfo::isTradeCapped() const } CvEventLinkingInfo *CvModEventInfo::GetLinkerInfo(int i) const { - CvAssertMsg(i < GetNumLinkers(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumLinkers(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paLinkerInfo[0].GetCityLinkingEvent() == -1 && m_paLinkerInfo[0].GetCityLinkingEventChoice() == -1 && m_paLinkerInfo[0].GetLinkingEvent() == -1 && m_paLinkerInfo[0].GetLinkingEventChoice() == -1) { @@ -9932,8 +9932,8 @@ CvModEventChoiceInfo::~CvModEventChoiceInfo() //------------------------------------------------------------------------------ bool CvModEventChoiceInfo::isParentEvent(EventTypes eEvent) const { - CvAssertMsg(eEvent < GC.getNumEventInfos(), "Index out of bounds"); - CvAssertMsg(eEvent > -1, "Index out of bounds"); + ASSERT(eEvent < GC.getNumEventInfos(), "Index out of bounds"); + ASSERT(eEvent > -1, "Index out of bounds"); return m_pbParentEventIDs ? m_pbParentEventIDs[eEvent] : false; } @@ -9986,35 +9986,35 @@ int CvModEventChoiceInfo::getEventBuilding() const //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavor ? m_piFlavor[i] : 0; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getEventResourceChange(ResourceTypes eResource) const { - CvAssertMsg(eResource < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(eResource > -1, "Index out of bounds"); + ASSERT(eResource < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(eResource > -1, "Index out of bounds"); return m_piResourceChange ? m_piResourceChange[eResource] : 0; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getEventYield(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piEventYield ? m_piEventYield[eYield] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getPreCheckEventYield(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piPreCheckEventYield ? m_piPreCheckEventYield[eYield] : -1; } CvEventNotificationInfo *CvModEventChoiceInfo::GetNotificationInfo(int i) const { -// CvAssertMsg(i < GC.getNumNotificationInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); +// ASSERT(i < GC.getNumNotificationInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paNotificationInfo[0].GetNotificationString().empty() || m_paNotificationInfo[0].GetNotificationString() == NULL) { @@ -10113,95 +10113,95 @@ int CvModEventChoiceInfo::getReligiousUnrestModifierGlobal() const //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getNumFreeSpecificUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeSpecificUnits ? m_piNumFreeSpecificUnits [i] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getNumFreeUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeUnits ? m_piNumFreeUnits[i] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getEventConvertReligion(int i) const { - CvAssertMsg(i < GC.getNumReligionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumReligionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piConvertReligion ? m_piConvertReligion[i] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getEventConvertReligionPercent(int i) const { - CvAssertMsg(i < GC.getNumReligionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumReligionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piConvertReligionPercent ? m_piConvertReligionPercent[i] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getCityYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityYield ? m_piCityYield[i] : -1; } /// Yield change for a specific BuildingClass by yield type int CvModEventChoiceInfo::getBuildingClassYield(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYield[i][j]; } /// Yield modifier change for a specific BuildingClass by yield type int CvModEventChoiceInfo::getBuildingClassYieldModifier(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldModifier[i][j]; } int CvModEventChoiceInfo::getTerrainYield(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTerrainYield[i][j]; } int CvModEventChoiceInfo::getFeatureYield(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiFeatureYield[i][j]; } int CvModEventChoiceInfo::getImprovementYield(int i, int j) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiImprovementYield[i][j]; } int CvModEventChoiceInfo::getResourceYield(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiResourceYield[i][j]; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getGlobalSpecialistYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiSpecialistYield[i][j]; } // Filters @@ -10248,8 +10248,8 @@ int CvModEventChoiceInfo::getObsoleteEra() const //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getYieldMinimum(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piMinimumYield ? m_piMinimumYield[eYield] : -1; } //------------------------------------------------------------------------------ @@ -10310,15 +10310,15 @@ bool CvModEventChoiceInfo::isRequiresWarMinor() const //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getResourceRequired(ResourceTypes eResource) const { - CvAssertMsg(eResource < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(eResource > -1, "Index out of bounds"); + ASSERT(eResource < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(eResource > -1, "Index out of bounds"); return m_piRequiredResource ? m_piRequiredResource[eResource] : -1; } //------------------------------------------------------------------------------ int CvModEventChoiceInfo::getFeatureRequired(FeatureTypes eFeature) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eFeature > -1, "Index out of bounds"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eFeature > -1, "Index out of bounds"); return m_piRequiredFeature ? m_piRequiredFeature[eFeature] : -1; } @@ -10404,8 +10404,8 @@ const char* CvModEventChoiceInfo::getDisabledTooltip() const } CvEventChoiceLinkingInfo *CvModEventChoiceInfo::GetLinkerInfo(int i) const { - CvAssertMsg(i < GetNumLinkers(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumLinkers(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paLinkerInfo[0].GetCityLinkingEvent() == -1 && m_paLinkerInfo[0].GetCityLinkingEventChoice() == -1 && m_paLinkerInfo[0].GetLinkingEvent() == -1 && m_paLinkerInfo[0].GetLinkingEventChoice() == -1) { @@ -10918,8 +10918,8 @@ int CvModCityEventInfo::getObsoleteEra() const //------------------------------------------------------------------------------ int CvModCityEventInfo::getYieldMinimum(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piMinimumYield ? m_piMinimumYield[eYield] : -1; } //------------------------------------------------------------------------------ @@ -11173,8 +11173,8 @@ bool CvModCityEventInfo::IsCounterSpy() const } CvCityEventLinkingInfo *CvModCityEventInfo::GetLinkerInfo(int i) const { - CvAssertMsg(i < GetNumLinkers(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumLinkers(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paCityLinkerInfo[0].GetCityLinkingEvent() == -1 && m_paCityLinkerInfo[0].GetCityLinkingEventChoice() == -1 && m_paCityLinkerInfo[0].GetLinkingEvent() == -1 && m_paCityLinkerInfo[0].GetLinkingEventChoice() == -1) { @@ -11513,8 +11513,8 @@ CvModEventCityChoiceInfo::~CvModEventCityChoiceInfo() //------------------------------------------------------------------------------ bool CvModEventCityChoiceInfo::isParentEvent(CityEventTypes eCityEvent) const { - CvAssertMsg(eCityEvent < GC.getNumCityEventInfos(), "Index out of bounds"); - CvAssertMsg(eCityEvent > -1, "Index out of bounds"); + ASSERT(eCityEvent < GC.getNumCityEventInfos(), "Index out of bounds"); + ASSERT(eCityEvent > -1, "Index out of bounds"); return m_pbParentEventIDs ? m_pbParentEventIDs[eCityEvent] : false; } //------------------------------------------------------------------------------ @@ -11641,22 +11641,22 @@ int CvModEventCityChoiceInfo::getEventBuildingDestruction() const //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getEventYield(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piEventYield ? m_piEventYield[eYield] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getPreCheckEventYield(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piPreCheckEventYield ? m_piPreCheckEventYield[eYield] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavor ? m_piFlavor[i] : 0; } //------------------------------------------------------------------------------ @@ -11742,50 +11742,50 @@ int CvModEventCityChoiceInfo::getEventPromotion() const //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getNumFreeUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeUnits ? m_piNumFreeUnits[i] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getNumFreeSpecificUnits(int i) const { - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piNumFreeSpecificUnits ? m_piNumFreeSpecificUnits[i] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getEventConvertReligion(int i) const { - CvAssertMsg(i < GC.getNumReligionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumReligionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piConvertReligion ? m_piConvertReligion[i] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getEventConvertReligionPercent(int i) const { - CvAssertMsg(i < GC.getNumReligionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumReligionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piConvertReligionPercent ? m_piConvertReligionPercent[i] : -1; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getEventGPChange(SpecialistTypes eSpecialist) const { - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(eSpecialist > -1, "Index out of bounds"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(eSpecialist > -1, "Index out of bounds"); return m_piGPChange ? m_piGPChange[eSpecialist] : 0; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getImprovementDestruction(ImprovementTypes eImprovement) const { - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eImprovement > -1, "Index out of bounds"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eImprovement > -1, "Index out of bounds"); return m_piDestroyImprovement ? m_piDestroyImprovement[eImprovement] : 0; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getBuildingDestructionChance(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piBuildingDestructionChance ? m_piBuildingDestructionChance[i] : -1; } //------------------------------------------------------------------------------ @@ -11826,8 +11826,8 @@ int CvModEventCityChoiceInfo::getBlockBuildingTurns() const CvCityEventNotificationInfo *CvModEventCityChoiceInfo::GetNotificationInfo(int i) const { -// CvAssertMsg(i < GC.getNumNotificationInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); +// ASSERT(i < GC.getNumNotificationInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paCityNotificationInfo[0].GetNotificationString().empty() || m_paCityNotificationInfo[0].GetNotificationString() == NULL) { @@ -11841,8 +11841,8 @@ CvCityEventNotificationInfo *CvModEventCityChoiceInfo::GetNotificationInfo(int i CvCityEventChoiceLinkingInfo *CvModEventCityChoiceInfo::GetLinkerInfo(int i) const { - CvAssertMsg(i < GetNumLinkers(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumLinkers(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (m_paCityLinkerInfo[0].GetCityLinkingEvent() == -1 && m_paCityLinkerInfo[0].GetCityLinkingEventChoice() == -1 && m_paCityLinkerInfo[0].GetLinkingEvent() == -1 && m_paCityLinkerInfo[0].GetLinkingEventChoice() == -1) { @@ -11856,102 +11856,102 @@ CvCityEventChoiceLinkingInfo *CvModEventCityChoiceInfo::GetLinkerInfo(int i) con //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getCityYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityYield ? m_piCityYield[i] : -1; } int CvModEventCityChoiceInfo::getCityYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityYieldModifier ? m_piCityYieldModifier[i] : -1; } int CvModEventCityChoiceInfo::getYieldSiphon(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldSiphon ? m_piYieldSiphon[i] : -1; } int CvModEventCityChoiceInfo::getYieldOnSpyIdentified(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldOnSpyIdentified ? m_piYieldOnSpyIdentified[i] : -1; } int CvModEventCityChoiceInfo::getYieldOnSpyKilled(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldOnSpyKilled ? m_piYieldOnSpyKilled[i] : -1; } /// Yield change for a specific BuildingClass by yield type int CvModEventCityChoiceInfo::getBuildingClassYield(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYield[i][j]; } /// Yield modifier change for a specific BuildingClass by yield type int CvModEventCityChoiceInfo::getBuildingClassYieldModifier(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldModifier[i][j]; } int CvModEventCityChoiceInfo::getTerrainYield(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTerrainYield[i][j]; } int CvModEventCityChoiceInfo::getFeatureYield(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiFeatureYield[i][j]; } int CvModEventCityChoiceInfo::getImprovementYield(int i, int j) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiImprovementYield[i][j]; } int CvModEventCityChoiceInfo::getResourceYield(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiResourceYield[i][j]; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getCitySpecialistYieldChange(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiSpecialistYield[i][j]; } //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getEventResourceChange(ResourceTypes eResource) const { - CvAssertMsg(eResource < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(eResource > -1, "Index out of bounds"); + ASSERT(eResource < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(eResource > -1, "Index out of bounds"); return m_piResourceChange ? m_piResourceChange[eResource] : 0; } // Filters @@ -11988,8 +11988,8 @@ int CvModEventCityChoiceInfo::getObsoleteEra() const //------------------------------------------------------------------------------ int CvModEventCityChoiceInfo::getYieldMinimum(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); return m_piMinimumYield ? m_piMinimumYield[eYield] : -1; } //------------------------------------------------------------------------------ @@ -12725,7 +12725,7 @@ void FeatureArrayHelpers::Read(FDataStream& kStream, int* paiFeatureArray) CvString szError; szError.Format("LOAD ERROR: Feature Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; @@ -12781,7 +12781,7 @@ void FeatureArrayHelpers::ReadYieldArray(FDataStream& kStream, int** ppaaiFeatur CvString szError; szError.Format("LOAD ERROR: Feature Type not found: %08x", iHash); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); for(int jJ = 0; jJ < iNumYields; jJ++) { @@ -12842,7 +12842,7 @@ void TerrainArrayHelpers::Read(FDataStream& kStream, int* paiTerrainArray) CvString szError; szError.Format("LOAD ERROR: Terrain Type not found"); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); int iDummy = 0; kStream >> iDummy; @@ -12898,7 +12898,7 @@ void TerrainArrayHelpers::ReadYieldArray(FDataStream& kStream, int** ppaaiTerrai CvString szError; szError.Format("LOAD ERROR: Terrain Type not found: %08x", iHash); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); for(int jJ = 0; jJ < iNumYields; jJ++) { diff --git a/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.cpp b/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.cpp index 782fdb3cbb..4d167525b9 100644 --- a/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.cpp +++ b/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.cpp @@ -153,7 +153,7 @@ int Read(FDataStream& kStream, bool* bValid /*= NULL*/) CvString szError; szError.Format("LOAD ERROR: Type not found: %s", sTemp.c_str()); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } @@ -178,7 +178,7 @@ int ReadHashed(FDataStream& kStream, bool* bValid /*= NULL*/) CvString szError; szError.Format("LOAD ERROR: Type not found for hash: %u", uiHash); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); if(bValid) *bValid = false; } } diff --git a/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.h b/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.h index 65e3c06605..e799290ee1 100644 --- a/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.h +++ b/CvGameCoreDLL_Expansion2/CvInfosSerializationHelper.h @@ -37,7 +37,7 @@ void ReadV0DataArray(FDataStream& kStream, TData* paArray, int iArraySize, const CvString szError; szError.Format("LOAD ERROR: Type not found: %s", ppszV0Tags[iI]); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } } @@ -66,7 +66,7 @@ void ReadV0DataArray(FDataStream& kStream, std::vector& aiArray, uint uiM CvString szError; szError.Format("LOAD ERROR: Type not found: %s", ppszV0Tags[iI]); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } } @@ -95,7 +95,7 @@ void ReadV0DataArray(FDataStream& kStream, TData** ppaArray, int iSubArraySize, CvString szError; szError.Format("LOAD ERROR: Type mapping outside the supplied array bounds: %s", ppszV0Tags[iI]); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); // Burn through the data so we can continue on a type outside the bounds for(int iJ = 0; iJ < iSubArraySize; ++iJ) @@ -107,7 +107,7 @@ void ReadV0DataArray(FDataStream& kStream, TData** ppaArray, int iSubArraySize, CvString szError; szError.Format("LOAD ERROR: Type not found: %s", ppszV0Tags[iI]); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); for(int iJ = 0; iJ < iSubArraySize; ++iJ) kStream >> tValue; @@ -146,7 +146,7 @@ void ReadV0TypeArray(FDataStream& kStream, std::vector& aiArray, uint uiM CvString szError; szError.Format("LOAD ERROR: Type not found: %d", eType); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } else @@ -181,7 +181,7 @@ void ReadV0TypeArray(FDataStream& kStream, TType* paArray, uint uiSize, const ch CvString szError; szError.Format("LOAD ERROR: Type not found: %d", eType); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } else @@ -206,7 +206,7 @@ TType ConvertV0(TType eType, const char** ppszV0Tags, uint uiV0TagCount) CvString szError; szError.Format("LOAD ERROR: Type not found: %d", (int)eType); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); } } @@ -298,7 +298,7 @@ void ReadDataArray(FDataStream& kStream, TData** ppaArray, int iSubArraySize, in CvString szError; szError.Format("LOAD ERROR: Type mapping outside the supplied array bounds: %d", iType); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); bValid = false; } @@ -341,7 +341,7 @@ void ReadHashedDataArray(FDataStream& kStream, TData** ppaArray, int iSubArraySi CvString szError; szError.Format("LOAD ERROR: Type mapping outside the supplied array bounds: %d", iType); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); bValid = false; } } diff --git a/CvGameCoreDLL_Expansion2/CvLoggerCSV.cpp b/CvGameCoreDLL_Expansion2/CvLoggerCSV.cpp index fd5c4dae05..6991418c2e 100644 --- a/CvGameCoreDLL_Expansion2/CvLoggerCSV.cpp +++ b/CvGameCoreDLL_Expansion2/CvLoggerCSV.cpp @@ -15,7 +15,7 @@ void CvLoggerCSV::WriteCSVLog(const char* strLogName, const char* strHeader) pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp); - CvAssert(pLog != NULL); + ASSERT(pLog != NULL); pLog->Msg(strHeader); @@ -23,13 +23,13 @@ void CvLoggerCSV::WriteCSVLog(const char* strLogName, const char* strHeader) void CvLoggerCSV::DeleteCSV(const char* strLogName) { - CvAssert(strLogName != NULL); + ASSERT(strLogName != NULL); FILogFile *pLog = NULL; pLog = LOGFILEMGR.GetLog(strLogName, FILogFile::kDontTimeStamp); - CvAssert(pLog != NULL); + ASSERT(pLog != NULL); LOGFILEMGR.DeleteLog(pLog); diff --git a/CvGameCoreDLL_Expansion2/CvMap.cpp b/CvGameCoreDLL_Expansion2/CvMap.cpp index b977196096..ca0e4a7b77 100644 --- a/CvGameCoreDLL_Expansion2/CvMap.cpp +++ b/CvGameCoreDLL_Expansion2/CvMap.cpp @@ -90,7 +90,7 @@ void CvLandmass::changeNumTiles(int iChange) bool bOldLake = isLake(); m_iNumTiles = (m_iNumTiles + iChange); - CvAssert(m_iNumTiles >= 0); + ASSERT(m_iNumTiles >= 0); if(bOldLake != isLake()) { @@ -433,7 +433,7 @@ CvMap::CvMap() , m_vPlotsShared() , m_plotPopupCount() { - CvAssert(sgCvMapInstanceCount == 0); + ASSERT(sgCvMapInstanceCount == 0); ++sgCvMapInstanceCount; memset(m_apShuffledNeighbors,0,sizeof(CvPlot*)*6); @@ -747,7 +747,7 @@ void CvMap::reset(CvMapInitData* pInitInfo) m_bWrapY = pInitInfo->m_bWrapY; } - CvAssertMsg((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvMap::reset"); + ASSERT((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvMap::reset"); m_paiNumResource.init(0); m_paiNumResourceOnLand.init(0); @@ -975,7 +975,7 @@ CvPlot* CvMap::syncRandPlot(int iFlags, int iArea, int iMinUnitDistance, int iTi iCount++; pTestPlot = plotCheckInvalid(GC.getGame().getJonRandNum(getGridWidth(), "Rand Plot Width"), GC.getGame().getJonRandNum(getGridHeight(), "Rand Plot Height")); - CvAssertMsg(pTestPlot != NULL, "TestPlot is not assigned a valid value"); + ASSERT(pTestPlot != NULL, "TestPlot is not assigned a valid value"); if(!pTestPlot) continue; @@ -1098,7 +1098,7 @@ CvCity* CvMap::findCity(int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, boo { CvPlot* pCheckPlot = plot(iX, iY); - CvAssertMsg(pCheckPlot != NULL, "Passed in an invalid plot to findCity"); + ASSERT(pCheckPlot != NULL, "Passed in an invalid plot to findCity"); if (pCheckPlot == NULL) return NULL; @@ -1355,7 +1355,7 @@ int CvMap::getLandPlots() void CvMap::changeLandPlots(int iChange) { m_iLandPlots = (m_iLandPlots + iChange); - CvAssert(getLandPlots() >= 0); + ASSERT(getLandPlots() >= 0); } @@ -1370,7 +1370,7 @@ int CvMap::getOwnedPlots() void CvMap::changeOwnedPlots(int iChange) { m_iOwnedPlots = (m_iOwnedPlots + iChange); - CvAssert(getOwnedPlots() >= 0); + ASSERT(getOwnedPlots() >= 0); } @@ -1443,7 +1443,7 @@ int CvMap::getRandomResourceQuantity(ResourceTypes eIndex) iNumRands++; } - CvAssertMsg(iNumRands > 0, "Resource should have at least 1 Quantity type to choose from") + ASSERT(iNumRands > 0, "Resource should have at least 1 Quantity type to choose from") int iRand = GC.getGame().getJonRandNum(iNumRands, "Picking from random Resource Quantity types"); @@ -1453,24 +1453,24 @@ int CvMap::getRandomResourceQuantity(ResourceTypes eIndex) // -------------------------------------------------------------------------------- int CvMap::getNumResources(ResourceTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiNumResource[eIndex]; } // -------------------------------------------------------------------------------- void CvMap::changeNumResources(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiNumResource[eIndex] = (m_paiNumResource[eIndex] + iChange); - CvAssert(getNumResources(eIndex) >= 0); + ASSERT(getNumResources(eIndex) >= 0); } #if defined(MOD_BALANCE_CORE_RESOURCE_MONOPOLIES) // -------------------------------------------------------------------------------- void CvMap::setNumResources(ResourceTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); const CvResourceInfo* pkResourceInfo = GC.getResourceInfo(eIndex); int iResourceQuantity = 0; if(pkResourceInfo != NULL && pkResourceInfo->getResourceUsage() == RESOURCEUSAGE_STRATEGIC) @@ -1495,8 +1495,8 @@ void CvMap::setNumResources(ResourceTypes eIndex) // -------------------------------------------------------------------------------- int CvMap::getNumResourcesOnLand(ResourceTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiNumResourceOnLand[eIndex]; } @@ -1504,10 +1504,10 @@ int CvMap::getNumResourcesOnLand(ResourceTypes eIndex) // -------------------------------------------------------------------------------- void CvMap::changeNumResourcesOnLand(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiNumResourceOnLand[eIndex] = (m_paiNumResourceOnLand[eIndex] + iChange); - CvAssert(getNumResourcesOnLand(eIndex) >= 0); + ASSERT(getNumResourcesOnLand(eIndex) >= 0); } // -------------------------------------------------------------------------------- @@ -1628,7 +1628,7 @@ void CvMap::Serialize(Map& map, Visitor& visitor) visitor(map.m_bWrapY); visitor(map.m_guid); - CvAssertMsg((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated"); + ASSERT((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated"); visitor(map.m_paiNumResource); visitor(map.m_paiNumResourceOnLand); @@ -2608,7 +2608,9 @@ void CvMap::CreateRiverFrom(CvPlot* pPlot, DirectionTypes eDirection, CvRiver* p if (pPlot->GetRiverID(eDirection) != -1) { if (pPlot->GetRiverID(eDirection) != iRiverID) + { UNREACHABLE(); + } else return; } diff --git a/CvGameCoreDLL_Expansion2/CvMapGenerator.cpp b/CvGameCoreDLL_Expansion2/CvMapGenerator.cpp index 07292ab52c..d6075617ba 100644 --- a/CvGameCoreDLL_Expansion2/CvMapGenerator.cpp +++ b/CvGameCoreDLL_Expansion2/CvMapGenerator.cpp @@ -36,7 +36,7 @@ CvMapGenerator::CvMapGenerator(const char* szMapScriptName) m_pkLuaState = pkScriptSystem->CreateLuaThread("Map Script"); const bool bLoaded = pkScriptSystem->LoadFile(m_pkLuaState, szMapScriptName); DEBUG_VARIABLE(bLoaded); - CvAssertMsg(bLoaded, "Cannot load mapscript."); + ASSERT(bLoaded, "Cannot load mapscript."); } //------------------------------------------------------------------------------ CvMapGenerator::~CvMapGenerator() @@ -61,7 +61,7 @@ bool CvMapGenerator::GetMapInitData(CvMapInitData& kData, WorldSizeTypes eWorldS } else { - CvAssertMsg(false, "Could not find world size entry.") + ASSERT(false, "Could not find world size entry.") } ICvEngineScriptSystem1* pkScriptSystem = gDLL->GetScriptSystem(); diff --git a/CvGameCoreDLL_Expansion2/CvMilitaryAI.cpp b/CvGameCoreDLL_Expansion2/CvMilitaryAI.cpp index 571d1f2562..2eda285971 100644 --- a/CvGameCoreDLL_Expansion2/CvMilitaryAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvMilitaryAI.cpp @@ -112,16 +112,16 @@ bool CvMilitaryAIStrategyXMLEntry::CacheResults(Database::Results& kResults, CvD /// What player flavors will be added by adopting this Strategy? int CvMilitaryAIStrategyXMLEntry::GetPlayerFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPlayerFlavorValue ? m_piPlayerFlavorValue[i] : -1; } /// What city flavors will be added by adopting this Strategy? int CvMilitaryAIStrategyXMLEntry::GetCityFlavorValue(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityFlavorValue ? m_piCityFlavorValue[i] : -1; } @@ -134,8 +134,8 @@ int CvMilitaryAIStrategyXMLEntry::GetWeightThreshold() const /// How do a player's Personality Flavors affect the Threshold for adopting a Strategy? (if applicable) int CvMilitaryAIStrategyXMLEntry::GetPersonalityFlavorThresholdMod(int i) const { - FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - FAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPersonalityFlavorThresholdMod ? m_piPersonalityFlavorThresholdMod[i] : -1; } @@ -275,10 +275,10 @@ void CvMilitaryAI::Init(CvMilitaryAIStrategyXMLEntries* pAIStrategies, CvPlayer* m_pDiplomacyAI = pDiplomacyAI; // Initialize arrays - CvAssertMsg(m_pabUsingStrategy==NULL, "about to leak memory, CvMilitaryAI::m_pabUsingStrategy"); + ASSERT(m_pabUsingStrategy==NULL, "about to leak memory, CvMilitaryAI::m_pabUsingStrategy"); m_pabUsingStrategy = FNEW(bool[m_pAIStrategies->GetNumMilitaryAIStrategies()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiTurnStrategyAdopted==NULL, "about to leak memory, CvMilitaryAI::m_paiTurnStrategyAdopted"); + ASSERT(m_paiTurnStrategyAdopted==NULL, "about to leak memory, CvMilitaryAI::m_paiTurnStrategyAdopted"); m_paiTurnStrategyAdopted = FNEW(int[m_pAIStrategies->GetNumMilitaryAIStrategies()], c_eCiv5GameplayDLL, 0); m_aiTempFlavors.init(); @@ -348,7 +348,7 @@ void CvMilitaryAI::Reset() template void CvMilitaryAI::Serialize(MilitaryAI& militaryAI, Visitor& visitor) { - CvAssertMsg(militaryAI.m_pAIStrategies != NULL && militaryAI.m_pAIStrategies->GetNumMilitaryAIStrategies() > 0, "Number of AIStrategies to serialize is expected to greater than 0"); + ASSERT(militaryAI.m_pAIStrategies != NULL && militaryAI.m_pAIStrategies->GetNumMilitaryAIStrategies() > 0, "Number of AIStrategies to serialize is expected to greater than 0"); visitor(militaryAI.m_iNumberOfTimesOpsBuildSkippedOver); visitor(militaryAI.m_iNumberOfTimesSettlerBuildSkippedOver); @@ -594,7 +594,7 @@ bool CvMilitaryAI::BuyEmergencyBuilding(CvCity* pCity) int iResult = pCity->CreateBuilding(eBldg); DEBUG_VARIABLE(iResult); - CvAssertMsg(iResult != -1, "Unable to create building"); + ASSERT(iResult != -1, "Unable to create building"); CvString szMsg; szMsg.Format("Emergency Building Purchased: %s, ", pkBuildingInfo->GetDescription()); @@ -3503,7 +3503,7 @@ int MilitaryAIHelpers::GetWeightThresholdModifier(MilitaryAIStrategyTypes eStrat FlavorTypes eFlavor = (FlavorTypes) iFlavorLoop; int iPersonalityFlavor = pkFlavorManager->GetPersonalityIndividualFlavor(eFlavor); CvMilitaryAIStrategyXMLEntry* pkEntry = pkAIStrategies->GetEntry(eStrategy); - CvAssert(pkEntry != NULL); + ASSERT(pkEntry != NULL); if(pkEntry) { int iStrategyFlavorMod = pkEntry->GetPersonalityFlavorThresholdMod(eFlavor); @@ -3637,7 +3637,7 @@ bool MilitaryAIHelpers::IsTestStrategy_WarMobilization(MilitaryAIStrategyTypes e } CvMilitaryAIStrategyXMLEntry* pStrategy = pPlayer->GetMilitaryAI()->GetMilitaryAIStrategies()->GetEntry(eStrategy); - CvAssert(pStrategy != NULL); + ASSERT(pStrategy != NULL); if(pStrategy) { int iWeightThreshold = pStrategy->GetWeightThreshold(); // 100 @@ -3699,7 +3699,7 @@ bool MilitaryAIHelpers::IsTestStrategy_EradicateBarbarians(MilitaryAIStrategyTyp } CvMilitaryAIStrategyXMLEntry* pStrategy = pPlayer->GetMilitaryAI()->GetMilitaryAIStrategies()->GetEntry(eStrategy); - CvAssert(pStrategy != NULL); + ASSERT(pStrategy != NULL); if(pStrategy) { int iStrategyWeight = iBarbarianCampCount * 75 + iVisibleBarbarianCount * 25; // Two visible camps or 3 roving Barbarians will trigger this @@ -3743,7 +3743,7 @@ bool MilitaryAIHelpers::IsTestStrategy_EradicateBarbariansCritical(MilitaryAIStr int iStrategyWeight = 0; CvMilitaryAIStrategyXMLEntry* pStrategy = pPlayer->GetMilitaryAI()->GetMilitaryAIStrategies()->GetEntry(eStrategy); - CvAssert(pStrategy != NULL); + ASSERT(pStrategy != NULL); if(pStrategy) { iStrategyWeight = iBarbarianCampCount * 75 + iVisibleBarbarianCount * 25; diff --git a/CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp b/CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp index 2039fbf355..57dd26fc84 100644 --- a/CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvMinorCivAI.cpp @@ -4018,8 +4018,8 @@ int CvMinorCivIncomingUnitGift::getGameTurnCreated() const /// bool CvMinorCivIncomingUnitGift::isHasPromotion(PromotionTypes ePromotion) const { - CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); + ASSERT(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); return m_HasPromotions.GetBit(static_cast(ePromotion)); } @@ -4097,7 +4097,7 @@ void CvMinorCivIncomingUnitGift::setArrivalCountdown(int iNewCountdown) /// void CvMinorCivIncomingUnitGift::changeArrivalCountdown(int iChangeCountdown) { - CvAssert(m_iArrivalCountdown != -1); + ASSERT(m_iArrivalCountdown != -1); m_iArrivalCountdown = std::max(0, m_iArrivalCountdown + iChangeCountdown); } @@ -4135,8 +4135,8 @@ void CvMinorCivIncomingUnitGift::setGameTurnCreated(int iNewValue) /// void CvMinorCivIncomingUnitGift::setHasPromotion(PromotionTypes ePromotion, bool bNewValue) { - CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); + ASSERT(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); if (ePromotion >= 0 && ePromotion < GC.getNumPromotionInfos()) { @@ -4223,7 +4223,7 @@ void CvMinorCivIncomingUnitGift::applyToUnit(PlayerTypes eFromPlayer, CvUnit& de const PromotionTypes ePromotion = static_cast(i); if (isHasPromotion(ePromotion)) { - CvAssert(CvUnit::IsRetainablePromotion(ePromotion)); + ASSERT(CvUnit::IsRetainablePromotion(ePromotion)); destUnit.setHasPromotion(ePromotion, true); destUnit.SetPromotionDuration(ePromotion, getPromotionDuration(ePromotion)); destUnit.SetTurnPromotionGained(ePromotion, getTurnPromotionGained(ePromotion)); @@ -4686,9 +4686,9 @@ UnitTypes CvMinorCivAI::GetUniqueUnit() const /// Override picked unique unit (only for Militaristic) void CvMinorCivAI::SetUniqueUnit(UnitTypes eUnit) { - CvAssertMsg(GetTrait() == MINOR_CIV_TRAIT_MILITARISTIC, "Setting a unique unit for a non-Militaristic City-State. It will never be spawned without additional scripting."); + ASSERT(GetTrait() == MINOR_CIV_TRAIT_MILITARISTIC, "Setting a unique unit for a non-Militaristic City-State. It will never be spawned without additional scripting."); CvUnitEntry* pInfo = GC.getUnitInfo(eUnit); - CvAssertMsg(pInfo, "Setting a unique unit for a City-State that the game core could not identify. Please send Anton your save file and version."); + ASSERT(pInfo, "Setting a unique unit for a City-State that the game core could not identify."); if (pInfo) { m_eUniqueUnit = eUnit; @@ -4909,7 +4909,7 @@ void CvMinorCivAI::DoChangeAliveStatus(bool bAlive) } if(GetAlly() == ePlayer) { - CvAssertMsg(bAlive, "A Minor about to die still has an Ally, when it should have none."); + ASSERT(bAlive, "A Minor about to die still has an Ally, when it should have none."); bAllies = true; } if(bFriends || bAllies) @@ -4923,7 +4923,7 @@ void CvMinorCivAI::DoChangeAliveStatus(bool bAlive) if (!bAlive) { bool bHasAlly = GetAlly() != NO_PLAYER; - CvAssertMsg(!bHasAlly, "A Minor about to die still has an Ally, when it should have none."); + ASSERT(!bHasAlly, "A Minor about to die still has an Ally, when it should have none."); if(bHasAlly) { SetAlly(NO_PLAYER,true); @@ -5570,7 +5570,7 @@ MinorCivStatusTypes CvMinorCivAI::GetStatus() const /// We have a new city! Add any special starting resources we get. void CvMinorCivAI::DoAddStartingResources(CvPlot* pCityPlot) { - CvAssertMsg(pCityPlot != NULL, "City's plot should not be NULL. Please send Anton your save file and version."); + ASSERT(pCityPlot != NULL, "City's plot should not be NULL."); if (pCityPlot == NULL) return; MinorCivTraitTypes eTrait = GetTrait(); @@ -9100,8 +9100,8 @@ int CvMinorCivAI::GetNumActiveQuestsForAllPlayers() const int CvMinorCivAI::GetNumActiveQuestsForPlayer(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; return m_QuestsGiven[ePlayer].size(); @@ -9109,8 +9109,8 @@ int CvMinorCivAI::GetNumActiveQuestsForPlayer(PlayerTypes ePlayer) const int CvMinorCivAI::GetNumActivePersonalQuestsForPlayer(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; int iCount = 0; @@ -9127,12 +9127,12 @@ int CvMinorCivAI::GetNumActivePersonalQuestsForPlayer(PlayerTypes ePlayer) const bool CvMinorCivAI::IsActiveQuestForPlayer(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; - CvAssertMsg(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); - CvAssertMsg(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); + ASSERT(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); + ASSERT(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); if(eType < NO_MINOR_CIV_QUEST_TYPE || eType >= NUM_MINOR_CIV_QUEST_TYPES) return false; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9149,8 +9149,8 @@ bool CvMinorCivAI::IsActiveQuestForPlayer(PlayerTypes ePlayer, MinorCivQuestType /// Get rid of all active quests void CvMinorCivAI::EndAllActiveQuestsForPlayer(PlayerTypes ePlayer, bool bWar) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; //antonjs: todo: instead, call for cancel quest (with flag for no notif) @@ -9159,12 +9159,12 @@ void CvMinorCivAI::EndAllActiveQuestsForPlayer(PlayerTypes ePlayer, bool bWar) #if defined(MOD_BALANCE_CORE) void CvMinorCivAI::DeleteQuest(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; - CvAssertMsg(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); - CvAssertMsg(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); + ASSERT(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); + ASSERT(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); if(eType < NO_MINOR_CIV_QUEST_TYPE || eType >= NUM_MINOR_CIV_QUEST_TYPES) return; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9179,8 +9179,8 @@ void CvMinorCivAI::DeleteQuest(PlayerTypes ePlayer, MinorCivQuestTypes eType) int CvMinorCivAI::GetNumDisplayedQuestsForPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; int iValue = 0; @@ -9198,12 +9198,12 @@ int CvMinorCivAI::GetNumDisplayedQuestsForPlayer(PlayerTypes ePlayer) bool CvMinorCivAI::IsDisplayedQuestForPlayer(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; - CvAssertMsg(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); - CvAssertMsg(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); + ASSERT(eType >= NO_MINOR_CIV_QUEST_TYPE, "eType is expected to be non-negative (invalid Index)"); + ASSERT(eType < NUM_MINOR_CIV_QUEST_TYPES, "eType is expected to be within maximum bounds (invalid Index)"); if(eType < NO_MINOR_CIV_QUEST_TYPE || eType >= NUM_MINOR_CIV_QUEST_TYPES) return false; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9327,8 +9327,8 @@ void CvMinorCivAI::DoTestSeedQuestCountdownForPlayer(PlayerTypes ePlayer, bool b /// How many turns since the last Quest ended? int CvMinorCivAI::GetQuestCountdownForPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; // as set during Reset() return m_aiQuestCountdown[ePlayer]; @@ -9337,8 +9337,8 @@ int CvMinorCivAI::GetQuestCountdownForPlayer(PlayerTypes ePlayer) /// Sets How many turns since the last Quest ended void CvMinorCivAI::SetQuestCountdownForPlayer(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_aiQuestCountdown[ePlayer] = iValue; @@ -9401,8 +9401,8 @@ bool CvMinorCivAI::AddQuestIfAble(PlayerTypes eMajor, MinorCivQuestTypes eQuest) /// What is Data member 1 int CvMinorCivAI::GetQuestData1(PlayerTypes ePlayer, MinorCivQuestTypes eType) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return CvMinorCivQuest::NO_QUEST_DATA; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9419,8 +9419,8 @@ int CvMinorCivAI::GetQuestData1(PlayerTypes ePlayer, MinorCivQuestTypes eType) c /// What is Data member 2 int CvMinorCivAI::GetQuestData2(PlayerTypes ePlayer, MinorCivQuestTypes eType) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return CvMinorCivQuest::NO_QUEST_DATA; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9437,8 +9437,8 @@ int CvMinorCivAI::GetQuestData2(PlayerTypes ePlayer, MinorCivQuestTypes eType) c /// What is Data member 3 int CvMinorCivAI::GetQuestData3(PlayerTypes ePlayer, MinorCivQuestTypes eType) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return CvMinorCivQuest::NO_QUEST_DATA; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9454,8 +9454,8 @@ int CvMinorCivAI::GetQuestData3(PlayerTypes ePlayer, MinorCivQuestTypes eType) c int CvMinorCivAI::GetQuestTurnsRemaining(PlayerTypes ePlayer, MinorCivQuestTypes eType, int iGameTurn) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return CvMinorCivQuest::NO_TURN; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9471,8 +9471,8 @@ int CvMinorCivAI::GetQuestTurnsRemaining(PlayerTypes ePlayer, MinorCivQuestTypes CvString CvMinorCivAI::GetRewardString(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return ""; for(uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9512,8 +9512,8 @@ CvString CvMinorCivAI::GetTargetCityString(PlayerTypes ePlayer, MinorCivQuestTyp bool CvMinorCivAI::IsContestLeader(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; for (uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9547,8 +9547,8 @@ int CvMinorCivAI::GetContestValueForLeader(MinorCivQuestTypes eType) int CvMinorCivAI::GetContestValueForPlayer(PlayerTypes ePlayer, MinorCivQuestTypes eType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; for (uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++) @@ -9565,8 +9565,8 @@ int CvMinorCivAI::GetContestValueForPlayer(PlayerTypes ePlayer, MinorCivQuestTyp /// Has a Route been established? bool CvMinorCivAI::IsRouteConnectionEstablished(PlayerTypes eMajor) const { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return false; return m_abRouteConnectionEstablished[eMajor]; @@ -9575,8 +9575,8 @@ bool CvMinorCivAI::IsRouteConnectionEstablished(PlayerTypes eMajor) const /// Sets that a Route was established void CvMinorCivAI::SetRouteConnectionEstablished(PlayerTypes eMajor, bool bValue) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return; if(m_abRouteConnectionEstablished[eMajor] != bValue) @@ -11121,14 +11121,14 @@ bool CvMinorCivAI::IsUnitValidGiftForCityStateQuest(PlayerTypes ePlayer, CvUnit* bool CvMinorCivAI::GetHasSentUnitForQuest(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); return m_abSentUnitForQuest[ePlayer]; } void CvMinorCivAI::SetHasSentUnitForQuest(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if (GetHasSentUnitForQuest(ePlayer) != bValue) { m_abSentUnitForQuest[ePlayer] = bValue; @@ -11136,8 +11136,8 @@ void CvMinorCivAI::SetHasSentUnitForQuest(PlayerTypes ePlayer, bool bValue) } void CvMinorCivAI::SetCoupAttempted(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(IsCoupAttempted(ePlayer) != bValue) { m_abCoupAttempted[ePlayer] = bValue; @@ -11145,15 +11145,15 @@ void CvMinorCivAI::SetCoupAttempted(PlayerTypes ePlayer, bool bValue) } bool CvMinorCivAI::IsCoupAttempted(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= REALLY_MAX_PLAYERS) return false; // as defined in Reset() return m_abCoupAttempted[ePlayer]; } void CvMinorCivAI::SetTargetedAreaID(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(iValue != m_aiAssignedPlotAreaID[ePlayer]) { m_aiAssignedPlotAreaID[ePlayer] = iValue; @@ -11161,15 +11161,15 @@ void CvMinorCivAI::SetTargetedAreaID(PlayerTypes ePlayer, int iValue) } int CvMinorCivAI::GetTargetedAreaID(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= REALLY_MAX_PLAYERS) return -1; // as defined in Reset() return m_aiAssignedPlotAreaID[ePlayer]; } void CvMinorCivAI::SetNumTurnsSincePtPWarning(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(iValue != m_aiTurnsSincePtPWarning[ePlayer]) { m_aiTurnsSincePtPWarning[ePlayer] = iValue; @@ -11177,15 +11177,15 @@ void CvMinorCivAI::SetNumTurnsSincePtPWarning(PlayerTypes ePlayer, int iValue) } int CvMinorCivAI::GetNumTurnsSincePtPWarning(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= REALLY_MAX_PLAYERS) return -1; // as defined in Reset() return m_aiTurnsSincePtPWarning[ePlayer]; } void CvMinorCivAI::ChangeNumTurnsSincePtPWarning(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eForPlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "eForPlayer is expected to be within maximum bounds (invalid Index)"); if(iValue != 0) { @@ -11289,8 +11289,8 @@ CvCity* CvMinorCivAI::GetBestSpyTarget(PlayerTypes ePlayer, bool bMinor) int CvMinorCivAI::GetExplorePercent(PlayerTypes ePlayer, MinorCivQuestTypes eQuest) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam(); @@ -11954,8 +11954,8 @@ int CvMinorCivAI::GetFriendshipChangePerTurnTimes100(PlayerTypes ePlayer) // NOTE: Not const because of need to check war status int CvMinorCivAI::GetEffectiveFriendshipWithMajorTimes100(PlayerTypes ePlayer, bool bIgnoreWar) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; // as defined during Reset() // Are we at war? @@ -11968,8 +11968,8 @@ int CvMinorCivAI::GetEffectiveFriendshipWithMajorTimes100(PlayerTypes ePlayer, b // What is the raw, stored level of Friendship between this Minor and the requested Major Civ? int CvMinorCivAI::GetBaseFriendshipWithMajorTimes100(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; // as defined during Reset() return m_aiFriendshipWithMajorTimes100[ePlayer]; @@ -11978,8 +11978,8 @@ int CvMinorCivAI::GetBaseFriendshipWithMajorTimes100(PlayerTypes ePlayer) const /// Sets the base level of Friendship between this Minor and the specified Major Civ void CvMinorCivAI::SetFriendshipWithMajorTimes100(PlayerTypes ePlayer, int iNum, bool bFromQuest, bool bFromCoup, bool bFromWar, bool bUpdateStatus) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; int iOldEffectiveFriendship = GetEffectiveFriendshipWithMajorTimes100(ePlayer, bFromWar); @@ -12008,8 +12008,8 @@ void CvMinorCivAI::SetFriendshipWithMajorTimes100(PlayerTypes ePlayer, int iNum, /// Changes the base level of Friendship between this Minor and the specified Major Civ void CvMinorCivAI::ChangeFriendshipWithMajorTimes100(PlayerTypes ePlayer, int iChange, bool bFromQuest, bool bUpdateStatus) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -12056,13 +12056,13 @@ void CvMinorCivAI::ChangeFriendshipWithMajor(PlayerTypes ePlayer, int iChange, b /// What is the resting point of Influence this major has? Affected by religion, social policies, Wary Of, etc. int CvMinorCivAI::GetFriendshipAnchorWithMajor(PlayerTypes eMajor) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if (eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return 0; PlayerTypes eMinor = GetPlayer()->GetID(); CvPlayer* pMajor = &GET_PLAYER(eMajor); - CvAssertMsg(pMajor, "MINOR CIV AI: pMajor not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pMajor, "MINOR CIV AI: pMajor not expected to be NULL. "); if (!pMajor) return 0; int iEra = pMajor->GetCurrentEra(); @@ -12137,12 +12137,12 @@ int CvMinorCivAI::GetFriendshipAnchorWithMajor(PlayerTypes eMajor) // Religion CvPlayerReligions* pMajorReligions = pMajor->GetReligions(); - CvAssertMsg(pMajorReligions, "MINOR CIV AI: pMajorReligions not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pMajorReligions, "MINOR CIV AI: pMajorReligions not expected to be NULL. "); if (!pMajorReligions) return iAnchor; CvCity* pMinorCapital = GetPlayer()->getCapitalCity(); if (!pMinorCapital) return iAnchor; // Happens when city was just captured, after buyout, etc., so just return the anchor value we have CvCityReligions* pMinorCapitalReligions = pMinorCapital->GetCityReligions(); - CvAssertMsg(pMinorCapitalReligions, "MINOR CIV AI: pMinorCapitalReligions not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pMinorCapitalReligions, "MINOR CIV AI: pMinorCapitalReligions not expected to be NULL. "); if (!pMinorCapitalReligions) return iAnchor; iAnchor += pMajorReligions->GetCityStateMinimumInfluence(pMinorCapitalReligions->GetReligiousMajority(), eMajor); @@ -12321,8 +12321,8 @@ void CvMinorCivAI::SetAlly(PlayerTypes eNewAlly, bool bSuppressNotification) // DOES NOT SET BONUS YIELDS OR SEND NOTIFICATIONS bool CvMinorCivAI::SetAllyInternal(PlayerTypes eNewAlly) { - CvAssertMsg(eNewAlly >= NO_PLAYER, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eNewAlly < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eNewAlly >= NO_PLAYER, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(eNewAlly < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); CvMap& theMap = GC.getMap(); int iNumPlots = GC.getMap().numPlots(); @@ -12656,8 +12656,8 @@ bool CvMinorCivAI::IsFriends(PlayerTypes ePlayer) /// Has ePlayer ever been Friends with this minor? bool CvMinorCivAI::IsEverFriends(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; return m_abEverFriends[ePlayer]; @@ -12666,8 +12666,8 @@ bool CvMinorCivAI::IsEverFriends(PlayerTypes ePlayer) /// Has ePlayer ever been Friends with this minor? void CvMinorCivAI::SetEverFriends(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_abEverFriends[ePlayer] = bValue; @@ -12676,8 +12676,8 @@ void CvMinorCivAI::SetEverFriends(PlayerTypes ePlayer, bool bValue) /// Is ePlayer Friends with this minor? void CvMinorCivAI::SetFriends(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; if (m_abFriends[ePlayer] != bValue) @@ -12791,7 +12791,7 @@ void CvMinorCivAI::DoFriendshipChangeEffects(const PlayerTypes ePlayer, const in for (PlotIndexContainer::const_iterator it = viPlots.begin(); it != viPlots.end(); ++it) { CvPlot* pPlot = GC.getMap().plotByIndex(*it); - CvAssert(pPlot); + ASSERT(pPlot); for (int iI = 0; iI < pPlot->getNumUnits(); iI++) { CvUnit* pUnit = pPlot->getUnitByIndex(iI); @@ -13925,8 +13925,8 @@ bool CvMinorCivAI::IsProtectedByAnyMajor() const int CvMinorCivAI::GetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor) const { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return -1; return m_aiTurnLastPledged[eMajor]; @@ -13934,8 +13934,8 @@ int CvMinorCivAI::GetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor) const void CvMinorCivAI::SetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor, int iTurn) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return; m_aiTurnLastPledged[eMajor] = iTurn; @@ -13943,8 +13943,8 @@ void CvMinorCivAI::SetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor, int i int CvMinorCivAI::GetTurnLastPledgeBrokenByMajor(PlayerTypes eMajor) const { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return -1; return m_aiTurnLastBrokePledge[eMajor]; @@ -13952,8 +13952,8 @@ int CvMinorCivAI::GetTurnLastPledgeBrokenByMajor(PlayerTypes eMajor) const void CvMinorCivAI::SetTurnLastPledgeBrokenByMajor(PlayerTypes eMajor, int iTurn) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return; m_aiTurnLastBrokePledge[eMajor] = iTurn; @@ -14236,8 +14236,8 @@ int CvMinorCivAI::GetCultureFlatAlliesBonus(PlayerTypes ePlayer, EraTypes eAssum /// Flat-rate culture bonus int CvMinorCivAI::GetCurrentCultureFlatBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Don't give a bonus to a minor civ player @@ -14291,8 +14291,8 @@ int CvMinorCivAI::GetCulturePerBuildingAlliesBonus(PlayerTypes /*ePlayer*/, EraT //antonjs: This feature was prototyped, but later removed. It will return 0 (no bonus). int CvMinorCivAI::GetCurrentCulturePerBuildingBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Don't give a bonus to a minor civ player @@ -14324,8 +14324,8 @@ int CvMinorCivAI::GetCurrentCulturePerBuildingBonus(PlayerTypes ePlayer) int CvMinorCivAI::GetCurrentCultureBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; int iAmount = 0; @@ -14386,8 +14386,8 @@ int CvMinorCivAI::GetHappinessFlatAlliesBonus(PlayerTypes ePlayer, EraTypes eAss /// Flat happiness bonus currently in effect int CvMinorCivAI::GetCurrentHappinessFlatBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Minor civ players do not get a bonus @@ -14503,8 +14503,8 @@ int CvMinorCivAI::GetHappinessPerLuxuryAlliesBonus(PlayerTypes ePlayer, EraTypes /// Per luxury happiness bonus currently in effect int CvMinorCivAI::GetCurrentHappinessPerLuxuryBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Minor civ players do not get a bonus @@ -14628,8 +14628,8 @@ int CvMinorCivAI::GetFaithFlatAlliesBonus(PlayerTypes ePlayer, EraTypes eAssumeE int CvMinorCivAI::GetCurrentFaithFlatBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Minor civ players do not get a bonus @@ -14769,8 +14769,8 @@ int CvMinorCivAI::GetGoldFlatAlliesBonus(PlayerTypes ePlayer, EraTypes eAssumeEr int CvMinorCivAI::GetCurrentGoldFlatBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Minor civ players do not get a bonus @@ -14909,8 +14909,8 @@ int CvMinorCivAI::GetScienceFlatAlliesBonus(PlayerTypes ePlayer, EraTypes eAssum int CvMinorCivAI::GetCurrentScienceFlatBonus(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0; // Minor civ players do not get a bonus @@ -15079,8 +15079,8 @@ int CvMinorCivAI::GetCurrentOtherCityFoodBonus(PlayerTypes ePlayer) // Figures out how long before we spawn a free unit for ePlayer void CvMinorCivAI::DoSeedUnitSpawnCounter(PlayerTypes ePlayer, bool bBias) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); int iNumTurns = GetSpawnBaseTurns(ePlayer); @@ -15101,8 +15101,8 @@ void CvMinorCivAI::DoSeedUnitSpawnCounter(PlayerTypes ePlayer, bool bBias) // How long before we spawn a free unit for ePlayer? int CvMinorCivAI::GetUnitSpawnCounter(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; // as defined during Reset() return m_aiUnitSpawnCounter[ePlayer]; @@ -15111,8 +15111,8 @@ int CvMinorCivAI::GetUnitSpawnCounter(PlayerTypes ePlayer) // Sets how long before we spawn a free unit for ePlayer void CvMinorCivAI::SetUnitSpawnCounter(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_aiUnitSpawnCounter[ePlayer] = iValue; @@ -15121,8 +15121,8 @@ void CvMinorCivAI::SetUnitSpawnCounter(PlayerTypes ePlayer, int iValue) // Changes how long before we spawn a free unit for ePlayer void CvMinorCivAI::ChangeUnitSpawnCounter(PlayerTypes ePlayer, int iChange) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); SetUnitSpawnCounter(ePlayer, GetUnitSpawnCounter(ePlayer) + iChange); } @@ -15164,8 +15164,8 @@ bool CvMinorCivAI::IsUnitSpawningAllowed(PlayerTypes ePlayer) /// Has the player chosen to disable Unit spawning? bool CvMinorCivAI::IsUnitSpawningDisabled(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; return m_abUnitSpawningDisabled[ePlayer]; @@ -15174,8 +15174,8 @@ bool CvMinorCivAI::IsUnitSpawningDisabled(PlayerTypes ePlayer) const /// Set the player chosen to disable Unit spawning void CvMinorCivAI::SetUnitSpawningDisabled(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_abUnitSpawningDisabled[ePlayer] = bValue; @@ -15924,7 +15924,7 @@ int CvMinorCivAI::GetBullyGoldAmount(PlayerTypes eBullyPlayer, bool bIgnoreScali // Add gold, more if later in game float fGameProgressFactor = ((float) GC.getGame().getElapsedGameTurns() / (float) GC.getGame().getEstimateEndTurn()); - CvAssertMsg(fGameProgressFactor >= 0.0f, "fGameProgressFactor is not expected to be negative! Please send Anton your save file and version."); + ASSERT(fGameProgressFactor >= 0.0f, "fGameProgressFactor is not expected to be negative!"); if(fGameProgressFactor > 1.0f) fGameProgressFactor = 1.0f; @@ -16352,8 +16352,8 @@ int CvMinorCivAI::CalculateBullyScore(PlayerTypes eBullyPlayer, bool bHeavyTribu bool CvMinorCivAI::CanMajorBullyGold(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; // Can't bully us if we're dead! @@ -16371,8 +16371,8 @@ bool CvMinorCivAI::CanMajorBullyGold(PlayerTypes ePlayer) // In case client wants to specify a metric beforehand (i.e. they calculated it on their end, for logging purposes etc.) bool CvMinorCivAI::CanMajorBullyGold(PlayerTypes ePlayer, int iSpecifiedBullyMetric) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; // Can't bully us if we're dead! @@ -16396,8 +16396,8 @@ bool CvMinorCivAI::CanMajorBullyGold(PlayerTypes ePlayer, int iSpecifiedBullyMet CvString CvMinorCivAI::GetMajorBullyGoldDetails(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return ""; CvString sFactors = ""; @@ -16430,8 +16430,8 @@ CvString CvMinorCivAI::GetMajorBullyGoldDetails(PlayerTypes ePlayer) bool CvMinorCivAI::CanMajorBullyUnit(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; // Can't bully us if we're dead! @@ -16448,8 +16448,8 @@ bool CvMinorCivAI::CanMajorBullyUnit(PlayerTypes ePlayer) // In case client wants to specify a metric beforehand (i.e. they calculated it on their end, for logging purposes etc.) bool CvMinorCivAI::CanMajorBullyUnit(PlayerTypes ePlayer, int iSpecifiedBullyMetric) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; // Can't bully us if we're dead! @@ -16470,8 +16470,8 @@ bool CvMinorCivAI::CanMajorBullyUnit(PlayerTypes ePlayer, int iSpecifiedBullyMet CvString CvMinorCivAI::GetMajorBullyUnitDetails(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return ""; CvString sFactors = ""; @@ -16487,7 +16487,7 @@ CvString CvMinorCivAI::GetMajorBullyUnitDetails(PlayerTypes ePlayer) return ""; CvUnitEntry* pUnitInfo = GC.getUnitInfo(eUnitType); - CvAssert(pUnitInfo); + ASSERT(pUnitInfo); if (!pUnitInfo) return ""; @@ -16521,8 +16521,8 @@ CvString CvMinorCivAI::GetMajorBullyUnitDetails(PlayerTypes ePlayer) CvString CvMinorCivAI::GetMajorBullyAnnexDetails(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return ""; CvString sFactors = ""; @@ -16538,7 +16538,7 @@ CvString CvMinorCivAI::GetMajorBullyAnnexDetails(PlayerTypes ePlayer) return ""; CvUnitEntry* pUnitInfo = GC.getUnitInfo(eUnitType); - CvAssert(pUnitInfo); + ASSERT(pUnitInfo); if (!pUnitInfo) return ""; @@ -16559,20 +16559,20 @@ CvString CvMinorCivAI::GetMajorBullyAnnexDetails(PlayerTypes ePlayer) void CvMinorCivAI::DoMajorBullyGold(PlayerTypes eBully, int iGold) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); if(eBully < 0 || eBully >= MAX_MAJOR_CIVS) return; CvCity* pMinorCapital = GetPlayer()->getCapitalCity(); if (pMinorCapital == NULL) { - CvAssertMsg(false, "Trying to take tribute but the minor has no capital. Please send Anton your save file and version."); + ASSERT(false, "Trying to take tribute but the minor has no capital."); return; } CvCity* pBullyCapital = GET_PLAYER(eBully).getCapitalCity(); if (pBullyCapital == NULL) { - CvAssertMsg(false, "Trying to take tribute without having a capital. Please send Anton your save file and version."); + ASSERT(false, "Trying to take tribute without having a capital."); return; } @@ -16581,7 +16581,7 @@ void CvMinorCivAI::DoMajorBullyGold(PlayerTypes eBully, int iGold) int iOldFriendshipTimes100 = GetEffectiveFriendshipWithMajorTimes100(eBully); if (bSuccess) { - CvAssertMsg(iGold >= 0, "iGold is expected to be non-negative. Please send Anton your save file and version."); + ASSERT(iGold >= 0, "iGold is expected to be non-negative."); if (GC.getGame().getActivePlayer() == eBully) { @@ -16709,8 +16709,8 @@ void CvMinorCivAI::DoMajorBullyGold(PlayerTypes eBully, int iGold) void CvMinorCivAI::DoMajorBullyAnnex(PlayerTypes eBully) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); if (eBully < 0 || eBully >= MAX_MAJOR_CIVS) return; int iBullyMetric = CalculateBullyScore(eBully, /*bForUnit*/ false); @@ -16785,8 +16785,8 @@ void CvMinorCivAI::DoMajorBullyAnnex(PlayerTypes eBully) } void CvMinorCivAI::DoMajorBullyUnit(PlayerTypes eBully, UnitTypes eUnitType) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); if(eBully < 0 || eBully >= MAX_MAJOR_CIVS) return; int iBullyMetric = CalculateBullyScore(eBully, /*bForUnit*/ true); @@ -16887,7 +16887,7 @@ void CvMinorCivAI::DoMajorBullyUnit(PlayerTypes eBully, UnitTypes eUnitType) CvCity* pMinorCapital = GetPlayer()->getCapitalCity(); if(pMinorCapital == NULL) { - CvAssertMsg(false, "Trying to spawn a Unit for a major civ but the minor has no capital. Please send Anton your save file and version."); + ASSERT(false, "Trying to spawn a Unit for a major civ but the minor has no capital."); return; } CvCity* pBullyCapital = GET_PLAYER(eBully).getCapitalCity(); @@ -16961,14 +16961,14 @@ void CvMinorCivAI::DoMajorBullyUnit(PlayerTypes eBully, UnitTypes eUnitType) { if(eUnitType == NO_UNIT) { - CvAssertMsg(false, "eUnitType is not expected to be NO_UNIT. Please send Anton your save file and version."); + ASSERT(false, "eUnitType is not expected to be NO_UNIT."); return; } // Minor must have Capital CvCity* pMinorCapital = GetPlayer()->getCapitalCity(); if(pMinorCapital == NULL) { - CvAssertMsg(false, "Trying to spawn a Unit for a major civ but the minor has no capital. Please send Anton your save file and version."); + ASSERT(false, "Trying to spawn a Unit for a major civ but the minor has no capital."); return; } int iX = pMinorCapital->getX(); @@ -17005,12 +17005,12 @@ void CvMinorCivAI::DoMajorBullyUnit(PlayerTypes eBully, UnitTypes eUnitType) // We were just bullied, how do we react? void CvMinorCivAI::DoBulliedByMajorReaction(PlayerTypes eBully, int iInfluenceChangeTimes100) { - CvAssertMsg(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBully >= 0, "eBully is expected to be non-negative (invalid Index)"); + ASSERT(eBully < MAX_MAJOR_CIVS, "eBully is expected to be within maximum bounds (invalid Index)"); if (eBully < 0 || eBully >= MAX_MAJOR_CIVS) return; CvPlayer* pBully = &GET_PLAYER(eBully); - CvAssertMsg(pBully, "pBully not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pBully, "pBully not expected to be NULL."); if (!pBully) return; if (!GET_PLAYER(eBully).IsCanBullyFriendlyCS()) @@ -17072,8 +17072,8 @@ bool CvMinorCivAI::IsEverBulliedByAnyMajor() const bool CvMinorCivAI::IsEverBulliedByMajor(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; return (m_aiTurnLastBullied[ePlayer] >= 0); // -1 means never bullied @@ -17099,8 +17099,8 @@ bool CvMinorCivAI::IsRecentlyBulliedByAnyMajor() const */ bool CvMinorCivAI::IsRecentlyBulliedByMajor(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false; const int iRecentlyBulliedTurnInterval = 20; //antonjs: todo: constant/XML @@ -17109,8 +17109,8 @@ bool CvMinorCivAI::IsRecentlyBulliedByMajor(PlayerTypes ePlayer) const int CvMinorCivAI::GetTurnLastBulliedByMajor(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; return m_aiTurnLastBullied[ePlayer]; @@ -17118,8 +17118,8 @@ int CvMinorCivAI::GetTurnLastBulliedByMajor(PlayerTypes ePlayer) const void CvMinorCivAI::SetTurnLastBulliedByMajor(PlayerTypes ePlayer, int iTurn) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_aiTurnLastBullied[ePlayer] = iTurn; @@ -17246,7 +17246,7 @@ void CvMinorCivAI::DoElection() break; } } - CvAssertMsg(iSpyID == -1, "Couldn't find a spy in any of the cities of the Minor Civ"); + ASSERT(iSpyID == -1, "Couldn't find a spy in any of the cities of the Minor Civ"); if (GC.getLogging() && GC.getAILogging()) { @@ -17364,7 +17364,7 @@ void CvMinorCivAI::DoElection() break; } } - CvAssertMsg(iSpyID == -1, "Couldn't find a spy in any of the cities of the Minor Civ"); + ASSERT(iSpyID == -1, "Couldn't find a spy in any of the cities of the Minor Civ"); GAMEEVENTINVOKE_HOOK(GAMEEVENT_ElectionResultFailure, (int)ePlayer, iSpyID, iDiminishAmount, pCapital->getX(), pCapital->getY()); } } @@ -17384,8 +17384,8 @@ void CvMinorCivAI::DoElection() // How many units has ePlayer gifted this minor? (used to prevent unit spam for influence exploits) int CvMinorCivAI::GetNumUnitsGifted(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; // as defined during Reset() return m_aiNumUnitsGifted[ePlayer]; @@ -17394,8 +17394,8 @@ int CvMinorCivAI::GetNumUnitsGifted(PlayerTypes ePlayer) // How many units has ePlayer gifted this minor? (used to prevent unit spam for influence exploits) void CvMinorCivAI::SetNumUnitsGifted(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_aiNumUnitsGifted[ePlayer] = iValue; @@ -17404,19 +17404,19 @@ void CvMinorCivAI::SetNumUnitsGifted(PlayerTypes ePlayer, int iValue) // How many units has ePlayer gifted this minor? (used to prevent unit spam for influence exploits) void CvMinorCivAI::ChangeNumUnitsGifted(PlayerTypes ePlayer, int iChange) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); SetNumUnitsGifted(ePlayer, GetNumUnitsGifted(ePlayer) + iChange); } void CvMinorCivAI::DoUnitGiftFromMajor(PlayerTypes eFromPlayer, CvUnit*& pGiftUnit, bool bDistanceGift) { - CvAssertMsg(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFromPlayer < MAX_MAJOR_CIVS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); + ASSERT(eFromPlayer < MAX_MAJOR_CIVS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); if (eFromPlayer < 0 || eFromPlayer >= MAX_MAJOR_CIVS) return; - CvAssertMsg(pGiftUnit != NULL, "pGiftUnit is NULL"); + ASSERT(pGiftUnit != NULL, "pGiftUnit is NULL"); if (pGiftUnit == NULL) return; ChangeNumUnitsGifted(eFromPlayer, 1); @@ -17490,24 +17490,24 @@ int CvMinorCivAI::GetFriendshipFromUnitGift(PlayerTypes eFromPlayer, bool bGreat // How much gold has ePlayer gifted this minor? int CvMinorCivAI::GetNumGoldGifted(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; // as defined in Reset() return m_aiNumGoldGifted[ePlayer]; } void CvMinorCivAI::SetNumGoldGifted(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; m_aiNumGoldGifted[ePlayer] = iValue; } void CvMinorCivAI::ChangeNumGoldGifted(PlayerTypes ePlayer, int iChange) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return; SetNumGoldGifted(ePlayer, GetNumGoldGifted(ePlayer) + iChange); } @@ -17600,13 +17600,13 @@ int CvMinorCivAI::GetFriendshipFromGoldGift(PlayerTypes eMajor, int iGold) // Can this major gift us a tile improvement? bool CvMinorCivAI::CanMajorGiftTileImprovement(PlayerTypes eMajor) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return false; CvPlayer* pPlayer = &GET_PLAYER(eMajor); if(pPlayer == NULL) { - CvAssertMsg(false, "pPlayer not expected to be NULL. Please send Anton your save file and version."); + ASSERT(false, "pPlayer not expected to be NULL."); return false; } @@ -17649,13 +17649,13 @@ bool CvMinorCivAI::CanMajorGiftTileImprovement(PlayerTypes eMajor) CvPlot* CvMinorCivAI::GetMajorGiftTileImprovement(PlayerTypes eMajor) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if (eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return NULL; CvPlayer* pPlayer = &GET_PLAYER(eMajor); if (pPlayer == NULL) { - CvAssertMsg(false, "pPlayer not expected to be NULL. Please send Anton your save file and version."); + ASSERT(false, "pPlayer not expected to be NULL."); return NULL; } @@ -17716,13 +17716,13 @@ CvPlot* CvMinorCivAI::GetMajorGiftTileImprovement(PlayerTypes eMajor) // Does this plot lack a resource tile improvement that eMajor has access to? bool CvMinorCivAI::IsLackingGiftableTileImprovementAtPlot(PlayerTypes eMajor, int iPlotX, int iPlotY) { - CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)"); if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return false; CvPlot* pPlot = GC.getMap().plot(iPlotX, iPlotY); if(pPlot == NULL) { - CvAssertMsg(false, "pPlot not expected to be NULL, invalid coordinates. Please send Anton your save file and version."); + ASSERT(false, "pPlot not expected to be NULL, invalid coordinates."); return false; } @@ -17785,13 +17785,13 @@ void CvMinorCivAI::DoTileImprovementGiftFromMajor(PlayerTypes eMajor, int iPlotX CvPlot* pPlot = GC.getMap().plot(iPlotX, iPlotY); if(pPlot == NULL) { - CvAssertMsg(false, "pPlot not expected to be NULL, invalid coordinates. Please send Anton your save file and version."); + ASSERT(false, "pPlot not expected to be NULL, invalid coordinates."); return; } CvPlayer* pPlayer = &GET_PLAYER(eMajor); if(pPlayer == NULL) { - CvAssertMsg(false, "pPlayer not expected to be NULL. Please send Anton your save file and version."); + ASSERT(false, "pPlayer not expected to be NULL."); return; } @@ -18259,8 +18259,8 @@ PlayerTypes CvMinorCivAI::GetPermanentAlly() const } void CvMinorCivAI::SetPermanentAlly(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= NO_PLAYER, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= NO_PLAYER, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if (ePlayer != NO_PLAYER) { @@ -18283,8 +18283,8 @@ void CvMinorCivAI::SetNoAlly(bool bValue) } bool CvMinorCivAI::IsSiphoned(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer < 0 || ePlayer >= REALLY_MAX_PLAYERS) { return false; // as defined in Reset() @@ -18293,8 +18293,8 @@ bool CvMinorCivAI::IsSiphoned(PlayerTypes ePlayer) const } void CvMinorCivAI::SetSiphoned(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(IsSiphoned(ePlayer) != bValue) { m_abSiphoned[ePlayer] = bValue; @@ -18304,59 +18304,59 @@ void CvMinorCivAI::SetSiphoned(PlayerTypes ePlayer, bool bValue) int CvMinorCivAI::GetNumConsecutiveSuccessfulRiggings(PlayerTypes ePlayer) const { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); return m_aiNumConsecutiveSuccessfulRiggings[ePlayer]; } void CvMinorCivAI::ChangeNumConsecutiveSuccessfulRiggings(PlayerTypes ePlayer, int iChange) { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); m_aiNumConsecutiveSuccessfulRiggings[ePlayer] += iChange; } void CvMinorCivAI::ResetNumConsecutiveSuccessfulRiggings(PlayerTypes ePlayer) { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); m_aiNumConsecutiveSuccessfulRiggings[ePlayer] = 0; } int CvMinorCivAI::GetRestingPointChange(PlayerTypes ePlayer) const { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); return m_aiRestingPointChange[ePlayer]; } void CvMinorCivAI::ChangeRestingPointChange(PlayerTypes ePlayer, int iChange) { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); m_aiRestingPointChange[ePlayer] += iChange; } void CvMinorCivAI::SetRestingPointChange(PlayerTypes ePlayer, int iValue) { - CvAssert(ePlayer >= 0); - CvAssert(ePlayer < MAX_MAJOR_CIVS); + ASSERT(ePlayer >= 0); + ASSERT(ePlayer < MAX_MAJOR_CIVS); m_aiRestingPointChange[ePlayer] = iValue; } const CvMinorCivIncomingUnitGift& CvMinorCivAI::getIncomingUnitGift(PlayerTypes eMajor) const { - CvAssert(eMajor >= 0); - CvAssert(eMajor < MAX_MAJOR_CIVS); + ASSERT(eMajor >= 0); + ASSERT(eMajor < MAX_MAJOR_CIVS); return m_IncomingUnitGifts[eMajor]; } CvMinorCivIncomingUnitGift& CvMinorCivAI::getIncomingUnitGift(PlayerTypes eMajor) { - CvAssert(eMajor >= 0); - CvAssert(eMajor < MAX_MAJOR_CIVS); + ASSERT(eMajor >= 0); + ASSERT(eMajor < MAX_MAJOR_CIVS); return m_IncomingUnitGifts[eMajor]; } @@ -18379,7 +18379,7 @@ void CvMinorCivAI::doIncomingUnitGifts() if (pCapital) { CvUnit* pNewUnit = GetPlayer()->initUnit(unitGift.getUnitType(), pCapital->getX(), pCapital->getY()); - CvAssert(pNewUnit); + ASSERT(pNewUnit); if (pNewUnit) { unitGift.applyToUnit(eLoopPlayer, *pNewUnit); @@ -18444,9 +18444,9 @@ void CvMinorCivAI::returnIncomingUnitGift(PlayerTypes eMajor) if (unitGift.hasIncomingUnit()) { const UnitTypes eUnitType = unitGift.getUnitType(); - CvAssert(eUnitType != NO_UNIT); + ASSERT(eUnitType != NO_UNIT); const CvUnitEntry* pkUnitInfo = GC.getUnitInfo(eUnitType); - CvAssert(pkUnitInfo); + ASSERT(pkUnitInfo); // Select a default city to return to. // We will return to this city if no better city is found. @@ -18544,8 +18544,8 @@ bool CvMinorCivAI::IsAtWarWithPlayersTeam(PlayerTypes ePlayer) /// How many resources does this minor own that eMajor doesn't? int CvMinorCivAI::GetNumResourcesMajorLacks(PlayerTypes eMajor) { - CvAssertMsg(eMajor >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMajor >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(eMajor < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); int iNumTheyLack = 0; @@ -18831,7 +18831,7 @@ pair CvMinorCivAI::GetStatusChangeNotificationStrings(Player Localization::String strSummary = ""; CvTeam* pTeam = &GET_TEAM(GET_PLAYER(ePlayer).getTeam()); - CvAssertMsg(pTeam, "pTeam not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pTeam, "pTeam not expected to be NULL."); const char* strMinorsNameKey = GetPlayer()->getNameKey(); @@ -18851,7 +18851,7 @@ pair CvMinorCivAI::GetStatusChangeNotificationStrings(Player // We're passing someone else { - CvAssertMsg(eOldAlly != NO_PLAYER, "eOldAlly not expected to be NO_PLAYER here. Please send Anton your save file and version."); + ASSERT(eOldAlly != NO_PLAYER, "eOldAlly not expected to be NO_PLAYER here."); const char* strOldBestPlayersNameKey = "TXT_KEY_UNMET_PLAYER"; TeamTypes eOldAllyTeam = GET_PLAYER(eOldAlly).getTeam(); if (pTeam->isHasMet(eOldAllyTeam)) @@ -18933,8 +18933,8 @@ pair CvMinorCivAI::GetStatusChangeNotificationStrings(Player // Someone passed us up else { - CvAssertMsg(eNewAlly != NO_PLAYER, "eNewAlly not expected to be NO_PLAYER here. Please send Anton your save file and version."); - CvAssertMsg(eNewAlly != ePlayer, "eNewAlly not expected to be same as ePlayer here. Please send Anton your save file and version."); + ASSERT(eNewAlly != NO_PLAYER, "eNewAlly not expected to be NO_PLAYER here."); + ASSERT(eNewAlly != ePlayer, "eNewAlly not expected to be same as ePlayer here."); const char* strNewBestPlayersNameKey = "TXT_KEY_UNMET_PLAYER"; TeamTypes eNewAllyTeam = GET_PLAYER(eNewAlly).getTeam(); if (pTeam->isHasMet(eNewAllyTeam)) @@ -19151,8 +19151,8 @@ int CvMinorCivInfo::GetBullyUnit() const //------------------------------------------------------------------------------ int CvMinorCivInfo::getFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : 0; } //------------------------------------------------------------------------------ diff --git a/CvGameCoreDLL_Expansion2/CvNotifications.cpp b/CvGameCoreDLL_Expansion2/CvNotifications.cpp index 91b3148462..3e1f92072f 100644 --- a/CvGameCoreDLL_Expansion2/CvNotifications.cpp +++ b/CvGameCoreDLL_Expansion2/CvNotifications.cpp @@ -974,7 +974,7 @@ void CvNotifications::Activate(Notification& notification) case NOTIFICATION_TECH_STOLEN_SPY_IDENTIFIED: case NOTIFICATION_SPY_KILLED_A_SPY: { - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if(notification.m_iGameDataIndex >= 0 && notification.m_iExtraGameData == -1) { PlayerTypes eTargetPlayer = (PlayerTypes)notification.m_iGameDataIndex; @@ -994,7 +994,7 @@ void CvNotifications::Activate(Notification& notification) case NOTIFICATION_INTRIGUE_SNEAK_ATTACK_ARMY_AGAINST_KNOWN_CITY_UNKNOWN: case NOTIFICATION_INTRIGUE_SNEAK_ATTACK_AMPHIB_AGAINST_KNOWN_CITY_UNKNOWN: case NOTIFICATION_INTRIGUE_SNEAK_ATTACK_AMPHIB_AGAINST_KNOWN_CITY_KNOWN: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if(notification.m_iGameDataIndex >= 0) { PlayerTypes ePlayerToContact = (PlayerTypes)notification.m_iGameDataIndex; @@ -1009,7 +1009,7 @@ void CvNotifications::Activate(Notification& notification) case NOTIFICATION_LEAGUE_CALL_FOR_VOTES: case NOTIFICATION_LEAGUE_VOTING_DONE: case NOTIFICATION_LEAGUE_VOTING_SOON: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { LeagueTypes eLeague = (LeagueTypes) notification.m_iGameDataIndex; @@ -1027,7 +1027,7 @@ void CvNotifications::Activate(Notification& notification) case NOTIFICATION_CULTURE_VICTORY_WITHIN_ONE: case NOTIFICATION_CULTURE_VICTORY_WITHIN_ONE_ACTIVE_PLAYER: case NOTIFICATION_CULTURE_VICTORY_NO_LONGER_INFLUENTIAL: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { CvPopupInfo kPopup(BUTTONPOPUP_CULTURE_OVERVIEW); @@ -1037,7 +1037,7 @@ void CvNotifications::Activate(Notification& notification) break; case NOTIFICATION_CHOOSE_ARCHAEOLOGY: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { CvPopupInfo kPopup(BUTTONPOPUP_CHOOSE_ARCHAEOLOGY, m_ePlayer); @@ -1046,7 +1046,7 @@ void CvNotifications::Activate(Notification& notification) break; case NOTIFICATION_CHOOSE_IDEOLOGY: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { CvPopupInfo kPopup(BUTTONPOPUP_CHOOSE_IDEOLOGY, m_ePlayer); @@ -1055,7 +1055,7 @@ void CvNotifications::Activate(Notification& notification) break; case NOTIFICATION_LEAGUE_PROJECT_COMPLETE: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { LeagueTypes eLeague = (LeagueTypes) notification.m_iGameDataIndex; @@ -1066,7 +1066,7 @@ void CvNotifications::Activate(Notification& notification) break; #if defined(MOD_BALANCE_CORE) case 419811917: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { EventTypes eEvent = (EventTypes)notification.m_iGameDataIndex; @@ -1075,7 +1075,7 @@ void CvNotifications::Activate(Notification& notification) } break; case 826076831: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { CityEventTypes eEvent = (CityEventTypes)notification.m_iGameDataIndex; @@ -1085,7 +1085,7 @@ void CvNotifications::Activate(Notification& notification) } break; case -1608954742: - CvAssertMsg(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); + ASSERT(notification.m_iGameDataIndex >= 0, "notification.m_iGameDataIndex is out of bounds"); if (notification.m_iGameDataIndex >= 0) { CityEventTypes eEvent = (CityEventTypes)notification.m_iGameDataIndex; diff --git a/CvGameCoreDLL_Expansion2/CvPlayer.cpp b/CvGameCoreDLL_Expansion2/CvPlayer.cpp index 4dbe489037..9958da602a 100644 --- a/CvGameCoreDLL_Expansion2/CvPlayer.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlayer.cpp @@ -916,7 +916,7 @@ void CvPlayer::init(PlayerTypes eID) //-------------------------------- // Init other game data - CvAssert(getTeam() != NO_TEAM); + ASSERT(getTeam() != NO_TEAM); PlayerTypes p = GetID(); SlotStatus s = CvPreGame::slotStatus(p); @@ -964,7 +964,7 @@ void CvPlayer::init(PlayerTypes eID) } } - CvAssert(m_pTraits); + ASSERT(m_pTraits); m_pTraits->InitPlayerTraits(); // Special handling for the Polynesian trait's overriding of embarked unit graphics @@ -1999,7 +1999,7 @@ void CvPlayer::reset(PlayerTypes eID, bool bConstructorCall) delete(m_AIOperations[i].second); m_AIOperations.clear(); - CvAssertMsg(0 < GC.getNumResourceInfos(), "GC.getNumResourceInfos() is not greater than zero but it is used to allocate memory in CvPlayer::reset"); + ASSERT(0 < GC.getNumResourceInfos(), "GC.getNumResourceInfos() is not greater than zero but it is used to allocate memory in CvPlayer::reset"); m_paiNumResourceUnimproved.clear(); m_paiNumResourceUnimproved.resize(GC.getNumResourceInfos(), 0); @@ -2034,7 +2034,7 @@ void CvPlayer::reset(PlayerTypes eID, bool bConstructorCall) m_aiNumResourceFromGP.clear(); m_aiNumResourceFromGP.resize(GC.getNumResourceInfos(), 0); - CvAssertMsg(0 < GC.getNumImprovementInfos(), "GC.getNumImprovementInfos() is not greater than zero but it is used to allocate memory in CvPlayer::reset"); + ASSERT(0 < GC.getNumImprovementInfos(), "GC.getNumImprovementInfos() is not greater than zero but it is used to allocate memory in CvPlayer::reset"); m_paiImprovementCount.clear(); m_paiImprovementCount.resize(GC.getNumImprovementInfos(), 0); m_paiImprovementBuiltCount.clear(); @@ -2971,10 +2971,10 @@ CvCity* CvPlayer::initCity(int iX, int iY, bool bBumpUnits, bool bInitialFoundin { CvCity* pNewCity = addCity(); - CvAssertMsg(pNewCity != NULL, "City is not assigned a valid value"); + ASSERT(pNewCity != NULL, "City is not assigned a valid value"); if(pNewCity != NULL) { - CvAssertMsg(!(GC.getMap().plot(iX, iY)->isCity()), "No city is expected at this plot when initializing new city"); + ASSERT(!(GC.getMap().plot(iX, iY)->isCity()), "No city is expected at this plot when initializing new city"); pNewCity->init(pNewCity->GetID(), GetID(), iX, iY, bBumpUnits, bInitialFounding, eInitialReligion, szName, pkSettlerUnitEntry); pNewCity->GetCityStrategyAI()->UpdateFlavorsForNewCity(); pNewCity->DoUpdateCheapestPlotInfluenceDistance(); @@ -4951,7 +4951,7 @@ int CvPlayer::GetNumWorkablePlots() const void CvPlayer::DoRevolutionPlayer(PlayerTypes ePlayer, int iOldCityID) { CvCity* pCity = getCity(iOldCityID); - CvAssert(pCity); + ASSERT(pCity); if (!pCity) return; @@ -5215,15 +5215,15 @@ void CvPlayer::UpdateBestMilitaryCities() void CvPlayer::SetBestMilitaryCityDomain(int iValue, DomainTypes eDomain) { VALIDATE_OBJECT - CvAssertMsg(eDomain >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eDomain >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); m_aiBestMilitaryDomainCity[eDomain] = iValue; } void CvPlayer::SetBestMilitaryCityCombatClass(int iValue, UnitCombatTypes eUnitCombat) { VALIDATE_OBJECT - CvAssertMsg(eUnitCombat >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eUnitCombat < GC.getNumUnitCombatClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eUnitCombat >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eUnitCombat < GC.getNumUnitCombatClassInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); m_aiBestMilitaryCombatClassCity[eUnitCombat] = iValue; } CvCity* CvPlayer::GetBestMilitaryCity(UnitCombatTypes eUnitCombat, DomainTypes eDomain) @@ -5246,15 +5246,15 @@ CvCity* CvPlayer::GetBestMilitaryCity(UnitCombatTypes eUnitCombat, DomainTypes e int CvPlayer::GetEventChoiceDuration(EventChoiceTypes eEventChoice) const { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventChoiceDuration[eEventChoice]; } void CvPlayer::ChangeEventChoiceDuration(EventChoiceTypes eEventChoice,int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if(iValue != 0) { m_aiEventChoiceDuration[eEventChoice] = m_aiEventChoiceDuration[eEventChoice] + iValue; @@ -5263,22 +5263,22 @@ void CvPlayer::ChangeEventChoiceDuration(EventChoiceTypes eEventChoice,int iValu void CvPlayer::SetEventChoiceDuration(EventChoiceTypes eEventChoice,int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_aiEventChoiceDuration[eEventChoice] = iValue; } int CvPlayer::GetEventIncrement(EventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventIncrement[eEvent]; } void CvPlayer::IncrementEvent(EventTypes eEvent, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if(iValue != 0) { m_aiEventIncrement[eEvent] = m_aiEventIncrement[eEvent] + iValue; @@ -5300,15 +5300,15 @@ void CvPlayer::ChangePlayerEventCooldown(int iValue) int CvPlayer::GetEventCooldown(EventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_aiEventCooldown[eEvent]; } void CvPlayer::ChangeEventCooldown(EventTypes eEvent,int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); if(iValue != 0) { m_aiEventCooldown[eEvent] = m_aiEventCooldown[eEvent] + iValue; @@ -5317,72 +5317,72 @@ void CvPlayer::ChangeEventCooldown(EventTypes eEvent,int iValue) void CvPlayer::SetEventCooldown(EventTypes eEvent,int iValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_aiEventCooldown[eEvent] = iValue; } void CvPlayer::SetEventActive(EventTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventActive[eEvent] = bValue; } bool CvPlayer::IsEventActive(EventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventActive[eEvent]; } void CvPlayer::SetEventChoiceActive(EventChoiceTypes eEventChoice, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventChoiceActive[eEventChoice] = bValue; } bool CvPlayer::IsEventChoiceActive(EventChoiceTypes eEventChoice) const { VALIDATE_OBJECT - CvAssertMsg(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEventChoice >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEventChoice < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventChoiceActive[eEventChoice]; } void CvPlayer::SetEventChoiceFired(EventChoiceTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventChoiceFired[eEvent] = bValue; } bool CvPlayer::IsEventChoiceFired(EventChoiceTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventChoiceInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventChoiceFired[eEvent]; } void CvPlayer::SetEventFired(EventTypes eEvent, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); m_abEventFired[eEvent] = bValue; } bool CvPlayer::IsEventFired(EventTypes eEvent) const { VALIDATE_OBJECT - CvAssertMsg(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); - CvAssertMsg(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eEvent >= 0, "eEvent is expected to be non-negative (invalid Index)"); + ASSERT(eEvent < GC.getNumEventInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); return m_abEventFired[eEvent]; } @@ -8542,7 +8542,7 @@ void CvPlayer::DoEventChoice(EventChoiceTypes eEventChoice, EventTypes eEvent, b void CvPlayer::DoLiberatePlayer(PlayerTypes ePlayer, int iOldCityID, bool bForced, bool bSphereRemoval) { CvCity* pCity = getCity(iOldCityID); - CvAssert(pCity); + ASSERT(pCity); if (!pCity) return; @@ -9127,12 +9127,12 @@ PlayerTypes CvPlayer::GetPlayerToLiberate(CvCity* pCity) CvUnit* CvPlayer::initUnit(UnitTypes eUnit, int iX, int iY, UnitAITypes eUnitAI, UnitCreationReason eReason, bool bNoMove, bool bSetupGraphical, int iMapLayer /* = 0 */, int iNumGoodyHutsPopped, ContractTypes eContract, bool bHistoric, CvUnit* pPassUnit) { - CvAssertMsg(eUnit != NO_UNIT, "Unit is not assigned a valid value"); + ASSERT(eUnit != NO_UNIT, "Unit is not assigned a valid value"); if (eUnit == NO_UNIT) return NULL; CvUnitEntry* pkUnitDef = GC.getUnitInfo(eUnit); - CvAssertFmt(pkUnitDef, "Trying to create unit of type %d, which does not exist", eUnit); + ASSERT(pkUnitDef, "Trying to create unit of type %d, which does not exist", eUnit); if (isMajorCiv() && pkUnitDef->IsMilitarySupport() && GetNumUnitsOutOfSupply() > 4 && eReason!=REASON_UPGRADE && eReason!=REASON_GIFT) { @@ -9140,7 +9140,7 @@ CvUnit* CvPlayer::initUnit(UnitTypes eUnit, int iX, int iY, UnitAITypes eUnitAI, } CvUnit* pUnit = addUnit(); - CvAssertMsg(pUnit, "Unit is not assigned a valid value"); + ASSERT(pUnit, "Unit is not assigned a valid value"); pUnit->init(pUnit->GetID(), eUnit, ((eUnitAI == NO_UNITAI) ? pkUnitDef->GetDefaultUnitAIType() : eUnitAI), GetID(), iX, iY, eReason, bNoMove, bSetupGraphical, iMapLayer, iNumGoodyHutsPopped, eContract, bHistoric, pPassUnit); if(pUnit->getUnitInfo().GetWorkRate() > 0 && pUnit->getUnitInfo().GetDomainType() == DOMAIN_LAND) @@ -9154,15 +9154,15 @@ CvUnit* CvPlayer::initUnit(UnitTypes eUnit, int iX, int iY, UnitAITypes eUnitAI, CvUnit* CvPlayer::initUnitWithNameOffset(UnitTypes eUnit, int nameOffset, int iX, int iY, UnitAITypes eUnitAI, UnitCreationReason eReason, bool bNoMove, bool bSetupGraphical, int iMapLayer /* = 0 */, int iNumGoodyHutsPopped, ContractTypes eContract, bool bHistoric, CvUnit* pPassUnit) { - CvAssertMsg(eUnit != NO_UNIT, "Unit is not assigned a valid value"); + ASSERT(eUnit != NO_UNIT, "Unit is not assigned a valid value"); if (eUnit == NO_UNIT) return NULL; CvUnitEntry* pkUnitDef = GC.getUnitInfo(eUnit); - CvAssertFmt(pkUnitDef, "Trying to create unit of type %d, which does not exist", eUnit); + ASSERT(pkUnitDef, "Trying to create unit of type %d, which does not exist", eUnit); CvUnit* pUnit = addUnit(); - CvAssertMsg(pUnit, "Unit is not assigned a valid value"); + ASSERT(pUnit, "Unit is not assigned a valid value"); pUnit->initWithNameOffset(pUnit->GetID(), eUnit, nameOffset, ((eUnitAI == NO_UNITAI) ? pkUnitDef->GetDefaultUnitAIType() : eUnitAI), GetID(), iX, iY, eReason, bNoMove, bSetupGraphical, iMapLayer, iNumGoodyHutsPopped, eContract, bHistoric, false, pPassUnit); if(pUnit->getUnitInfo().GetWorkRate() > 0 && pUnit->getUnitInfo().GetDomainType() == DOMAIN_LAND) @@ -9177,12 +9177,12 @@ CvUnit* CvPlayer::initUnitWithNameOffset(UnitTypes eUnit, int nameOffset, int iX CvUnit* CvPlayer::initNamedUnit(UnitTypes eUnit, const char* strKey, int iX, int iY, UnitAITypes eUnitAI, UnitCreationReason eReason, bool bNoMove, bool bSetupGraphical, int iMapLayer /* = 0 */, int iNumGoodyHutsPopped) { - CvAssertMsg(eUnit != NO_UNIT, "Unit is not assigned a valid value"); + ASSERT(eUnit != NO_UNIT, "Unit is not assigned a valid value"); if (eUnit == NO_UNIT) return NULL; CvUnitEntry* pkUnitDef = GC.getUnitInfo(eUnit); - CvAssertFmt(pkUnitDef != NULL, "Trying to create unit of type %d, which does not exist", eUnit); + ASSERT(pkUnitDef != NULL, "Trying to create unit of type %d, which does not exist", eUnit); if (pkUnitDef == NULL) return NULL; @@ -9196,7 +9196,7 @@ CvUnit* CvPlayer::initNamedUnit(UnitTypes eUnit, const char* strKey, int iX, int } CvUnit* pUnit = addUnit(); - CvAssertMsg(pUnit != NULL, "Unit is not assigned a valid value"); + ASSERT(pUnit != NULL, "Unit is not assigned a valid value"); if (NULL != pUnit) { pUnit->initWithNameOffset(pUnit->GetID(), eUnit, -1, ((eUnitAI == NO_UNITAI) ? pkUnitDef->GetDefaultUnitAIType() : eUnitAI), GetID(), iX, iY, eReason, bNoMove, bSetupGraphical, iMapLayer, iNumGoodyHutsPopped, NO_CONTRACT, true, true); @@ -9355,7 +9355,7 @@ void CvPlayer::disbandUnit(bool) break; default: - CvAssert(false); + ASSERT(false); break; } @@ -9382,7 +9382,7 @@ void CvPlayer::disbandUnit(bool) GC.GetEngineUserInterface()->AddUnitMessage(0, pBestUnit->GetIDInfo(), GetID(), false, /*10*/ GD_INT_GET(EVENT_MESSAGE_TIME), GetLocalizedText("TXT_KEY_MISC_UNIT_DISBANDED_NO_MONEY", pBestUnit->getNameKey()));//, "AS2D_UNITDISBANDED", MESSAGE_TYPE_MINOR_EVENT, pBestUnit->getUnitInfo().GetButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pBestUnit->getX(), pBestUnit->getY(), true, true); } - CvAssert(!(pBestUnit->isGoldenAge())); + ASSERT(!(pBestUnit->isGoldenAge())); pBestUnit->kill(false); } @@ -9977,7 +9977,7 @@ void CvPlayer::doTurn() { // Time building of these maps - CvAssertMsg(isAlive(), "isAlive is expected to be true"); + ASSERT(isAlive(), "isAlive is expected to be true"); //cache reset m_iNumUnitsSuppliedCached = -1; @@ -10551,7 +10551,7 @@ void CvPlayer::doTurnUnits() } break; case NO_DOMAIN: - CvAssertMsg(false, "Unit with no Domain"); + ASSERT(false, "Unit with no Domain"); break; default: if(iPass == 3) @@ -10673,7 +10673,7 @@ void CvPlayer::DoUnitReset() pkMissionData->eMissionType == CvTypes::getMISSION_AIR_SWEEP() || pkMissionData->eMissionType == CvTypes::getMISSION_NUKE()) { - CvAssertMsg(0, "An AI unit has a combat mission queued at the end of its turn."); + ASSERT(0, "An AI unit has a combat mission queued at the end of its turn."); pLoopUnit->ClearMissionQueue(); // Clear the whole thing, the AI will re-evaluate next turn. } } @@ -11305,42 +11305,42 @@ int CvPlayer::countCitiesNeedingTerrainImprovements(bool bReset) const void CvPlayer::setCityFeatures(FeatureTypes eFeature, int iValue) { - CvAssertMsg(eFeature >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); m_piCityFeatures[eFeature] = iValue; } int CvPlayer::getCityFeatures(FeatureTypes eFeature) const { - CvAssertMsg(eFeature >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); return m_piCityFeatures[eFeature]; } void CvPlayer::setNumBuildings(BuildingTypes eBuilding, int iValue) { - CvAssertMsg(eBuilding >= 0, "eBuilding is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eBuilding is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBuilding >= 0, "eBuilding is expected to be non-negative (invalid Index)"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eBuilding is expected to be within maximum bounds (invalid Index)"); m_piNumBuildings[eBuilding] = iValue; } int CvPlayer::getNumBuildings(BuildingTypes eBuilding) const { - CvAssertMsg(eBuilding >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBuilding >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); return m_piNumBuildings[eBuilding]; } void CvPlayer::setNumBuildingsInPuppets(BuildingTypes eBuilding, int iValue) { - CvAssertMsg(eBuilding >= 0, "eBuilding is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eBuilding is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBuilding >= 0, "eBuilding is expected to be non-negative (invalid Index)"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eBuilding is expected to be within maximum bounds (invalid Index)"); m_piNumBuildingsInPuppets[eBuilding] = iValue; } int CvPlayer::getNumBuildingsInPuppets(BuildingTypes eBuilding) const { - CvAssertMsg(eBuilding >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBuilding >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); return m_piNumBuildingsInPuppets[eBuilding]; } @@ -11739,7 +11739,7 @@ bool CvPlayer::canReceiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) CvGoodyInfo kGoodyInfo; const bool bResult = DB.SelectAt(kResult, "GoodyHuts", eGoody); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "Cannot find goody info."); + ASSERT(bResult, "Cannot find goody info."); kGoodyInfo.CacheResult(kResult); // Wishing we had lambdas right about now @@ -12240,7 +12240,7 @@ void CvPlayer::receiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) int iDY = 0; int iI = 0; - CvAssertMsg(canReceiveGoody(pPlot, eGoody, pUnit), "Instance is expected to be able to receive goody"); + ASSERT(canReceiveGoody(pPlot, eGoody, pUnit), "Instance is expected to be able to receive goody"); // Wishing we had lambdas right about now struct BestCityFinder @@ -12312,7 +12312,7 @@ void CvPlayer::receiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) CvGoodyInfo kGoodyInfo; const bool bResult = DB.SelectAt(kResult, "GoodyHuts", eGoody); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "Cannot find goody info."); + ASSERT(bResult, "Cannot find goody info."); kGoodyInfo.CacheResult(kResult); CvGoodyHuts::DoPlayerReceivedGoody(GetID(), eGoody); @@ -12798,7 +12798,7 @@ void CvPlayer::receiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) pUnit->finishMoves(); pUnit->SetBeenPromotedFromGoody(true); - CvAssert(pNewUnit); + ASSERT(pNewUnit); if (pNewUnit != NULL) { // MUST call the event before convert() as that kills the old unit @@ -12895,7 +12895,7 @@ void CvPlayer::receiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) } } - CvAssertMsg(eBestTech != NO_TECH, "BestTech is not assigned a valid value"); + ASSERT(eBestTech != NO_TECH, "BestTech is not assigned a valid value"); if (MOD_EVENTS_GOODY_TECH) { @@ -13093,7 +13093,7 @@ void CvPlayer::doGoody(CvPlot* pPlot, CvUnit* pUnit) GoodyTypes eGoody; - CvAssertMsg(pPlot->isGoody(), "pPlot->isGoody is expected to be true"); + ASSERT(pPlot->isGoody(), "pPlot->isGoody is expected to be true"); // Barbarians and Minor Civs don't claim ruins if (!isMajorCiv()) @@ -13149,7 +13149,7 @@ void CvPlayer::doGoody(CvPlot* pPlot, CvUnit* pUnit) Database::SingleResult kResult; const bool bResult = DB.SelectAt(kResult, "GoodyHuts", eGoody); DEBUG_VARIABLE(bResult); - CvAssertMsg(bResult, "Cannot find goody info."); + ASSERT(bResult, "Cannot find goody info."); CvGoodyInfo kGoodyInfo; kGoodyInfo.CacheResult(kResult); @@ -13322,8 +13322,8 @@ void CvPlayer::SetChainLength(BuildingTypes eBuilding) } int CvPlayer::GetChainLength(BuildingTypes eBuilding) { - CvAssertMsg(eBuilding >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBuilding < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBuilding >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBuilding < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingChainSteps[eBuilding]; } @@ -13404,7 +13404,7 @@ void CvPlayer::foundCity(int iX, int iY, ReligionTypes eReligion, bool bForce, C CvCity* pCity = initCity(iX, iY, true, true, eReligion, NULL, pkSettlerUnitEntry); - CvAssertMsg(pCity != NULL, "City is not assigned a valid value"); + ASSERT(pCity != NULL, "City is not assigned a valid value"); if(pCity == NULL) return; @@ -14658,8 +14658,8 @@ bool CvPlayer::isProductionMaxedUnitClass(UnitClassTypes eUnitClass) const void CvPlayer::changeUnitsBuiltCount(UnitTypes eUnitType, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eUnitType >= 0, "eUnitType expected to be >= 0"); - CvAssertMsg(eUnitType < GC.getNumUnitInfos(), "eUnitType expected to be < GC.getNumUnitInfos()"); + ASSERT(eUnitType >= 0, "eUnitType expected to be >= 0"); + ASSERT(eUnitType < GC.getNumUnitInfos(), "eUnitType expected to be < GC.getNumUnitInfos()"); m_aiNumUnitsBuilt[eUnitType] = m_aiNumUnitsBuilt[eUnitType] + iValue; } @@ -14667,8 +14667,8 @@ void CvPlayer::changeUnitsBuiltCount(UnitTypes eUnitType, int iValue) int CvPlayer::getUnitsBuiltCount(UnitTypes eUnitType) const { VALIDATE_OBJECT - CvAssertMsg(eUnitType >= 0, "eUnitType expected to be >= 0"); - CvAssertMsg(eUnitType < GC.getNumUnitInfos(), "eUnitType expected to be < GC.getNumUnitInfos()"); + ASSERT(eUnitType >= 0, "eUnitType expected to be >= 0"); + ASSERT(eUnitType < GC.getNumUnitInfos(), "eUnitType expected to be < GC.getNumUnitInfos()"); return m_aiNumUnitsBuilt[eUnitType]; } @@ -14734,15 +14734,15 @@ int CvPlayer::getProductionNeeded(UnitTypes eUnit, bool bIgnoreDifficulty) const { CvUnitEntry* pkUnitEntry = GC.getUnitInfo(eUnit); - CvAssertMsg(pkUnitEntry, "This should never be hit"); + ASSERT(pkUnitEntry, "This should never be hit"); if (pkUnitEntry == NULL) return 0; UnitClassTypes eUnitClass = (UnitClassTypes)pkUnitEntry->GetUnitClassType(); - CvAssert(NO_UNITCLASS != eUnitClass); + ASSERT(NO_UNITCLASS != eUnitClass); CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eUnitClass); - CvAssert(pkUnitClassInfo); + ASSERT(pkUnitClassInfo); if (pkUnitClassInfo == NULL) return 0; @@ -14958,8 +14958,8 @@ int CvPlayer::getProductionNeeded(BuildingTypes eTheBuilding) const { for (int iLoop = eBuildingUnlockedEra; iLoop < GetCurrentEra(); iLoop++) { - CvAssertMsg(iLoop >= 0, "Loop should be within era bounds"); - CvAssertMsg(iLoop = 0, "Loop should be within era bounds"); + ASSERT(iLoop = 0 && iLoop < GC.getNumEraInfos()) { @@ -14981,8 +14981,8 @@ int CvPlayer::getProductionNeeded(BuildingTypes eTheBuilding) const int iTotalEraMod = 0; for (int iLoop = 0; iLoop < GetCurrentEra(); iLoop++) { - CvAssertMsg(iLoop >= 0, "Loop should be within era bounds"); - CvAssertMsg(iLoop = 0, "Loop should be within era bounds"); + ASSERT(iLoop = 0 && iLoop < GC.getNumEraInfos()) { @@ -15289,7 +15289,7 @@ int CvPlayer::getBuildingClassPrereqBuilding(BuildingTypes eBuilding, BuildingCl CvBuildingEntry* pkBuilding = GC.getBuildingInfo(eBuilding); if(pkBuilding == NULL) { - CvAssertMsg(pkBuilding, "Should never happen..."); + ASSERT(pkBuilding, "Should never happen..."); return -1; } @@ -15445,7 +15445,7 @@ void CvPlayer::processBuilding(BuildingTypes eBuilding, int iChange, bool bFirst if(pBuildingInfo->GetInstantSpyRankChange() > 0) { CvPlayerEspionage* pEspionage = GetEspionage(); - CvAssertMsg(pEspionage, "pEspionage is null! What's up with that?!"); + ASSERT(pEspionage, "pEspionage is null! What's up with that?!"); if(pEspionage) { for(uint ui = 0; ui < pEspionage->m_aSpyList.size(); ui++) @@ -16071,7 +16071,7 @@ bool CvPlayer::IsBuildBlockedByFeature(BuildTypes eBuild, FeatureTypes eFeature, // Returns the cost int CvPlayer::getBuildCost(const CvPlot* pPlot, BuildTypes eBuild) const { - CvAssert(eBuild >= 0 && eBuild < GC.getNumBuildInfos()); + ASSERT(eBuild >= 0 && eBuild < GC.getNumBuildInfos()); CvBuildInfo* pkBuildInfo = GC.getBuildInfo(eBuild); if(pkBuildInfo == NULL) @@ -16680,7 +16680,7 @@ int CvPlayer::calculateResearchModifier(TechTypes eTech) iPossiblePaths++; } } - CvAssertMsg(iPossiblePaths >= iUnknownPaths, "The number of possible paths is expected to match or exceed the number of unknown ones"); + ASSERT(iPossiblePaths >= iUnknownPaths, "The number of possible paths is expected to match or exceed the number of unknown ones"); iModifier += (iPossiblePaths - iUnknownPaths) * /*20*/ GD_INT_GET(TECH_COST_KNOWN_PREREQ_MODIFIER); // Leagues mod @@ -16913,7 +16913,7 @@ int CvPlayer::specialistYield(SpecialistTypes eSpecialist, YieldTypes eYield) co if(pkSpecialistInfo == NULL) { //This function REQUIRES a valid specialist info. - CvAssert(pkSpecialistInfo); + ASSERT(pkSpecialistInfo); return 0; } @@ -16929,16 +16929,16 @@ int CvPlayer::specialistYield(SpecialistTypes eSpecialist, YieldTypes eYield) co /// How much additional Yield does every City produce? int CvPlayer::GetCityYieldChangeTimes100(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCityYieldChange[eYield]; } /// Changes how much additional Yield every City produces void CvPlayer::ChangeCityYieldChangeTimes100(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -16950,16 +16950,16 @@ void CvPlayer::ChangeCityYieldChangeTimes100(YieldTypes eYield, int iChange) /// How much additional Yield do coastal Cities produce? int CvPlayer::GetCoastalCityYieldChange(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCoastalCityYieldChange[eYield]; } /// Changes how much additional Yield coastal Cities produce void CvPlayer::ChangeCoastalCityYieldChange(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -16971,16 +16971,16 @@ void CvPlayer::ChangeCoastalCityYieldChange(YieldTypes eYield, int iChange) /// How much additional Yield does the Capital produce? int CvPlayer::GetCapitalYieldChangeTimes100(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCapitalYieldChange[eYield]; } /// Changes how much additional Yield the Capital produces void CvPlayer::ChangeCapitalYieldChangeTimes100(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -16992,16 +16992,16 @@ void CvPlayer::ChangeCapitalYieldChangeTimes100(YieldTypes eYield, int iChange) /// How much additional Yield does the Capital produce per pop? int CvPlayer::GetCapitalYieldPerPopChange(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCapitalYieldPerPopChange[eYield]; } /// Changes how much additional Yield the Capital produces per pop void CvPlayer::ChangeCapitalYieldPerPopChange(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -17013,16 +17013,16 @@ void CvPlayer::ChangeCapitalYieldPerPopChange(YieldTypes eYield, int iChange) /// How much additional Yield does the Capital produce per pop? int CvPlayer::GetCapitalYieldPerPopChangeEmpire(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCapitalYieldPerPopChangeEmpire[eYield]; } /// Changes how much additional Yield the Capital produces per pop void CvPlayer::ChangeCapitalYieldPerPopChangeEmpire(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -17036,16 +17036,16 @@ void CvPlayer::ChangeCapitalYieldPerPopChangeEmpire(YieldTypes eYield, int iChan /// How much additional Yield does a Great Work produce? int CvPlayer::GetGreatWorkYieldChange(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiGreatWorkYieldChange[eYield]; } /// Changes how much additional Yield a Great Work produces void CvPlayer::ChangeGreatWorkYieldChange(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -17062,8 +17062,8 @@ void CvPlayer::ChangeGreatWorkYieldChange(YieldTypes eYield, int iChange) int CvPlayer::getLakePlotYield(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); return m_aiLakePlotYield[eYield]; } @@ -17072,13 +17072,13 @@ int CvPlayer::getLakePlotYield(YieldTypes eYield) const void CvPlayer::changeLakePlotYield(YieldTypes eYield, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield expected to be >= 0"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); + ASSERT(eYield >= 0, "eYield expected to be >= 0"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { m_aiLakePlotYield[eYield] = m_aiLakePlotYield[eYield] + iChange; - CvAssert(getLakePlotYield(eYield) >= 0); + ASSERT(getLakePlotYield(eYield) >= 0); updateYield(); } } @@ -17136,7 +17136,7 @@ float CvPlayer::getAveragePopulation() const void CvPlayer::changeTotalPopulation(int iChange) { m_iTotalPopulation = (m_iTotalPopulation + iChange); - CvAssert(getTotalPopulation() >= 0); + ASSERT(getTotalPopulation() >= 0); } long CvPlayer::getRealPopulation() const @@ -17195,7 +17195,7 @@ int CvPlayer::getTotalLand() const void CvPlayer::changeTotalLand(int iChange) { m_iTotalLand = (m_iTotalLand + iChange); - CvAssert(getTotalLand() >= 0); + ASSERT(getTotalLand() >= 0); } int CvPlayer::getTotalLandScored() const @@ -17208,7 +17208,7 @@ void CvPlayer::changeTotalLandScored(int iChange) if(iChange != 0) { m_iTotalLandScored = (m_iTotalLandScored + iChange); - CvAssert(getTotalLandScored() >= 0); + ASSERT(getTotalLandScored() >= 0); } } @@ -17773,8 +17773,8 @@ void CvPlayer::ChangeNumCitiesFreeFoodBuilding(int iChange) /// Cities remaining to get a free building int CvPlayer::GetNumCitiesFreeChosenBuilding(BuildingClassTypes eBuildingClass) const { - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(eBuildingClass > -1, "Index out of bounds"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(eBuildingClass > -1, "Index out of bounds"); return m_paiNumCitiesFreeChosenBuilding[eBuildingClass]; } @@ -17787,8 +17787,8 @@ void CvPlayer::ChangeNumCitiesFreeChosenBuilding(BuildingClassTypes eBuildingCla // New Founded City waiting to get a free unit? bool CvPlayer::IsFreeUnitNewFoundCity(UnitClassTypes eUnitClass) const { - CvAssertMsg(eUnitClass < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(eUnitClass > -1, "Index out of bounds"); + ASSERT(eUnitClass < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(eUnitClass > -1, "Index out of bounds"); return (m_paiNewFoundCityFreeUnit[eUnitClass] > 0); } @@ -17801,8 +17801,8 @@ void CvPlayer::ChangeNewFoundCityFreeUnit(UnitClassTypes eUnitClass, int iChange // New Founded City waiting to get a free building? bool CvPlayer::IsFreeBuildingNewFoundCity(BuildingClassTypes eBuildingClass) const { - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(eBuildingClass > -1, "Index out of bounds"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(eBuildingClass > -1, "Index out of bounds"); return (m_paiNewFoundCityFreeBuilding[eBuildingClass] > 0); } @@ -17815,8 +17815,8 @@ void CvPlayer::ChangeNewFoundCityFreeBuilding(BuildingClassTypes eBuildingClass, // Cities remaining to get a free building bool CvPlayer::IsFreeChosenBuildingNewCity(BuildingClassTypes eBuildingClass) const { - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(eBuildingClass > -1, "Index out of bounds"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(eBuildingClass > -1, "Index out of bounds"); return (m_paiFreeChosenBuildingNewCity[eBuildingClass] > 0); } @@ -17829,8 +17829,8 @@ void CvPlayer::ChangeFreeChosenBuildingNewCity(BuildingClassTypes eBuildingClass // City waiting to get a free building? bool CvPlayer::IsFreeBuildingAllCity(BuildingClassTypes eBuildingClass) const { - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(eBuildingClass > -1, "Index out of bounds"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(eBuildingClass > -1, "Index out of bounds"); return (m_paiAllCityFreeBuilding[eBuildingClass] > 0); } @@ -17942,7 +17942,7 @@ void CvPlayer::DoTechFromCityConquer(CvCity* pConqueredCity) { uint uRoll = GC.getGame().urandLimitExclusive(vePossibleTechs.size(), GET_PLAYER(pConqueredCity->getOwner()).GetPseudoRandomSeed()); TechTypes eFreeTech = vePossibleTechs[uRoll]; - CvAssert(eFreeTech != NO_TECH) + ASSERT(eFreeTech != NO_TECH) if (eFreeTech != NO_TECH) { GET_TEAM(getTeam()).setHasTech(eFreeTech, true, GetID(), true, true); @@ -18029,7 +18029,7 @@ void CvPlayer::DoFreeGreatWorkOnConquest(CvCity* pCity) continue; int iDistance = plotDistance(pCity->getX(), pCity->getY(), pPlayerCity->getX(), pPlayerCity->getY()); - CvAssert(iDistance > 0); + ASSERT(iDistance > 0); for (int iBuildingClassLoop = 0; iBuildingClassLoop < GC.getNumBuildingClassInfos(); iBuildingClassLoop++) { BuildingClassTypes eBuildingClass = static_cast(iBuildingClassLoop); @@ -18101,7 +18101,7 @@ void CvPlayer::DoFreeGreatWorkOnConquest(CvCity* pCity) BuildingTypes eBuilding = pGWCity->GetBuildingTypeFromClass(eBuildingClass); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssert(pkBuildingInfo); + ASSERT(pkBuildingInfo); // Create the GW at the best slot BuildingClassTypes eNewBuildingClass = NO_BUILDINGCLASS; @@ -21059,7 +21059,7 @@ int CvPlayer::GetHappinessFromBuildings() const /// Changes amount of extra Happiness per City void CvPlayer::ChangeExtraHappinessPerCity(int iChange) { - CvAssertMsg(m_iHappinessPerCity >= 0, "Count of buildings helping Happiness is corrupted"); + ASSERT(m_iHappinessPerCity >= 0, "Count of buildings helping Happiness is corrupted"); if(iChange != 0) m_iHappinessPerCity += iChange; @@ -21074,7 +21074,7 @@ int CvPlayer::GetExtraHappinessPerXPolicies() const /// Changes amount of extra Happiness per City void CvPlayer::ChangeExtraHappinessPerXPolicies(int iChange) { - CvAssertMsg(m_iHappinessPerXPolicies >= 0, "Count of extra happiness per buildings is corrupted"); + ASSERT(m_iHappinessPerXPolicies >= 0, "Count of extra happiness per buildings is corrupted"); if(iChange != 0) m_iHappinessPerXPolicies += iChange; @@ -21090,7 +21090,7 @@ int CvPlayer::GetExtraHappinessPerXPoliciesFromPolicies() const void CvPlayer::ChangeExtraHappinessPerXPoliciesFromPolicies(int iChange) { m_iExtraHappinessPerXPoliciesFromPolicies += iChange; - CvAssertMsg(m_iExtraHappinessPerXPoliciesFromPolicies >= 0, "Count of extra happiness per buildings is corrupted"); + ASSERT(m_iExtraHappinessPerXPoliciesFromPolicies >= 0, "Count of extra happiness per buildings is corrupted"); } /// Returns the amount of extra Happiness per City @@ -21103,7 +21103,7 @@ int CvPlayer::GetHappinessPerXGreatWorks() const void CvPlayer::ChangeHappinessPerXGreatWorks(int iChange) { m_iHappinessPerXGreatWorks += iChange; - CvAssertMsg(m_iHappinessPerXGreatWorks >= 0, "Count of extra happiness per buildings is corrupted"); + ASSERT(m_iHappinessPerXGreatWorks >= 0, "Count of extra happiness per buildings is corrupted"); } int CvPlayer::GetHappinessFromResourceMonopolies() const @@ -21301,8 +21301,8 @@ int CvPlayer::GetHappinessFromNaturalWonders() const void CvPlayer::SetNaturalWonderOwned(FeatureTypes eFeature, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eEvent is expected to be within maximum bounds (invalid Index)"); vector::const_iterator it = std::find(m_ownedNaturalWonders.begin(), m_ownedNaturalWonders.end(), eFeature); @@ -21315,16 +21315,16 @@ void CvPlayer::SetNaturalWonderOwned(FeatureTypes eFeature, bool bValue) void CvPlayer::ChangeUnitClassProductionModifier(UnitClassTypes eUnitClass, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eUnitClass >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass expected to be < GC.getNumUnitClassInfos()"); + ASSERT(eUnitClass >= 0, "eIndex expected to be >= 0"); + ASSERT(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass expected to be < GC.getNumUnitClassInfos()"); m_paiUnitClassProductionModifiers[eUnitClass] = m_paiUnitClassProductionModifiers[eUnitClass] + iValue; } int CvPlayer::GetUnitClassProductionModifier(UnitClassTypes eUnitClass) const { VALIDATE_OBJECT - CvAssertMsg(eUnitClass >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass expected to be < GC.getNumUnitClassInfos()"); + ASSERT(eUnitClass >= 0, "eIndex expected to be >= 0"); + ASSERT(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass expected to be < GC.getNumUnitClassInfos()"); return m_paiUnitClassProductionModifiers[eUnitClass]; } @@ -22617,7 +22617,7 @@ void CvPlayer::CreateSpies(int iNumSpies, bool bScaling) return; CvPlayerEspionage* pEspionage = GetEspionage(); - CvAssertMsg(pEspionage, "pEspionage is null! What's up with that?!"); + ASSERT(pEspionage, "pEspionage is null! What's up with that?!"); if (!pEspionage) return; @@ -23015,7 +23015,7 @@ int CvPlayer::GetFaithToVotesTimes100() const void CvPlayer::ChangeFaithToVotesTimes100(int iChange) { m_iFaithToVotes = iChange; - CvAssert(m_iFaithToVotes >= 0); + ASSERT(m_iFaithToVotes >= 0); if (m_iFaithToVotes < 0) { m_iFaithToVotes = 0; @@ -23046,7 +23046,7 @@ int CvPlayer::GetCapitalsToVotes() const void CvPlayer::ChangeCapitalsToVotes(int iChange) { m_iCapitalsToVotes = iChange; - CvAssert(m_iCapitalsToVotes >= 0); + ASSERT(m_iCapitalsToVotes >= 0); if (m_iCapitalsToVotes < 0) { m_iCapitalsToVotes = 0; @@ -23075,7 +23075,7 @@ int CvPlayer::GetDoFToVotes() const void CvPlayer::ChangeDoFToVotes(int iChange) { m_iDoFToVotes = iChange; - CvAssert(m_iDoFToVotes >= 0); + ASSERT(m_iDoFToVotes >= 0); if (m_iDoFToVotes < 0) { m_iDoFToVotes = 0; @@ -23106,7 +23106,7 @@ int CvPlayer::GetRAToVotes() const void CvPlayer::ChangeRAToVotes(int iChange) { m_iRAToVotes = iChange; - CvAssert(m_iRAToVotes >= 0); + ASSERT(m_iRAToVotes >= 0); if (m_iRAToVotes < 0) { m_iRAToVotes = 0; @@ -23135,7 +23135,7 @@ int CvPlayer::GetDefensePactsToVotes() const void CvPlayer::ChangeDefensePactsToVotes(int iChange) { m_iDefensePactsToVotes = iChange; - CvAssert(m_iDefensePactsToVotes >= 0); + ASSERT(m_iDefensePactsToVotes >= 0); if (m_iDefensePactsToVotes < 0) { m_iDefensePactsToVotes = 0; @@ -23229,7 +23229,7 @@ int CvPlayer::GetImprovementLeagueVotes() const void CvPlayer::ChangeImprovementLeagueVotes(int iChange) { m_iImprovementLeagueVotes += iChange; - CvAssert(m_iImprovementLeagueVotes >= 0); + ASSERT(m_iImprovementLeagueVotes >= 0); if (m_iImprovementLeagueVotes < 0) { m_iImprovementLeagueVotes = 0; @@ -23779,8 +23779,8 @@ bool CvPlayer::swapPolicy(PolicyTypes iNewPolicy, PolicyTypes iOldPolicy) void CvPlayer::setHasPolicy(PolicyTypes eIndex, bool bNewValue, bool bFree) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (m_pPlayerPolicies->HasPolicy(eIndex) != bNewValue) { @@ -23808,7 +23808,7 @@ bool CvPlayer::canAdoptPolicy(PolicyTypes eIndex) const void CvPlayer::doAdoptPolicy(PolicyTypes ePolicy) { CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(ePolicy); - CvAssert(pkPolicyInfo != NULL); + ASSERT(pkPolicyInfo != NULL); if(pkPolicyInfo == NULL) return; @@ -23994,21 +23994,21 @@ void CvPlayer::ChangeTourismBonusTurns(int iChange) int CvPlayer::getTourismBonusTurnsPlayer(PlayerTypes eWithPlayer) const { - CvAssertMsg(eWithPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eWithPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eWithPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); + ASSERT(eWithPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); return m_aiTourismBonusTurnsPlayer[eWithPlayer]; } void CvPlayer::changeTourismBonusTurnsPlayer(PlayerTypes eWithPlayer, int iChange) { - CvAssertMsg(eWithPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eWithPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eWithPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); + ASSERT(eWithPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { m_aiTourismBonusTurnsPlayer[eWithPlayer] = m_aiTourismBonusTurnsPlayer[eWithPlayer] + iChange; - CvAssert(getTourismBonusTurnsPlayer(eWithPlayer) >= 0); + ASSERT(getTourismBonusTurnsPlayer(eWithPlayer) >= 0); } } @@ -24547,7 +24547,7 @@ void CvPlayer::changeGoldenAgeTurns(int iChange, bool bFree) int iThreshold = GetGoldenAgeProgressThreshold(); m_iGoldenAgeTurns += iChange; - CvAssert(m_iGoldenAgeTurns >= 0); + ASSERT(m_iGoldenAgeTurns >= 0); if (bOldGoldenAge != isGoldenAge()) { @@ -24722,7 +24722,7 @@ int CvPlayer::getNumUnitGoldenAges() const void CvPlayer::changeNumUnitGoldenAges(int iChange) { m_iNumUnitGoldenAges = (m_iNumUnitGoldenAges + iChange); - CvAssert(getNumUnitGoldenAges() >= 0); + ASSERT(getNumUnitGoldenAges() >= 0); } int CvPlayer::getStrikeTurns() const @@ -24733,7 +24733,7 @@ int CvPlayer::getStrikeTurns() const void CvPlayer::changeStrikeTurns(int iChange) { m_iStrikeTurns = (m_iStrikeTurns + iChange); - CvAssert(getStrikeTurns() >= 0); + ASSERT(getStrikeTurns() >= 0); } int CvPlayer::getGoldenAgeModifier(bool bCheckMonopolies) const @@ -27422,23 +27422,23 @@ void CvPlayer::doInstantYield(InstantYieldType iType, bool bCityFaith, GreatPers void CvPlayer::addInstantYieldText(InstantYieldType iType, const CvString& strInstantYield) { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); m_aistrInstantYield[iType] = m_aistrInstantYield[iType] + strInstantYield; } void CvPlayer::setInstantYieldText(InstantYieldType iType, const CvString& strInstantYield) { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); m_aistrInstantYield[iType] = strInstantYield; } CvString CvPlayer::getInstantYieldText(InstantYieldType iType) const { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); return m_aistrInstantYield[iType]; } void CvPlayer::doInstantGWAM(GreatPersonTypes eGreatPerson, const CvString& strName, bool bConquest) @@ -27943,8 +27943,8 @@ void CvPlayer::doInstantGreatPersonProgress(InstantYieldType iType, bool bSuppre void CvPlayer::addInstantGreatPersonProgressText(InstantYieldType iType, const CvString& strInstantYield) { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); std::map::iterator it = m_aistrInstantGreatPersonProgress.find((int)iType); if (it != m_aistrInstantGreatPersonProgress.end()) @@ -27959,8 +27959,8 @@ void CvPlayer::addInstantGreatPersonProgressText(InstantYieldType iType, const C void CvPlayer::setInstantGreatPersonProgressText(InstantYieldType iType, const CvString& strInstantYield) { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); std::map::iterator it = m_aistrInstantGreatPersonProgress.find((int)iType); if (it != m_aistrInstantGreatPersonProgress.end()) @@ -27975,8 +27975,8 @@ void CvPlayer::setInstantGreatPersonProgressText(InstantYieldType iType, const C CvString CvPlayer::getInstantGreatPersonProgressText(InstantYieldType iType) const { VALIDATE_OBJECT - CvAssertMsg(iType >= 0, "iType expected to be >= 0"); - CvAssertMsg(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); + ASSERT(iType >= 0, "iType expected to be >= 0"); + ASSERT(iType < NUM_INSTANT_YIELD_TYPES, "iType expected to be < NUM_INSTANT_YIELD_TYPES"); std::map::const_iterator it = m_aistrInstantGreatPersonProgress.find((int)iType); if (it != m_aistrInstantGreatPersonProgress.end()) @@ -28400,14 +28400,14 @@ void CvPlayer::ChangeGreatPeopleSpawnCounter(int iChange) /// Create a GreatPeople void CvPlayer::DoSpawnGreatPerson(PlayerTypes eMinor, bool bIsFree) { - CvAssertMsg(eMinor >= MAX_MAJOR_CIVS, "eMinor is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMinor < MAX_CIV_PLAYERS, "eMinor is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMinor >= MAX_MAJOR_CIVS, "eMinor is expected to be non-negative (invalid Index)"); + ASSERT(eMinor < MAX_CIV_PLAYERS, "eMinor is expected to be within maximum bounds (invalid Index)"); // Minor must have Capital CvCity* pMinorCapital = GET_PLAYER(eMinor).getCapitalCity(); if(pMinorCapital == NULL) { - FAssertMsg(false, "MINOR CIV AI: Trying to spawn a GreatPeople for a major civ but the minor has no capital. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(false, "MINOR CIV AI: Trying to spawn a GreatPeople for a major civ but the minor has no capital."); return; } @@ -28415,7 +28415,7 @@ void CvPlayer::DoSpawnGreatPerson(PlayerTypes eMinor, bool bIsFree) CvPlot* pMinorPlot = pMinorCapital->plot(); if(pMinorPlot == NULL) { - CvAssertMsg(false, "Plot for minor civ's capital not found! Please send Anton your save file and version."); + ASSERT(false, "Plot for minor civ's capital not found!"); return; } @@ -28463,7 +28463,7 @@ void CvPlayer::DoSpawnGreatPerson(PlayerTypes eMinor, bool bIsFree) if(eBestUnit != NO_UNIT) { CvUnit* pNewGreatPeople = initUnit(eBestUnit, iX, iY); - CvAssert(pNewGreatPeople); + ASSERT(pNewGreatPeople); if (pNewGreatPeople->IsGreatAdmiral()) { @@ -28855,7 +28855,7 @@ void CvPlayer::changeNumOutsideUnits(int iChange) if(iChange != 0) { m_iNumOutsideUnits += iChange; - CvAssert(getNumOutsideUnits() >= 0); + ASSERT(getNumOutsideUnits() >= 0); if(GetID() == GC.getGame().getActivePlayer()) { @@ -29090,7 +29090,7 @@ void CvPlayer::changeNumMilitaryUnits(int iChange, DomainTypes eDomain) if(iChange != 0) { m_iNumMilitaryUnits = (m_iNumMilitaryUnits + iChange); - CvAssert(getNumMilitaryUnits() >= 0); + ASSERT(getNumMilitaryUnits() >= 0); switch (eDomain) { @@ -29098,15 +29098,15 @@ void CvPlayer::changeNumMilitaryUnits(int iChange, DomainTypes eDomain) break; case DOMAIN_SEA: m_iNumMilitarySeaUnits = (m_iNumMilitarySeaUnits + iChange); - CvAssert(getNumMilitarySeaUnits() >= 0); + ASSERT(getNumMilitarySeaUnits() >= 0); break; case DOMAIN_AIR: m_iNumMilitaryAirUnits = (m_iNumMilitaryAirUnits + iChange); - CvAssert(getNumMilitaryAirUnits() >= 0); + ASSERT(getNumMilitaryAirUnits() >= 0); break; case DOMAIN_LAND: m_iNumMilitaryLandUnits = (m_iNumMilitaryLandUnits + iChange); - CvAssert(getNumMilitarySeaUnits() >= 0); + ASSERT(getNumMilitarySeaUnits() >= 0); break; case DOMAIN_IMMOBILE: break; @@ -29190,7 +29190,7 @@ int CvPlayer::getHappinessToCulture() const void CvPlayer::changeHappinessToCulture(int iChange) { m_iHappinessToCulture += iChange; - CvAssert(m_iHappinessToCulture >= 0); + ASSERT(m_iHappinessToCulture >= 0); } int CvPlayer::getHappinessToScience() const @@ -29201,7 +29201,7 @@ int CvPlayer::getHappinessToScience() const void CvPlayer::changeHappinessToScience(int iChange) { m_iHappinessToScience += iChange; - CvAssert(m_iHappinessToScience >= 0); + ASSERT(m_iHappinessToScience >= 0); } int CvPlayer::getHalfSpecialistUnhappinessCount() const @@ -29217,7 +29217,7 @@ bool CvPlayer::isHalfSpecialistUnhappiness() const void CvPlayer::changeHalfSpecialistUnhappinessCount(int iChange) { m_iHalfSpecialistUnhappinessCount += iChange; - CvAssert(m_iHalfSpecialistUnhappinessCount >= 0); + ASSERT(m_iHalfSpecialistUnhappinessCount >= 0); } int CvPlayer::getHalfSpecialistFoodCount() const @@ -29233,7 +29233,7 @@ bool CvPlayer::isHalfSpecialistFood() const void CvPlayer::changeHalfSpecialistFoodCount(int iChange) { m_iHalfSpecialistFoodCount += iChange; - CvAssert(m_iHalfSpecialistFoodCount >= 0); + ASSERT(m_iHalfSpecialistFoodCount >= 0); } #if defined(MOD_BALANCE_CORE) @@ -29250,7 +29250,7 @@ bool CvPlayer::isHalfSpecialistFoodCapital() const void CvPlayer::changeHalfSpecialistFoodCapitalCount(int iChange) { m_iHalfSpecialistFoodCapitalCount += iChange; - CvAssert(m_iHalfSpecialistFoodCapitalCount >= 0); + ASSERT(m_iHalfSpecialistFoodCapitalCount >= 0); } int CvPlayer::getTradeRouteLandDistanceModifier() const @@ -29261,7 +29261,7 @@ int CvPlayer::getTradeRouteLandDistanceModifier() const void CvPlayer::changeTradeRouteLandDistanceModifier(int iChange) { m_iTradeRouteLandDistanceModifier += iChange; - CvAssert(m_iTradeRouteLandDistanceModifier >= 0); + ASSERT(m_iTradeRouteLandDistanceModifier >= 0); } int CvPlayer::getTradeRouteSeaDistanceModifier() const @@ -29272,30 +29272,30 @@ int CvPlayer::getTradeRouteSeaDistanceModifier() const void CvPlayer::changeTradeRouteSeaDistanceModifier(int iChange) { m_iTradeRouteSeaDistanceModifier += iChange; - CvAssert(m_iTradeRouteSeaDistanceModifier >= 0); + ASSERT(m_iTradeRouteSeaDistanceModifier >= 0); } int CvPlayer::GetDomainFreeExperiencePerGreatWorkGlobal(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); return m_aiDomainFreeExperiencePerGreatWorkGlobal[eIndex]; } void CvPlayer::ChangeDomainFreeExperiencePerGreatWorkGlobal(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); m_aiDomainFreeExperiencePerGreatWorkGlobal[eIndex] = m_aiDomainFreeExperiencePerGreatWorkGlobal[eIndex] + iChange; } int CvPlayer::GetDomainFreeExperience(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); std::map::const_iterator it = m_piDomainFreeExperience.find((int)eIndex); if (it != m_piDomainFreeExperience.end()) // find returns the iterator to map::end if the key i is not present in the map @@ -29309,8 +29309,8 @@ int CvPlayer::GetDomainFreeExperience(DomainTypes eIndex) const void CvPlayer::ChangeDomainFreeExperience(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex expected to be < NUM_DOMAIN_TYPES"); m_piDomainFreeExperience[(int)eIndex] += iChange; } @@ -29376,7 +29376,7 @@ void CvPlayer::changeMilitaryFoodProductionCount(int iChange) if (iChange != 0) { m_iMilitaryFoodProductionCount += iChange; - CvAssert(m_iMilitaryFoodProductionCount >= 0); + ASSERT(m_iMilitaryFoodProductionCount >= 0); if (getTeam() == GC.getGame().getActiveTeam()) { @@ -29398,7 +29398,7 @@ bool CvPlayer::IsGoldenAgeCultureBonusDisabled() const void CvPlayer::ChangeGoldenAgeCultureBonusDisabledCount(int iChange) { m_iGoldenAgeCultureBonusDisabledCount += iChange; - CvAssert(m_iGoldenAgeCultureBonusDisabledCount >= 0); + ASSERT(m_iGoldenAgeCultureBonusDisabledCount >= 0); } void CvPlayer::ChangeNumMissionarySpreads(int iChange) @@ -29424,7 +29424,7 @@ bool CvPlayer::IsSecondReligionPantheon() const void CvPlayer::ChangeSecondReligionPantheonCount(int iChange) { m_iSecondReligionPantheonCount += iChange; - CvAssert(m_iSecondReligionPantheonCount >= 0); + ASSERT(m_iSecondReligionPantheonCount >= 0); } int CvPlayer::GetEnablesSSPartHurryCount() const @@ -29440,7 +29440,7 @@ bool CvPlayer::IsEnablesSSPartHurry() const void CvPlayer::ChangeEnablesSSPartHurryCount(int iChange) { m_iEnablesSSPartHurryCount += iChange; - CvAssert(m_iEnablesSSPartHurryCount >= 0); + ASSERT(m_iEnablesSSPartHurryCount >= 0); } int CvPlayer::GetEnablesSSPartPurchaseCount() const @@ -29456,7 +29456,7 @@ bool CvPlayer::IsEnablesSSPartPurchase() const void CvPlayer::ChangeEnablesSSPartPurchaseCount(int iChange) { m_iEnablesSSPartPurchaseCount += iChange; - CvAssert(m_iEnablesSSPartPurchaseCount >= 0); + ASSERT(m_iEnablesSSPartPurchaseCount >= 0); } int CvPlayer::getHighestUnitLevel() const @@ -29467,7 +29467,7 @@ int CvPlayer::getHighestUnitLevel() const void CvPlayer::setHighestUnitLevel(int iNewValue) { m_iHighestUnitLevel = iNewValue; - CvAssert(m_iHighestUnitLevel >= 0); + ASSERT(m_iHighestUnitLevel >= 0); } int CvPlayer::getOverflowResearch() const @@ -29496,7 +29496,7 @@ void CvPlayer::setOverflowResearchTimes100(int iNewValue) return; m_iOverflowResearch = iNewValue; - CvAssert(m_iOverflowResearch >= 0); + ASSERT(m_iOverflowResearch >= 0); } void CvPlayer::changeOverflowResearchTimes100(int iChange) @@ -29515,7 +29515,7 @@ int CvPlayer::getExpModifier() const void CvPlayer::changeExpModifier(int iChange) { m_iExpModifier += iChange; - CvAssert(m_iExpModifier >= 0); + ASSERT(m_iExpModifier >= 0); } int CvPlayer::getExpInBorderModifier() const @@ -29526,7 +29526,7 @@ int CvPlayer::getExpInBorderModifier() const void CvPlayer::changeExpInBorderModifier(int iChange) { m_iExpInBorderModifier += iChange; - CvAssert(m_iExpInBorderModifier >= 0); + ASSERT(m_iExpInBorderModifier >= 0); } int CvPlayer::getLevelExperienceModifier() const @@ -29547,7 +29547,7 @@ int CvPlayer::getMinorQuestFriendshipMod() const void CvPlayer::changeMinorQuestFriendshipMod(int iChange) { m_iMinorQuestFriendshipMod += iChange; - CvAssert(m_iMinorQuestFriendshipMod >= 0); + ASSERT(m_iMinorQuestFriendshipMod >= 0); } int CvPlayer::getMinorGoldFriendshipMod() const @@ -29558,7 +29558,7 @@ int CvPlayer::getMinorGoldFriendshipMod() const void CvPlayer::changeMinorGoldFriendshipMod(int iChange) { m_iMinorGoldFriendshipMod += iChange; - CvAssert(m_iMinorGoldFriendshipMod >= 0); + ASSERT(m_iMinorGoldFriendshipMod >= 0); } /// What is the general modifier we get towards the resting Influence point with a city-state? (ex. Social Policies) @@ -29944,15 +29944,15 @@ int CvPlayer::GetProsperityScore() const bool CvPlayer::PlayerHasContract(ContractTypes eContract) const { VALIDATE_OBJECT - CvAssertMsg(eContract >= 0, "eContract expected to be >= 0"); - CvAssertMsg(eContract < GC.getNumContractInfos(), "eContract expected to be < GC.GetNumContractInfos()"); + ASSERT(eContract >= 0, "eContract expected to be >= 0"); + ASSERT(eContract < GC.getNumContractInfos(), "eContract expected to be < GC.GetNumContractInfos()"); return m_abActiveContract[eContract]; } void CvPlayer::SetActiveContract(ContractTypes eContract, bool bValue) { VALIDATE_OBJECT - CvAssertMsg(eContract >= 0, "eContract expected to be >= 0"); - CvAssertMsg(eContract < GC.getNumContractInfos(), "eContract expected to be < GC.GetNumContractInfos()"); + ASSERT(eContract >= 0, "eContract expected to be >= 0"); + ASSERT(eContract < GC.getNumContractInfos(), "eContract expected to be < GC.GetNumContractInfos()"); if (m_abActiveContract[eContract] != bValue) { m_abActiveContract[eContract] = bValue; @@ -30184,8 +30184,8 @@ int CvPlayer::GetEventTourism() const void CvPlayer::SetGlobalTourismAlreadyReceived(MinorCivQuestTypes eQuest, int iValue) { - CvAssertMsg(eQuest >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eQuest < NUM_MINOR_CIV_QUEST_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eQuest >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eQuest < NUM_MINOR_CIV_QUEST_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(iValue != 0) { m_aiGlobalTourismAlreadyReceived[eQuest] = iValue; @@ -30193,8 +30193,8 @@ void CvPlayer::SetGlobalTourismAlreadyReceived(MinorCivQuestTypes eQuest, int iV } int CvPlayer::GlobalTourismAlreadyReceived(MinorCivQuestTypes eQuest) const { - CvAssertMsg(eQuest >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eQuest < NUM_MINOR_CIV_QUEST_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eQuest >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eQuest < NUM_MINOR_CIV_QUEST_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiGlobalTourismAlreadyReceived[eQuest]; } @@ -30764,7 +30764,7 @@ void CvPlayer::setCultureBombTimer(int iNewValue) if(getCultureBombTimer() != iNewValue) { m_iCultureBombTimer = iNewValue; - CvAssert(getCultureBombTimer() >= 0); + ASSERT(getCultureBombTimer() >= 0); } } @@ -30783,7 +30783,7 @@ void CvPlayer::setConversionTimer(int iNewValue) if(getConversionTimer() != iNewValue) { m_iConversionTimer = iNewValue; - CvAssert(getConversionTimer() >= 0); + ASSERT(getConversionTimer() >= 0); if(GetID() == GC.getGame().getActivePlayer()) { @@ -31972,7 +31972,7 @@ int CvPlayer::getCombatExperienceTimes100() const void CvPlayer::setCombatExperienceTimes100(int iExperienceTimes100, CvUnit* pFromUnit) { - CvAssert(iExperienceTimes100 >= 0); + ASSERT(iExperienceTimes100 >= 0); if (iExperienceTimes100 != getCombatExperienceTimes100()) { @@ -32084,7 +32084,7 @@ int CvPlayer::getNavalCombatExperienceTimes100() const void CvPlayer::setNavalCombatExperienceTimes100(int iExperienceTimes100, CvUnit* pFromUnit) { - CvAssert(iExperienceTimes100 >= 0); + ASSERT(iExperienceTimes100 >= 0); if (iExperienceTimes100 != getNavalCombatExperienceTimes100()) { @@ -32254,7 +32254,7 @@ void CvPlayer::changeBorderObstacleCount(int iChange) if(iChange != 0) { m_iBorderObstacleCount = (m_iBorderObstacleCount + iChange); - CvAssert(getBorderObstacleCount() >= 0); + ASSERT(getBorderObstacleCount() >= 0); } } @@ -32710,7 +32710,7 @@ bool CvPlayer::isTurnActive() const void CvPlayer::setTurnActiveForPbem(bool bActive) { - CvAssertMsg(GC.getGame().isPbem(), "You are using setTurnActiveForPbem. Are you sure you know what you're doing?"); + ASSERT(GC.getGame().isPbem(), "You are using setTurnActiveForPbem. Are you sure you know what you're doing?"); // does nothing more than to set the member variable before saving the game // the rest of the turn will be performed upon loading the game @@ -32757,7 +32757,7 @@ void CvPlayer::setTurnActive(bool bNewValue, bool bDoTurn) // R: bDoTurn default if(isTurnActive()) { - CvAssertMsg(isAlive(), "isAlive is expected to be true"); + ASSERT(isAlive(), "isAlive is expected to be true"); setEndTurn(false); @@ -32923,7 +32923,7 @@ void CvPlayer::setTurnActive(bool bNewValue, bool bDoTurn) // R: bDoTurn default GAMEEVENTINVOKE_HOOK(GAMEEVENT_PlayerDoneTurn, GetID()); } - CvAssertFmt(GetEndTurnBlockingType() == NO_ENDTURN_BLOCKING_TYPE, "Expecting the end-turn blocking to be NO_ENDTURN_BLOCKING_TYPE, got %d", GetEndTurnBlockingType()); + ASSERT(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. //important: healing and restoration of movement points @@ -33114,7 +33114,7 @@ void CvPlayer::setEndTurn(bool bNewValue) //} } - CvAssertMsg(isTurnActive(), "isTurnActive is expected to be true"); + ASSERT(isTurnActive(), "isTurnActive is expected to be true"); m_bEndTurn = bNewValue; @@ -33383,7 +33383,7 @@ const CvHandicapInfo& CvPlayer::getHandicapInfo() const { const char* szError = "ERROR: Player does not contain valid handicap!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } @@ -33405,7 +33405,7 @@ const CvCivilizationInfo& CvPlayer::getCivilizationInfo() const { const char* szError = "ERROR: Player does not contain valid civilization type!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } @@ -33427,7 +33427,7 @@ const CvLeaderHeadInfo& CvPlayer::getLeaderInfo() const { const char* szError = "ERROR: Player does not contain valid leader type!!"; GC.LogMessage(szError); - CvAssertMsg(false, szError); + ASSERT(false, szError); return emptyResult; } @@ -33488,8 +33488,8 @@ EraTypes CvPlayer::GetCurrentEra() const void CvPlayer::setTeam(TeamTypes eTeam) { - CvAssert(eTeam != NO_TEAM); - CvAssert(getTeam() != NO_TEAM); + ASSERT(eTeam != NO_TEAM); + ASSERT(getTeam() != NO_TEAM); if(isAlive()) { GET_TEAM(getTeam()).changeAliveCount(-1); @@ -33550,7 +33550,7 @@ PlayerColorTypes CvPlayer::getPlayerColor() const const CvColorA& CvPlayer::getPlayerTextColor() const { - CvAssertMsg(getPlayerColor() != NO_PLAYERCOLOR, "getPlayerColor() is not expected to be equal with NO_PLAYERCOLOR"); + ASSERT(getPlayerColor() != NO_PLAYERCOLOR, "getPlayerColor() is not expected to be equal with NO_PLAYERCOLOR"); CvPlayerColorInfo* pkPlayerColorInfo = GC.GetPlayerColorInfo(getPlayerColor()); CvColorInfo* pkColorInfo = NULL; if(pkPlayerColorInfo) @@ -33568,15 +33568,15 @@ const CvColorA& CvPlayer::getPlayerTextColor() const int CvPlayer::getSeaPlotYield(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiSeaPlotYield[eIndex]; } void CvPlayer::changeSeaPlotYield(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33587,15 +33587,15 @@ void CvPlayer::changeSeaPlotYield(YieldTypes eIndex, int iChange) int CvPlayer::getYieldRateModifier(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldRateModifier[eIndex]; } void CvPlayer::changeYieldRateModifier(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33622,15 +33622,15 @@ void CvPlayer::changeTradeReligionModifier(int iChange) int CvPlayer::getYieldFromBirth(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromBirth[eIndex]; } void CvPlayer::changeYieldFromBirth(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33647,15 +33647,15 @@ void CvPlayer::changeYieldFromBirth(YieldTypes eIndex, int iChange) int CvPlayer::getYieldFromBirthCapital(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromBirthCapital[eIndex]; } void CvPlayer::changeYieldFromBirthCapital(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33672,15 +33672,15 @@ void CvPlayer::changeYieldFromBirthCapital(YieldTypes eIndex, int iChange) int CvPlayer::getYieldFromDeath(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromDeath[eIndex]; } void CvPlayer::changeYieldFromDeath(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -33698,16 +33698,16 @@ void CvPlayer::changeYieldFromDeath(YieldTypes eIndex, int iChange) int CvPlayer::GetYieldFromPillage(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromPillage[eIndex]; } /// Extra yield from building void CvPlayer::ChangeYieldFromPillage(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33725,16 +33725,16 @@ void CvPlayer::ChangeYieldFromPillage(YieldTypes eIndex, int iChange) int CvPlayer::GetYieldFromVictory(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromVictory[eIndex]; } /// Extra yield from building void CvPlayer::ChangeYieldFromVictory(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33751,14 +33751,14 @@ void CvPlayer::ChangeYieldFromVictory(YieldTypes eIndex, int iChange) int CvPlayer::getYieldFromConstruction(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromConstruction[eIndex]; } void CvPlayer::changeYieldFromConstruction(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33775,15 +33775,15 @@ void CvPlayer::changeYieldFromConstruction(YieldTypes eIndex, int iChange) int CvPlayer::GetYieldFromWorldWonderConstruction(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromWorldWonderConstruction[eIndex]; } void CvPlayer::ChangeYieldFromWorldWonderConstruction(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33800,15 +33800,15 @@ void CvPlayer::ChangeYieldFromWorldWonderConstruction(YieldTypes eIndex, int iCh int CvPlayer::getYieldFromTech(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromTech[eIndex]; } void CvPlayer::changeYieldFromTech(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33825,15 +33825,15 @@ void CvPlayer::changeYieldFromTech(YieldTypes eIndex, int iChange) int CvPlayer::getYieldFromBorderGrowth(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldFromBorderGrowth[eIndex]; } void CvPlayer::changeYieldFromBorderGrowth(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33850,14 +33850,14 @@ void CvPlayer::changeYieldFromBorderGrowth(YieldTypes eIndex, int iChange) int CvPlayer::getYieldGPExpend(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiYieldGPExpend[eIndex]; } void CvPlayer::changeYieldGPExpend(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33874,15 +33874,15 @@ void CvPlayer::changeYieldGPExpend(YieldTypes eIndex, int iChange) int CvPlayer::getConquerorYield(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiConquerorYield[eIndex]; } void CvPlayer::changeConquerorYield(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33899,15 +33899,15 @@ void CvPlayer::changeConquerorYield(YieldTypes eIndex, int iChange) int CvPlayer::getFounderYield(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiFounderYield[eIndex]; } void CvPlayer::changeFounderYield(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -33924,99 +33924,99 @@ void CvPlayer::changeFounderYield(YieldTypes eIndex, int iChange) int CvPlayer::getArtifactYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiArtifactYieldBonus[eIndex]; } void CvPlayer::changeArtifactYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiArtifactYieldBonus[eIndex] += iChange; } int CvPlayer::getArtYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiArtYieldBonus[eIndex]; } void CvPlayer::changeArtYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiArtYieldBonus[eIndex] += iChange; } int CvPlayer::getMusicYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiMusicYieldBonus[eIndex]; } void CvPlayer::changeMusicYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiMusicYieldBonus[eIndex] += iChange; } int CvPlayer::getLitYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiLitYieldBonus[eIndex]; } void CvPlayer::changeLitYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiLitYieldBonus[eIndex] += iChange; } int CvPlayer::getFilmYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiFilmYieldBonus[eIndex]; } void CvPlayer::changeFilmYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiFilmYieldBonus[eIndex] += iChange; } int CvPlayer::getRelicYieldBonus(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiRelicYieldBonus[eIndex]; } void CvPlayer::changeRelicYieldBonus(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiRelicYieldBonus[eIndex] += iChange; } int CvPlayer::getGoldenAgeYieldMod(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiGoldenAgeYieldMod[eIndex]; } void CvPlayer::changeGoldenAgeYieldMod(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34067,15 +34067,15 @@ int CvPlayer::GetSciencePerTurnFromPassiveSpyBonusesTimes100() const int CvPlayer::GetNumAnnexedCityStates(MinorCivTraitTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_MINOR_CIV_TRAIT_TYPES, "eIndex expected to be < NUM_MINOR_CIV_TRAIT_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_MINOR_CIV_TRAIT_TYPES, "eIndex expected to be < NUM_MINOR_CIV_TRAIT_TYPES"); return m_aiNumAnnexedCityStates[eIndex]; } void CvPlayer::ChangeNumAnnexedCityStates(MinorCivTraitTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_MINOR_CIV_TRAIT_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_MINOR_CIV_TRAIT_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34093,15 +34093,15 @@ void CvPlayer::ChangeNumAnnexedCityStates(MinorCivTraitTypes eIndex, int iChange int CvPlayer::getYieldFromNonSpecialistCitizens(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromNonSpecialistCitizens[eIndex]; } void CvPlayer::changeYieldFromNonSpecialistCitizens(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34118,15 +34118,15 @@ void CvPlayer::changeYieldFromNonSpecialistCitizens(YieldTypes eIndex, int iChan int CvPlayer::getYieldModifierFromGreatWorks(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldModifierFromGreatWorks[eIndex]; } void CvPlayer::changeYieldModifierFromGreatWorks(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34143,15 +34143,15 @@ void CvPlayer::changeYieldModifierFromGreatWorks(YieldTypes eIndex, int iChange) int CvPlayer::getYieldModifierFromActiveSpies(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldModifierFromActiveSpies[eIndex]; } void CvPlayer::changeYieldModifierFromActiveSpies(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34168,15 +34168,15 @@ void CvPlayer::changeYieldModifierFromActiveSpies(YieldTypes eIndex, int iChange int CvPlayer::getYieldFromDelegateCount(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromDelegateCount[eIndex]; } void CvPlayer::changeYieldFromDelegateCount(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34193,15 +34193,15 @@ void CvPlayer::changeYieldFromDelegateCount(YieldTypes eIndex, int iChange) int CvPlayer::getYieldFromXMilitaryUnits(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldFromXMilitaryUnits[eIndex]; } void CvPlayer::changeYieldFromXMilitaryUnits(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34218,15 +34218,15 @@ void CvPlayer::changeYieldFromXMilitaryUnits(YieldTypes eIndex, int iChange) int CvPlayer::getYieldPerCityOverStrengthThreshold(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldPerCityOverStrengthThreshold[eIndex]; } void CvPlayer::changeYieldPerCityOverStrengthThreshold(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34243,29 +34243,29 @@ void CvPlayer::changeYieldPerCityOverStrengthThreshold(YieldTypes eIndex, int iC int CvPlayer::getYieldForLiberation(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldForLiberation[eIndex]; } void CvPlayer::changeYieldForLiberation(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiYieldForLiberation[eIndex] += iChange; } int CvPlayer::getYieldForSpyID(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiYieldForSpyID[eIndex]; } void CvPlayer::changeYieldForSpyID(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiYieldForSpyID[eIndex] += iChange; } @@ -34315,8 +34315,8 @@ int CvPlayer::getNumBuildingClassInLiberatedCities(BuildingClassTypes eIndex) co void CvPlayer::changeNumBuildingClassInLiberatedCities(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex expected to be < GC.getNumBuildingClassInfos()"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex expected to be < GC.getNumBuildingClassInfos()"); m_aiBuildingClassInLiberatedCities[eIndex] += iChange; } @@ -34332,15 +34332,15 @@ void CvPlayer::changeUnitsInLiberatedCities(int iChange) int CvPlayer::getReligionYieldRateModifier(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiReligionYieldRateModifier[eIndex]; } void CvPlayer::changeReligionYieldRateModifier(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34641,17 +34641,17 @@ void CvPlayer::changeCityStateCombatModifier(int iChange) int CvPlayer::getBuildingClassCultureChange(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassCulture[eIndex]; } void CvPlayer::changeBuildingClassCultureChange(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCulture[eIndex] = m_paiBuildingClassCulture[eIndex] + iChange; - CvAssert(getBuildingClassCultureChange(eIndex) >= 0); + ASSERT(getBuildingClassCultureChange(eIndex) >= 0); } void CvPlayer::changeMaxAirUnits(int iChange) @@ -34667,26 +34667,26 @@ int CvPlayer::getMaxAirUnits() const /// Extra yield for a improvement this city is working? int CvPlayer::GetImprovementExtraYield(ImprovementTypes eImprovement, YieldTypes eYield) const { - CvAssertMsg(eImprovement >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eYield >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiImprovementYieldChange[eImprovement][eYield]; } void CvPlayer::ChangeImprovementExtraYield(ImprovementTypes eImprovement, YieldTypes eYield, int iChange) { - CvAssertMsg(eImprovement >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eYield >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eImprovement >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { Firaxis::Array yields = m_ppiImprovementYieldChange[eImprovement]; yields[eYield] = (m_ppiImprovementYieldChange[eImprovement][eYield] + iChange); m_ppiImprovementYieldChange[eImprovement] = yields; - CvAssert(GetImprovementExtraYield(eImprovement, eYield) >= 0); + ASSERT(GetImprovementExtraYield(eImprovement, eYield) >= 0); updateYield(); } @@ -34784,8 +34784,8 @@ void CvPlayer::changeAdmiralLuxuryBonus(int iChange) UnitClassTypes CvPlayer::GetUnitClassReplacement(UnitClassTypes eUnitClass) const { - CvAssertMsg((int)eUnitClass >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg((int)eUnitClass < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT((int)eUnitClass >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT((int)eUnitClass < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); std::map::const_iterator it = m_piUnitClassReplacements.find(eUnitClass); if (it != m_piUnitClassReplacements.end()) // find returns the iterator to map::end if the key i is not present in the map @@ -34801,11 +34801,11 @@ UnitClassTypes CvPlayer::GetUnitClassReplacement(UnitClassTypes eUnitClass) cons void CvPlayer::SetUnitClassReplacement(UnitClassTypes eReplacedUnitClass, UnitClassTypes eReplacementUnitClass) { - CvAssertMsg((int)eReplacedUnitClass >= 0, "eReplacedUnitClass is expected to be non-negative (invalid Index)"); - CvAssertMsg((int)eReplacedUnitClass < GC.getNumUnitClassInfos(), "eReplacedUnitClass is expected to be within maximum bounds (invalid Index)"); + ASSERT((int)eReplacedUnitClass >= 0, "eReplacedUnitClass is expected to be non-negative (invalid Index)"); + ASSERT((int)eReplacedUnitClass < GC.getNumUnitClassInfos(), "eReplacedUnitClass is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg((int)eReplacementUnitClass >= 0, "eReplacementUnitClass is expected to be non-negative (invalid Index)"); - CvAssertMsg((int)eReplacementUnitClass < GC.getNumUnitClassInfos(), "eReplacementUnitClass is expected to be within maximum bounds (invalid Index)"); + ASSERT((int)eReplacementUnitClass >= 0, "eReplacementUnitClass is expected to be non-negative (invalid Index)"); + ASSERT((int)eReplacementUnitClass < GC.getNumUnitClassInfos(), "eReplacementUnitClass is expected to be within maximum bounds (invalid Index)"); if (eReplacedUnitClass != NO_UNITCLASS) { @@ -34883,15 +34883,15 @@ int CvPlayer::GetScalingNationalPopulationRequired(BuildingTypes eBuilding) cons int CvPlayer::getCapitalYieldRateModifier(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiCapitalYieldRateModifier[eIndex]; } void CvPlayer::changeCapitalYieldRateModifier(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -34902,8 +34902,8 @@ void CvPlayer::changeCapitalYieldRateModifier(YieldTypes eIndex, int iChange) int CvPlayer::getExtraYieldThreshold(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiExtraYieldThreshold[eIndex]; } @@ -34911,15 +34911,15 @@ void CvPlayer::updateExtraYieldThreshold(YieldTypes eIndex) { int iBestValue = 0; - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); iBestValue = GetPlayerTraits()->GetExtraYieldThreshold(eIndex); if(getExtraYieldThreshold(eIndex) != iBestValue) { m_aiExtraYieldThreshold[eIndex] = iBestValue; - CvAssert(getExtraYieldThreshold(eIndex) >= 0); + ASSERT(getExtraYieldThreshold(eIndex) >= 0); updateYield(); } @@ -35080,8 +35080,8 @@ int CvPlayer::GetScienceFromBudgetDeficitTimes100() const bool CvPlayer::IsGetsScienceFromPlayer(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= MAX_MAJOR_CIVS, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= MAX_MAJOR_CIVS, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_CIV_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); // Might have global modifier if(IsMinorScienceAllies() && GET_PLAYER(ePlayer).GetMinorCivAI()->IsAllies(GetID())) @@ -35094,8 +35094,8 @@ bool CvPlayer::IsGetsScienceFromPlayer(PlayerTypes ePlayer) const void CvPlayer::SetGetsScienceFromPlayer(PlayerTypes ePlayer, bool bNewValue) { - CvAssertMsg(ePlayer >= MAX_MAJOR_CIVS, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= MAX_MAJOR_CIVS, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_CIV_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); if(bNewValue != m_pabGetsScienceFromPlayer[ePlayer]) { @@ -35160,15 +35160,15 @@ void CvPlayer::DoBankruptcy() int CvPlayer::getSpecialistExtraYield(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiSpecialistExtraYield[eIndex]; } void CvPlayer::changeSpecialistExtraYield(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -35189,7 +35189,7 @@ void CvPlayer::changeSpecialistExtraYield(YieldTypes eIndex, int iChange) } m_aiSpecialistExtraYield[eIndex] += iChange; - CvAssert(m_aiSpecialistExtraYield[eIndex] >= 0); + ASSERT(m_aiSpecialistExtraYield[eIndex] >= 0); // Then add them back! for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop)) @@ -35732,21 +35732,21 @@ int CvPlayer::GetUnhappinessFromWarWearinessWithTeam(TeamTypes eTeam) const /// Returns how "close" we are to another player (useful for diplomacy, war planning, etc.) PlayerProximityTypes CvPlayer::GetProximityToPlayer(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); return (PlayerProximityTypes) m_aiProximityToPlayer[ePlayer]; } /// Sets how "close" we are to another player (useful for diplomacy, war planning, etc.) void CvPlayer::SetProximityToPlayer(PlayerTypes ePlayer, PlayerProximityTypes eProximity) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(GetID() != ePlayer, "Trying to calculate proximity to oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(GetID() != ePlayer, "Trying to calculate proximity to oneself."); - CvAssertMsg(eProximity >= NO_PLAYER_PROXIMITY, "eIndex is expected to be non-negative (invalid Index)"); // NO_PLAYER_PROXIMITY is valid because some players may have no Cities (e.g. on the first turn) - CvAssertMsg(eProximity < NUM_PLAYER_PROXIMITIES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eProximity >= NO_PLAYER_PROXIMITY, "eIndex is expected to be non-negative (invalid Index)"); // NO_PLAYER_PROXIMITY is valid because some players may have no Cities (e.g. on the first turn) + ASSERT(eProximity < NUM_PLAYER_PROXIMITIES, "eIndex is expected to be within maximum bounds (invalid Index)"); if((GC.getLogging() && GC.getAILogging())) { @@ -35985,18 +35985,18 @@ void CvPlayer::UpdateResearchAgreements(int iValue) /// Get the beakers accumulated during the RA with a player int CvPlayer::GetResearchAgreementCounter(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiResearchAgreementCounter[ePlayer]; } /// Set the beakers accumulated during the RA with a player void CvPlayer::SetResearchAgreementCounter(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(GetID() != ePlayer, "Trying to make a RA Agreement with oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(GetID() != ePlayer, "Trying to make a RA Agreement with oneself."); m_aiResearchAgreementCounter[ePlayer] = iValue; } @@ -36047,7 +36047,7 @@ void CvPlayer::DoCivilianReturnLogic(bool bReturn, PlayerTypes eToPlayer, int iU { pUnit->kill(true); CvUnit* pNewUnit = GET_PLAYER(eToPlayer).initUnit(eNewUnitType, iX, iY); - CvAssert(pNewUnit != NULL); + ASSERT(pNewUnit != NULL); if (pNewUnit) { if (!pNewUnit->jumpToNearestValidPlot()) @@ -36241,7 +36241,7 @@ void CvPlayer::DoCivilianReturnLogic(bool bReturn, PlayerTypes eToPlayer, int iU } else { pUnit->kill(true); CvUnit* pNewUnit = initUnit(eNewUnitType, iX, iY); - CvAssert(pNewUnit != NULL); + ASSERT(pNewUnit != NULL); if (pNewUnit) pNewUnit->finishMoves(); } @@ -36250,7 +36250,7 @@ void CvPlayer::DoCivilianReturnLogic(bool bReturn, PlayerTypes eToPlayer, int iU { pUnit->kill(true); CvUnit* pNewUnit = initUnit(eNewUnitType, iX, iY); - CvAssert(pNewUnit != NULL); + ASSERT(pNewUnit != NULL); if (pNewUnit) pNewUnit->finishMoves(); } @@ -36327,18 +36327,18 @@ void CvPlayer::DoDistanceGift(PlayerTypes eFromPlayer, CvUnit* pUnit) /// Someone sent us a present! void CvPlayer::AddIncomingUnit(PlayerTypes eFromPlayer, CvUnit* pUnit) { - CvAssert(pUnit); + ASSERT(pUnit); if (!pUnit) { return; } // Gift to a minor civ for friendship if(isMinorCiv() && GET_PLAYER(eFromPlayer).isMajorCiv()) { CvMinorCivAI* pMinorCivAI = GetMinorCivAI(); - CvAssert(pMinorCivAI); + ASSERT(pMinorCivAI); if (pMinorCivAI) { CvMinorCivIncomingUnitGift& unitGift = pMinorCivAI->getIncomingUnitGift(eFromPlayer); - CvAssertMsg(!unitGift.hasIncomingUnit(), "Adding incoming unit when one is already on its way. Please send Anton your save file and version."); + ASSERT(!unitGift.hasIncomingUnit(), "Adding incoming unit when one is already on its way."); if (!unitGift.hasIncomingUnit()) { unitGift.init(*pUnit, /*3*/ GD_INT_GET(MINOR_UNIT_GIFT_TRAVEL_TURNS), eFromPlayer); @@ -36362,7 +36362,7 @@ void CvPlayer::AddIncomingUnit(PlayerTypes eFromPlayer, CvUnit* pUnit) if(eType != NO_UNIT) { CvUnit* pNewUnit = initUnit(eType, iX, iY); - CvAssert(pNewUnit); + ASSERT(pNewUnit); if (pNewUnit) { if (!pUnit->getUnitInfo().CanMoveAfterPurchase()) @@ -36378,7 +36378,7 @@ void CvPlayer::AddIncomingUnit(PlayerTypes eFromPlayer, CvUnit* pUnit) } else { - CvAssertMsg(false, "Unexpected case for adding an incoming unit for this player. Please send Anton your save file and version."); + ASSERT(false, "Unexpected case for adding an incoming unit for this player."); } } //AI Routine for Gifting @@ -36802,21 +36802,21 @@ void CvPlayer::removeResourcesOnPlotFromTotal(CvPlot* pPlot, bool bOnlyExtraReso int CvPlayer::getNumResourceUnimproved(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiNumResourceUnimproved[eIndex]; } void CvPlayer::changeNumResourceUnimproved(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); if (iChange != 0) { m_paiNumResourceUnimproved[eIndex] = m_paiNumResourceUnimproved[eIndex] + iChange; } - CvAssert(m_paiNumResourceUnimproved[eIndex] >= 0); + ASSERT(m_paiNumResourceUnimproved[eIndex] >= 0); } void CvPlayer::addResourcesOnPlotToUnimproved(CvPlot* pPlot, bool bOnlyExtraResources, bool bIgnoreTechPrereq) { @@ -36858,14 +36858,14 @@ void CvPlayer::removeResourcesOnPlotFromUnimproved(CvPlot* pPlot, bool bOnlyExtr int CvPlayer::getNumResourceUsed(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiNumResourceUsed[eIndex]; } void CvPlayer::changeNumResourceUsed(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); if(iChange != 0) { @@ -36874,13 +36874,13 @@ void CvPlayer::changeNumResourceUsed(ResourceTypes eIndex, int iChange) GC.GetEngineUserInterface()->setDirty(GameData_DIRTY_BIT, true); - CvAssert(m_paiNumResourceUsed[eIndex] >= 0); + ASSERT(m_paiNumResourceUsed[eIndex] >= 0); } int CvPlayer::getNumResourcesFromOther(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvResourceInfo *pkResource = GC.getResourceInfo(eIndex); @@ -36968,16 +36968,16 @@ int CvPlayer::getNumResourcesFromOther(ResourceTypes eIndex) const int CvPlayer::getNumResourceFromBuildings(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiNumResourceFromBuildings[eIndex]; } int CvPlayer::getNumResourceTotal(ResourceTypes eIndex, bool bIncludeImport) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvResourceInfo *pkResource = GC.getResourceInfo(eIndex); @@ -37003,20 +37003,20 @@ int CvPlayer::getNumResourceTotal(ResourceTypes eIndex, bool bIncludeImport) con } void CvPlayer::changeNumResourceTotal(ResourceTypes eIndex, int iChange, bool bFromBuilding, bool bCheckForMonopoly, bool /*bIgnoreResourceWarning*/) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); if(iChange != 0) { if (!bFromBuilding) { m_paiNumResourceFromTiles[eIndex] = m_paiNumResourceFromTiles[eIndex] + iChange; - CvAssert(m_paiNumResourceFromTiles[eIndex] >= 0); + ASSERT(m_paiNumResourceFromTiles[eIndex] >= 0); } else { m_paiNumResourceFromBuildings[eIndex] = m_paiNumResourceFromBuildings[eIndex] + iChange; - CvAssert(m_paiNumResourceFromBuildings[eIndex] >= 0); + ASSERT(m_paiNumResourceFromBuildings[eIndex] >= 0); } if (iChange > 0) @@ -37101,16 +37101,16 @@ void CvPlayer::changeNumResourceTotal(ResourceTypes eIndex, int iChange, bool bF int CvPlayer::GetHighestResourceQuantity(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiHighestResourceQuantity[eIndex]; } void CvPlayer::SetHighestResourceQuantity(ResourceTypes eIndex, int iValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiHighestResourceQuantity[eIndex] = iValue; } @@ -37150,15 +37150,15 @@ void CvPlayer::CheckForLuxuryResourceGainInstantYields(ResourceTypes eResource) #if defined(MOD_BALANCE_CORE_RESOURCE_MONOPOLIES) int CvPlayer::getResourceShortageValue(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiResourceShortageValue[eIndex]; } void CvPlayer::changeResourceShortageValue(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); if(iChange != 0) { @@ -37167,37 +37167,37 @@ void CvPlayer::changeResourceShortageValue(ResourceTypes eIndex, int iChange) GC.GetEngineUserInterface()->setDirty(GameData_DIRTY_BIT, true); - CvAssert(m_paiResourceShortageValue[eIndex] >= 0); + ASSERT(m_paiResourceShortageValue[eIndex] >= 0); } void CvPlayer::setResourceShortageValue(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); m_paiResourceShortageValue[eIndex] = iChange; GC.GetEngineUserInterface()->setDirty(GameData_DIRTY_BIT, true); - CvAssert(m_paiResourceShortageValue[eIndex] >= 0); + ASSERT(m_paiResourceShortageValue[eIndex] >= 0); } int CvPlayer::getResourceFromCSAlliances(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiResourceFromCSAlliances[eIndex]; } void CvPlayer::changeResourceFromCSAlliances(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); if (iChange != 0) { m_paiResourceFromCSAlliances[eIndex] = m_paiResourceFromCSAlliances[eIndex] + iChange; - CvAssert(m_paiResourceFromCSAlliances[eIndex] >= 0); + ASSERT(m_paiResourceFromCSAlliances[eIndex] >= 0); if (iChange > 0) CheckForLuxuryResourceGainInstantYields(eIndex); @@ -37208,14 +37208,14 @@ void CvPlayer::changeResourceFromCSAlliances(ResourceTypes eIndex, int iChange) void CvPlayer::setResourceFromCSAlliances(ResourceTypes eIndex, int iChange) { - CvAssert(eIndex >= 0); - CvAssert(eIndex < GC.getNumResourceInfos()); + ASSERT(eIndex >= 0); + ASSERT(eIndex < GC.getNumResourceInfos()); m_paiResourceFromCSAlliances[eIndex] = iChange; GC.GetEngineUserInterface()->setDirty(GameData_DIRTY_BIT, true); - CvAssert(m_paiResourceFromCSAlliances[eIndex] >= 0); + ASSERT(m_paiResourceFromCSAlliances[eIndex] >= 0); } bool CvPlayer::IsResourceNotForSale(ResourceTypes eResource) @@ -37333,8 +37333,8 @@ void CvPlayer::CompleteAccomplishment(AccomplishmentTypes eAccomplishment) int CvPlayer::getResourceModFromReligion(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iQuantityMod = 0; @@ -37828,16 +37828,16 @@ bool CvPlayer::WouldGainMonopoly(ResourceTypes eResource, int iExtraResource) co int CvPlayer::getCityYieldModFromMonopoly(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); return m_aiCityYieldModFromMonopoly[eIndex]; } void CvPlayer::changeCityYieldModFromMonopoly(YieldTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex >= 0, "eIndex expected to be >= 0"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { @@ -37960,8 +37960,8 @@ CvImprovementEntry* CvPlayer::GetResourceImprovement(ResourceTypes eResource, bo /// Do we get copies of each type of luxury connected by eFromPlayer? int CvPlayer::getSiphonLuxuryCount(PlayerTypes eFromPlayer) const { - CvAssertMsg(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFromPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); + ASSERT(eFromPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); return m_aiSiphonLuxuryCount[eFromPlayer]; } @@ -37969,13 +37969,13 @@ int CvPlayer::getSiphonLuxuryCount(PlayerTypes eFromPlayer) const /// Change number of copies we get of luxury types connected by eFromPlayer void CvPlayer::changeSiphonLuxuryCount(PlayerTypes eFromPlayer, int iChange) { - CvAssertMsg(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFromPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFromPlayer >= 0, "eFromPlayer is expected to be non-negative (invalid Index)"); + ASSERT(eFromPlayer < MAX_PLAYERS, "eFromPlayer is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { m_aiSiphonLuxuryCount[eFromPlayer] = m_aiSiphonLuxuryCount[eFromPlayer] + iChange; - CvAssert(getSiphonLuxuryCount(eFromPlayer) >= 0); + ASSERT(getSiphonLuxuryCount(eFromPlayer) >= 0); UpdateResourcesSiphoned(); } @@ -38090,41 +38090,41 @@ void CvPlayer::ChangeStrategicResourceMod(int iChange) int CvPlayer::getNumResourceAvailable(ResourceTypes eIndex, bool bIncludeImport) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return getNumResourceTotal(eIndex, bIncludeImport) - getNumResourceUsed(eIndex); } int CvPlayer::getResourceGiftedToMinors(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiResourceGiftedToMinors[eIndex]; } void CvPlayer::changeResourceGiftedToMinors(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiResourceGiftedToMinors[eIndex] = m_paiResourceGiftedToMinors[eIndex] + iChange; - CvAssert(getResourceGiftedToMinors(eIndex) >= 0); + ASSERT(getResourceGiftedToMinors(eIndex) >= 0); } } int CvPlayer::getResourceExport(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiResourceExport[eIndex]; } void CvPlayer::changeResourceExport(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -38133,7 +38133,7 @@ void CvPlayer::changeResourceExport(ResourceTypes eIndex, int iChange) if (m_paiResourceExport[eIndex] <= 0) m_paiResourceExport[eIndex] = 0; - CvAssert(getResourceExport(eIndex) >= 0); + ASSERT(getResourceExport(eIndex) >= 0); CalculateNetHappiness(); } @@ -38141,15 +38141,15 @@ void CvPlayer::changeResourceExport(ResourceTypes eIndex, int iChange) int CvPlayer::getResourceImportFromMajor(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiResourceImportFromMajor[eIndex]; } void CvPlayer::changeResourceImportFromMajor(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -38158,7 +38158,7 @@ void CvPlayer::changeResourceImportFromMajor(ResourceTypes eIndex, int iChange) if (m_paiResourceImportFromMajor[eIndex] <= 0) m_paiResourceImportFromMajor[eIndex] = 0; - CvAssert(getResourceImportFromMajor(eIndex) >= 0); + ASSERT(getResourceImportFromMajor(eIndex) >= 0); CalculateNetHappiness(); @@ -38171,8 +38171,8 @@ void CvPlayer::changeResourceImportFromMajor(ResourceTypes eIndex, int iChange) int CvPlayer::getResourceFromMinors(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iNumResourceFromMinors = m_paiResourceFromMinors[eIndex]; int iModifier = 0; @@ -38190,13 +38190,13 @@ int CvPlayer::getResourceFromMinors(ResourceTypes eIndex) const void CvPlayer::changeResourceFromMinors(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiResourceFromMinors[eIndex] = m_paiResourceFromMinors[eIndex] + iChange; - CvAssert(getResourceFromMinors(eIndex) >= 0); + ASSERT(getResourceFromMinors(eIndex) >= 0); CalculateNetHappiness(); @@ -38207,8 +38207,8 @@ void CvPlayer::changeResourceFromMinors(ResourceTypes eIndex, int iChange) int CvPlayer::getResourceSiphoned(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iNumResourceSiphoned = m_paiResourcesSiphoned[eIndex]; @@ -38217,13 +38217,13 @@ int CvPlayer::getResourceSiphoned(ResourceTypes eIndex) const void CvPlayer::changeResourceSiphoned(ResourceTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { m_paiResourcesSiphoned[eIndex] = m_paiResourcesSiphoned[eIndex] + iChange; - CvAssert(getResourceSiphoned(eIndex) >= 0); + ASSERT(getResourceSiphoned(eIndex) >= 0); CalculateNetHappiness(); } @@ -38231,16 +38231,16 @@ void CvPlayer::changeResourceSiphoned(ResourceTypes eIndex, int iChange) byte CvPlayer::getResourceFromGP(ResourceTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiNumResourceFromGP[eIndex]; } void CvPlayer::changeResourceFromGP(ResourceTypes eIndex, byte iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -38252,8 +38252,8 @@ void CvPlayer::changeResourceFromGP(ResourceTypes eIndex, byte iChange) int CvPlayer::getResourceInOwnedPlots(ResourceTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumResourceInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iCount = 0; @@ -38337,13 +38337,13 @@ int CvPlayer::getTotalImprovementsBuilt() const void CvPlayer::changeTotalImprovementsBuilt(int iChange) { m_iTotalImprovementsBuilt = (m_iTotalImprovementsBuilt + iChange); - CvAssert(getTotalImprovementsBuilt() >= 0); + ASSERT(getTotalImprovementsBuilt() >= 0); } int CvPlayer::getImprovementCount(ImprovementTypes eIndex, bool bBuiltOnly) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (bBuiltOnly) return m_paiImprovementBuiltCount[eIndex]; else @@ -38352,41 +38352,41 @@ int CvPlayer::getImprovementCount(ImprovementTypes eIndex, bool bBuiltOnly) cons void CvPlayer::changeImprovementCount(ImprovementTypes eIndex, int iChange, bool bBuilt) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiImprovementCount[eIndex] += iChange; - CvAssert(getImprovementCount(eIndex) >= 0); + ASSERT(getImprovementCount(eIndex) >= 0); if (bBuilt) { m_paiImprovementBuiltCount[eIndex] += iChange; - CvAssert(getImprovementCount(eIndex, true) >= 0); + ASSERT(getImprovementCount(eIndex, true) >= 0); } } #if defined(MOD_BALANCE_CORE) int CvPlayer::getTotalImprovementsBuilt(ImprovementTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiTotalImprovementsBuilt[eIndex]; } void CvPlayer::changeTotalImprovementsBuilt(ImprovementTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiTotalImprovementsBuilt[eIndex] = m_paiTotalImprovementsBuilt[eIndex] + iChange; - CvAssert(getTotalImprovementsBuilt(eIndex) >= 0); + ASSERT(getTotalImprovementsBuilt(eIndex) >= 0); } #endif #if defined(MOD_IMPROVEMENTS_EXTENSIONS) int CvPlayer::getResponsibleForRouteCount(RouteTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumRouteInfos() , "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumRouteInfos() , "eIndex is expected to be within maximum bounds (invalid Index)"); std::map::const_iterator it = m_piResponsibleForRouteCount.find(eIndex); if (it != m_piResponsibleForRouteCount.end()) // find returns the iterator to map::end if the key eIndex is not present in the map @@ -38399,8 +38399,8 @@ int CvPlayer::getResponsibleForRouteCount(RouteTypes eIndex) const void CvPlayer::changeResponsibleForRouteCount(RouteTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piResponsibleForRouteCount[eIndex] += iChange; @@ -38409,12 +38409,12 @@ void CvPlayer::changeResponsibleForRouteCount(RouteTypes eIndex, int iChange) m_piResponsibleForRouteCount.erase(eIndex); } - CvAssert(getResponsibleForRouteCount(eIndex) >= 0); + ASSERT(getResponsibleForRouteCount(eIndex) >= 0); } int CvPlayer::getResponsibleForImprovementCount(ImprovementTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); std::map::const_iterator it = m_piResponsibleForImprovementCount.find(eIndex); if (it != m_piResponsibleForImprovementCount.end()) // find returns the iterator to map::end if the key eIndex is not present in the map @@ -38427,8 +38427,8 @@ int CvPlayer::getResponsibleForImprovementCount(ImprovementTypes eIndex) const void CvPlayer::changeResponsibleForImprovementCount(ImprovementTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumImprovementInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piResponsibleForImprovementCount[eIndex] += iChange; @@ -38437,7 +38437,7 @@ void CvPlayer::changeResponsibleForImprovementCount(ImprovementTypes eIndex, int m_piResponsibleForImprovementCount.erase(eIndex); } - CvAssert(getResponsibleForImprovementCount(eIndex) >= 0); + ASSERT(getResponsibleForImprovementCount(eIndex) >= 0); } #endif @@ -38458,8 +38458,8 @@ int CvPlayer::getGreatPersonImprovementCount() int CvPlayer::getFreeBuildingCount(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiFreeBuildingCount[eIndex]; } @@ -38470,13 +38470,13 @@ bool CvPlayer::isBuildingFree(BuildingTypes eIndex) const void CvPlayer::changeFreeBuildingCount(BuildingTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { m_paiFreeBuildingCount[eIndex] += iChange; - CvAssert(getFreeBuildingCount(eIndex) >= 0); + ASSERT(getFreeBuildingCount(eIndex) >= 0); // Immediately grant/remove the free buildings in all cities // Max 1 free building per city @@ -38493,8 +38493,8 @@ void CvPlayer::changeFreeBuildingCount(BuildingTypes eIndex, int iChange) /// How many sources have added ePromotion as a free promotion? int CvPlayer::GetFreePromotionCount(PromotionTypes ePromotion) const { - CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); + ASSERT(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); return m_paiFreePromotionCount[ePromotion]; } @@ -38507,15 +38507,15 @@ bool CvPlayer::IsFreePromotion(PromotionTypes ePromotion) const /// Add another source of ePromotion to the free promotion list void CvPlayer::ChangeFreePromotionCount(PromotionTypes ePromotion, int iChange) { - CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); + ASSERT(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { bool bWasFree = IsFreePromotion(ePromotion); m_paiFreePromotionCount[ePromotion] += iChange; - CvAssert(m_paiFreePromotionCount[ePromotion] >= 0); + ASSERT(m_paiFreePromotionCount[ePromotion] >= 0); // This promotion is now set to be free, but wasn't before we called this function if (IsFreePromotion(ePromotion) && !bWasFree) @@ -38540,43 +38540,43 @@ void CvPlayer::ChangeFreePromotionCount(PromotionTypes ePromotion, int iChange) int CvPlayer::getUnitCombatProductionModifiers(UnitCombatTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitCombatProductionModifiers[eIndex]; } void CvPlayer::changeUnitCombatProductionModifiers(UnitCombatTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitCombatProductionModifiers[eIndex] += iChange; } int CvPlayer::getUnitCombatFreeExperiences(UnitCombatTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitCombatFreeExperiences[eIndex]; } void CvPlayer::changeUnitCombatFreeExperiences(UnitCombatTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitCombatFreeExperiences[eIndex] += iChange; } int CvPlayer::getUnitClassCount(UnitClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitClassCount[eIndex]; } bool CvPlayer::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eIndex); if(pkUnitClassInfo == NULL) @@ -38586,12 +38586,12 @@ bool CvPlayer::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const if(isUnitLimitPerCity(eIndex)) { - CvAssertMsg(getUnitClassCount(eIndex) <= (getNumCities() * pkUnitClassInfo->getUnitInstancePerCity()), "getUnitInstancePerCity is expected to be less than maximum bound of UnitInstancePerCity (invalid index)"); + ASSERT(getUnitClassCount(eIndex) <= (getNumCities() * pkUnitClassInfo->getUnitInstancePerCity()), "getUnitInstancePerCity is expected to be less than maximum bound of UnitInstancePerCity (invalid index)"); return ((getUnitClassCount(eIndex) + iExtra) >= (getNumCities() * pkUnitClassInfo->getUnitInstancePerCity())); } else if(isNationalUnitClass(eIndex)) { - CvAssertMsg(getUnitClassCount(eIndex) <= pkUnitClassInfo->getMaxPlayerInstances(), "getUnitClassCount is expected to be less than maximum bound of MaxPlayerInstances (invalid index)"); + ASSERT(getUnitClassCount(eIndex) <= pkUnitClassInfo->getMaxPlayerInstances(), "getUnitClassCount is expected to be less than maximum bound of MaxPlayerInstances (invalid index)"); return ((getUnitClassCount(eIndex) + iExtra) >= pkUnitClassInfo->getMaxPlayerInstances()); } else @@ -38602,28 +38602,28 @@ bool CvPlayer::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const void CvPlayer::changeUnitClassCount(UnitClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitClassCount[eIndex] = m_paiUnitClassCount[eIndex] + iChange; - CvAssert(getUnitClassCount(eIndex) >= 0); + ASSERT(getUnitClassCount(eIndex) >= 0); } int CvPlayer::getUnitClassMaking(UnitClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitClassMaking[eIndex]; } void CvPlayer::changeUnitClassMaking(UnitClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiUnitClassMaking[eIndex] = m_paiUnitClassMaking[eIndex] + iChange; - CvAssert(getUnitClassMaking(eIndex) >= 0); + ASSERT(getUnitClassMaking(eIndex) >= 0); const CvCivilizationInfo& playerCivilizationInfo = getCivilizationInfo(); UnitTypes eUnit = static_cast(playerCivilizationInfo.getCivilizationUnits(eIndex)); @@ -38665,20 +38665,20 @@ int CvPlayer::getUnitClassCountPlusMaking(UnitClassTypes eIndex) const int CvPlayer::getBuildingClassCount(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassCount[eIndex]; } bool CvPlayer::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvBuildingClassInfo* pkBuildingClassInfo = GC.getBuildingClassInfo(eIndex); if(pkBuildingClassInfo == NULL) { - CvAssertMsg(false, "This should never happen..."); + ASSERT(false, "This should never happen..."); return false; } @@ -38687,35 +38687,35 @@ bool CvPlayer::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) co return false; } - CvAssertMsg(getBuildingClassCount(eIndex) <= (pkBuildingClassInfo->getMaxPlayerInstances() + pkBuildingClassInfo->getExtraPlayerInstances()), "BuildingClassCount is expected to be less than or match the number of max player instances plus extra player instances"); + ASSERT(getBuildingClassCount(eIndex) <= (pkBuildingClassInfo->getMaxPlayerInstances() + pkBuildingClassInfo->getExtraPlayerInstances()), "BuildingClassCount is expected to be less than or match the number of max player instances plus extra player instances"); return ((getBuildingClassCount(eIndex) + iExtra) >= (pkBuildingClassInfo->getMaxPlayerInstances() + pkBuildingClassInfo->getExtraPlayerInstances())); } void CvPlayer::changeBuildingClassCount(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCount[eIndex] = m_paiBuildingClassCount[eIndex] + iChange; - CvAssert(getBuildingClassCount(eIndex) >= 0); + ASSERT(getBuildingClassCount(eIndex) >= 0); } int CvPlayer::getBuildingClassMaking(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassMaking[eIndex]; } void CvPlayer::changeBuildingClassMaking(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiBuildingClassMaking[eIndex] = m_paiBuildingClassMaking[eIndex] + iChange; - CvAssert(getBuildingClassMaking(eIndex) >= 0); + ASSERT(getBuildingClassMaking(eIndex) >= 0); const BuildingTypes eBuilding = (BuildingTypes) getCivilizationInfo().getCivilizationBuildings(eIndex); CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding); @@ -38753,20 +38753,20 @@ int CvPlayer::getBuildingClassCountPlusMaking(BuildingClassTypes eIndex) const // Check out CvTeam::getProjectMaking() for something used more int CvPlayer::getProjectMaking(ProjectTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiProjectMaking[eIndex]; } void CvPlayer::changeProjectMaking(ProjectTypes eIndex, int iChange, CvCity* pCity) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiProjectMaking[eIndex] = m_paiProjectMaking[eIndex] + iChange; - CvAssert(getProjectMaking(eIndex) >= 0); + ASSERT(getProjectMaking(eIndex) >= 0); // Update the amount of a Resource used up by Projects in Production for(int iResourceLoop = 0; iResourceLoop < GC.getNumResourceInfos(); iResourceLoop++) @@ -38810,22 +38810,22 @@ void CvPlayer::changeProjectMaking(ProjectTypes eIndex, int iChange, CvCity* pCi int CvPlayer::getHurryModifier(HurryTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiHurryModifier[eIndex]; } void CvPlayer::changeHurryModifier(HurryTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumHurryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiHurryModifier[eIndex] += iChange; } void CvPlayer::setResearchingTech(TechTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(m_pPlayerTechs->IsResearchingTech(eIndex) != bNewValue) { @@ -38840,26 +38840,26 @@ void CvPlayer::setResearchingTech(TechTypes eIndex, bool bNewValue) int CvPlayer::getSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); return m_ppaaiSpecialistExtraYield[eIndex1][eIndex2]; } void CvPlayer::changeSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < GC.getNumSpecialistInfos(), "eIndex1 expected to be < GC.getNumSpecialistInfos()"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { Firaxis::Array yields = m_ppaaiSpecialistExtraYield[eIndex1]; yields[eIndex2] = m_ppaaiSpecialistExtraYield[eIndex1][eIndex2] + iChange; m_ppaaiSpecialistExtraYield[eIndex1] = yields; - CvAssert(m_ppaaiSpecialistExtraYield[eIndex1][eIndex2] >= 0); + ASSERT(m_ppaaiSpecialistExtraYield[eIndex1][eIndex2] >= 0); updateExtraSpecialistYield(); } @@ -38867,53 +38867,53 @@ void CvPlayer::changeSpecialistExtraYield(SpecialistTypes eIndex1, YieldTypes eI int CvPlayer::getYieldFromYieldGlobal(YieldTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); return m_ppiYieldFromYieldGlobal[eIndex1][eIndex2]; } void CvPlayer::changeYieldFromYieldGlobal(YieldTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 expected to be >= 0"); - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 expected to be >= 0"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex1 >= 0, "eIndex1 expected to be >= 0"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "eIndex1 expected to be < NUM_YIELD_TYPES"); + ASSERT(eIndex2 >= 0, "eIndex2 expected to be >= 0"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 expected to be < NUM_YIELD_TYPES"); if (iChange != 0) { Firaxis::Array yields = m_ppiYieldFromYieldGlobal[eIndex1]; yields[eIndex2] = (m_ppiYieldFromYieldGlobal[eIndex1][eIndex2] + iChange); m_ppiYieldFromYieldGlobal[eIndex1] = yields; - CvAssert(getYieldFromYieldGlobal(eIndex1, eIndex2) >= 0); + ASSERT(getYieldFromYieldGlobal(eIndex1, eIndex2) >= 0); } } int CvPlayer::getPlotYieldChange(PlotTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumPlotInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumPlotInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiPlotYieldChange[eIndex1][eIndex2]; } void CvPlayer::changePlotYieldChange(PlotTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumPlotInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumPlotInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiPlotYieldChange[eIndex1]; yields[eIndex2] = m_ppiPlotYieldChange[eIndex1][eIndex2] + iChange; m_ppiPlotYieldChange[eIndex1] = yields; - CvAssert(m_ppiPlotYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiPlotYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -38921,28 +38921,28 @@ void CvPlayer::changePlotYieldChange(PlotTypes eIndex1, YieldTypes eIndex2, int int CvPlayer::getFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiFeatureYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiFeatureYieldChange[eIndex1]; yields[eIndex2] = m_ppiFeatureYieldChange[eIndex1][eIndex2] + iChange; m_ppiFeatureYieldChange[eIndex1] = yields; - CvAssert(m_ppiFeatureYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiFeatureYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -38950,28 +38950,28 @@ void CvPlayer::changeFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2 int CvPlayer::getCityYieldFromUnimprovedFeature(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiCityYieldFromUnimprovedFeature[eIndex1][eIndex2]; } void CvPlayer::changeCityYieldFromUnimprovedFeature(FeatureTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiCityYieldFromUnimprovedFeature[eIndex1]; yields[eIndex2] = m_ppiCityYieldFromUnimprovedFeature[eIndex1][eIndex2] + iChange; m_ppiCityYieldFromUnimprovedFeature[eIndex1] = yields; - CvAssert(m_ppiCityYieldFromUnimprovedFeature[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiCityYieldFromUnimprovedFeature[eIndex1][eIndex2] >= 0); updateYield(); } @@ -38979,28 +38979,28 @@ void CvPlayer::changeCityYieldFromUnimprovedFeature(FeatureTypes eIndex1, YieldT int CvPlayer::getUnimprovedFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiUnimprovedFeatureYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeUnimprovedFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiUnimprovedFeatureYieldChange[eIndex1]; yields[eIndex2] = m_ppiUnimprovedFeatureYieldChange[eIndex1][eIndex2] + iChange; m_ppiUnimprovedFeatureYieldChange[eIndex1] = yields; - CvAssert(m_ppiUnimprovedFeatureYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiUnimprovedFeatureYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39008,28 +39008,28 @@ void CvPlayer::changeUnimprovedFeatureYieldChange(FeatureTypes eIndex1, YieldTyp int CvPlayer::getResourceYieldChange(ResourceTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumResourceInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumResourceInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiResourceYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeResourceYieldChange(ResourceTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumResourceInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumResourceInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiResourceYieldChange[eIndex1]; yields[eIndex2] = m_ppiResourceYieldChange[eIndex1][eIndex2] + iChange; m_ppiResourceYieldChange[eIndex1] = yields; - CvAssert(m_ppiResourceYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiResourceYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39037,28 +39037,28 @@ void CvPlayer::changeResourceYieldChange(ResourceTypes eIndex1, YieldTypes eInde int CvPlayer::getTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiTerrainYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppiTerrainYieldChange[eIndex1]; yields[eIndex2] = m_ppiTerrainYieldChange[eIndex1][eIndex2] + iChange; m_ppiTerrainYieldChange[eIndex1] = yields; - CvAssert(m_ppiTerrainYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiTerrainYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39066,26 +39066,26 @@ void CvPlayer::changeTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2 int CvPlayer::getTradeRouteYieldChange(DomainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiTradeRouteYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeTradeRouteYieldChange(DomainTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < NUM_DOMAIN_TYPES, "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { Firaxis::Array yields = m_ppiTradeRouteYieldChange[eIndex1]; yields[eIndex2] = m_ppiTradeRouteYieldChange[eIndex1][eIndex2] + iChange; m_ppiTradeRouteYieldChange[eIndex1] = yields; - CvAssert(m_ppiTradeRouteYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiTradeRouteYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39093,26 +39093,26 @@ void CvPlayer::changeTradeRouteYieldChange(DomainTypes eIndex1, YieldTypes eInde int CvPlayer::getGreatPersonExpendedYield(GreatPersonTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumGreatPersonInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumGreatPersonInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppiGreatPersonExpendedYield[eIndex1][eIndex2]; } void CvPlayer::changeGreatPersonExpendedYield(GreatPersonTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumGreatPersonInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumGreatPersonInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { Firaxis::Array yields = m_ppiGreatPersonExpendedYield[eIndex1]; yields[eIndex2] = m_ppiGreatPersonExpendedYield[eIndex1][eIndex2] + iChange; m_ppiGreatPersonExpendedYield[eIndex1] = yields; - CvAssert(m_ppiGreatPersonExpendedYield[eIndex1][eIndex2] >= 0); + ASSERT(m_ppiGreatPersonExpendedYield[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39120,57 +39120,57 @@ void CvPlayer::changeGreatPersonExpendedYield(GreatPersonTypes eIndex1, YieldTyp int CvPlayer::getGoldenAgeGreatPersonRateModifier(GreatPersonTypes eGreatPerson) const { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piGoldenAgeGreatPersonRateModifier[eGreatPerson]; } void CvPlayer::changeGoldenAgeGreatPersonRateModifier(GreatPersonTypes eGreatPerson, int iChange) { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piGoldenAgeGreatPersonRateModifier[eGreatPerson] += iChange; } int CvPlayer::GetYieldFromKills(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldFromKills[eYield]; } void CvPlayer::changeYieldFromKills(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_piYieldFromKills[eYield] += iChange; } int CvPlayer::GetYieldFromBarbarianKills(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldFromBarbarianKills[eYield]; } void CvPlayer::changeYieldFromBarbarianKills(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_piYieldFromBarbarianKills[eYield] += iChange; } int CvPlayer::GetYieldChangeTradeRoute(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldChangeTradeRoute[eYield]; } void CvPlayer::ChangeYieldChangeTradeRoute(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -39181,15 +39181,15 @@ void CvPlayer::ChangeYieldChangeTradeRoute(YieldTypes eYield, int iChange) int CvPlayer::GetYieldChangesNaturalWonder(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldChangesNaturalWonder[eYield]; } void CvPlayer::ChangeYieldChangesNaturalWonder(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -39200,16 +39200,16 @@ void CvPlayer::ChangeYieldChangesNaturalWonder(YieldTypes eYield, int iChange) int CvPlayer::GetYieldChangesPerReligionTimes100(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldChangesPerReligion[eYield]; } void CvPlayer::ChangeYieldChangesPerReligionTimes100(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -39220,15 +39220,15 @@ void CvPlayer::ChangeYieldChangesPerReligionTimes100(YieldTypes eYield, int iCha int CvPlayer::GetYieldChangeWorldWonder(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldChangeWorldWonder[eYield]; } void CvPlayer::ChangeYieldChangeWorldWonder(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { @@ -39239,29 +39239,29 @@ void CvPlayer::ChangeYieldChangeWorldWonder(YieldTypes eYield, int iChange) int CvPlayer::GetYieldFromMinorDemand(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldFromMinorDemand[eYield]; } void CvPlayer::ChangeYieldFromMinorDemand(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_piYieldFromMinorDemand[eYield] += iChange; } int CvPlayer::GetYieldFromWLTKD(YieldTypes eYield) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piYieldFromWLTKD[eYield]; } void CvPlayer::ChangeYieldFromWLTKD(YieldTypes eYield, int iChange) { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_piYieldFromWLTKD[eYield] += iChange; } @@ -39269,11 +39269,11 @@ void CvPlayer::ChangeYieldFromWLTKD(YieldTypes eYield, int iChange) /// Does the player get a great person rate modifier from having a monopoly? int CvPlayer::getSpecificGreatPersonRateModifierFromMonopoly(GreatPersonTypes eGreatPerson, MonopolyTypes eMonopoly) const { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (eGreatPerson != NO_GREATPERSON && eMonopoly != NO_MONOPOLY) { @@ -39294,8 +39294,8 @@ int CvPlayer::getSpecificGreatPersonRateModifierFromMonopoly(GreatPersonTypes eG /// Overload to sum up modifiers from both global (including global monopoly mod percent) and strategic monopolies, for convenience int CvPlayer::getSpecificGreatPersonRateModifierFromMonopoly(GreatPersonTypes eGreatPerson) const { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iMod = 0; int iTemp = 0; @@ -39321,11 +39321,11 @@ int CvPlayer::getSpecificGreatPersonRateModifierFromMonopoly(GreatPersonTypes eG void CvPlayer::changeSpecificGreatPersonRateModifierFromMonopoly(GreatPersonTypes eGreatPerson, MonopolyTypes eMonopoly, int iChange) { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0 && eGreatPerson != NO_GREATPERSON && eMonopoly != NO_MONOPOLY) { @@ -39336,11 +39336,11 @@ void CvPlayer::changeSpecificGreatPersonRateModifierFromMonopoly(GreatPersonType /// Does the player get a great person rate modifier from having a monopoly? int CvPlayer::getSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes eGreatPerson, MonopolyTypes eMonopoly) const { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (eGreatPerson != NO_GREATPERSON && eMonopoly != NO_MONOPOLY) { @@ -39361,8 +39361,8 @@ int CvPlayer::getSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes eGre /// Overload to sum up modifiers from both global (including global monopoly mod flat) and strategic monopolies, for convenience int CvPlayer::getSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes eGreatPerson) const { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); int iChange = 0; int iTemp = 0; @@ -39388,11 +39388,11 @@ int CvPlayer::getSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes eGre void CvPlayer::changeSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes eGreatPerson, MonopolyTypes eMonopoly, int iChange) { - CvAssertMsg(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eGreatPerson >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eMonopoly >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eMonopoly < NUM_MONOPOLY_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0 && eGreatPerson != NO_GREATPERSON && eMonopoly != NO_MONOPOLY) { @@ -39403,28 +39403,28 @@ void CvPlayer::changeSpecificGreatPersonRateChangeFromMonopoly(GreatPersonTypes int CvPlayer::getImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiImprovementYieldChange[eIndex1][eIndex2]; } void CvPlayer::changeImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { - CvAssertMsg(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(iChange > -50 && iChange < 50, "GAMEPLAY: Yield for a plot is either negative or a ridiculously large number."); Firaxis::Array yields = m_ppaaiImprovementYieldChange[eIndex1]; yields[eIndex2] = m_ppaaiImprovementYieldChange[eIndex1][eIndex2] + iChange; m_ppaaiImprovementYieldChange[eIndex1] = yields; - CvAssert(m_ppaaiImprovementYieldChange[eIndex1][eIndex2] >= 0); + ASSERT(m_ppaaiImprovementYieldChange[eIndex1][eIndex2] >= 0); updateYield(); } @@ -39447,7 +39447,7 @@ bool CvPlayer::removeFromArmy(int iArmyID, int iID) // DEPRECATED, use findTechPathLength() instead; kept for compatibility with modmods int CvPlayer::findPathLengthNew(TechTypes eTech, int pTechs[]) const { - CvAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value"); + ASSERT(eTech != NO_TECH, "Tech is not assigned a valid value"); int i = 0; // if buffer is empty then initialize, start recursive calls and count techs at the end @@ -39588,7 +39588,7 @@ bool CvPlayer::pushResearch(TechTypes eTech, bool bClear) TechTypes ePreReq; TechTypes eShortestOr; - CvAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value"); + ASSERT(eTech != NO_TECH, "Tech is not assigned a valid value"); CvTechEntry* pkTechInfo = GC.getTechInfo(eTech); if(pkTechInfo == NULL) @@ -40338,7 +40338,7 @@ void CvPlayer::deleteArmyAI(int iID) { bool bRemoved = m_armyAIs.Remove(iID); DEBUG_VARIABLE(bRemoved); - CvAssertMsg(bRemoved, "could not find army, delete failed"); + ASSERT(bRemoved, "could not find army, delete failed"); } const CvAIOperation* CvPlayer::getAIOperation(int iID) const @@ -41427,7 +41427,7 @@ void CvPlayer::processPolicies(PolicyTypes ePolicy, int iChange) return; CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(ePolicy); - CvAssert(pkPolicyInfo); + ASSERT(pkPolicyInfo); CvCity* pCapital = getCapitalCity(); @@ -43462,7 +43462,7 @@ void CvPlayer::createGreatGeneral(UnitTypes eGreatPersonUnit, int iX, int iY, bo { CvUnit* pGreatPeopleUnit = initUnit(eGreatPersonUnit, iX, iY); - CvAssert(pGreatPeopleUnit); + ASSERT(pGreatPeopleUnit); CvCity* pOriginCity = pGreatPeopleUnit->getOriginCity(); if (pOriginCity) @@ -43514,7 +43514,7 @@ void CvPlayer::createGreatAdmiral(UnitTypes eGreatPersonUnit, int iX, int iY, bo { CvUnit* pGreatPeopleUnit = initUnit(eGreatPersonUnit, iX, iY); - CvAssert(pGreatPeopleUnit); + ASSERT(pGreatPeopleUnit); CvCity* pOriginCity = pGreatPeopleUnit->getOriginCity(); if (pOriginCity) @@ -43596,7 +43596,7 @@ void CvPlayer::addAnnexedMilitaryCityStates(PlayerTypes eMinor) // city states shouldn't be already in the list for (std::vector< std::pair >::const_iterator it = m_AnnexedMilitaryCityStatesUnitSpawnTurns.begin(); it != m_AnnexedMilitaryCityStatesUnitSpawnTurns.end(); ++it) { - CvAssert((*it).first != eMinor) + ASSERT((*it).first != eMinor) } int iTurns = GET_PLAYER(eMinor).GetMinorCivAI()->GetSpawnBaseTurns(GetID(), true); @@ -43613,7 +43613,7 @@ void CvPlayer::removeAnnexedMilitaryCityStates(PlayerTypes eMinor) return; } } - CvAssert(false); + ASSERT(false); } void CvPlayer::updateTimerAnnexedMilitaryCityStates() @@ -43764,8 +43764,8 @@ void CvPlayer::ProcessEspionageEvents() int CvPlayer::GetYieldPerTurnFromEspionageEvents(YieldTypes eYield, bool bIncoming) const { - CvAssertMsg(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if (bIncoming) { return m_aiIncomingEspionageYields[eYield]; @@ -44013,7 +44013,7 @@ int CvPlayer::getNewCityProductionValue() const int CvPlayer::getGrowthThreshold(int iPopulation) const { - CvAssertMsg(iPopulation > 0, "Population of city should be at least 1. Please show Jon this and send your last 5 autosaves."); + ASSERT(iPopulation > 0, "Population of city should be at least 1."); int iBaseThreshold = /*15*/ GD_INT_GET(BASE_CITY_GROWTH_THRESHOLD); int iExtraPopThreshold = int((iPopulation-1) * /*8.0f in CP, 12.0f in VP*/ GD_FLOAT_GET(CITY_GROWTH_MULTIPLIER)); @@ -44102,7 +44102,7 @@ void CvPlayer::ChangeCityStrengthMod(int iChange) if (iChange != 0) { m_iCityStrengthMod += iChange; - CvAssert(m_iCityStrengthMod > -100); + ASSERT(m_iCityStrengthMod > -100); // Loop through all Cities and update their strength int iLoop = 0; @@ -44122,7 +44122,7 @@ int CvPlayer::GetCityGrowthMod() const /// Sets City growth percent mod (i.e. 100 = foodDifference doubled) void CvPlayer::SetCityGrowthMod(int iValue) { - CvAssert(iValue >= 0); + ASSERT(iValue >= 0); m_iCityGrowthMod = iValue; } @@ -44141,7 +44141,7 @@ int CvPlayer::GetCapitalGrowthMod() const /// Sets Capital growth percent mod (i.e. 100 = foodDifference doubled) void CvPlayer::SetCapitalGrowthMod(int iValue) { - CvAssert(iValue >= 0); + ASSERT(iValue >= 0); m_iCapitalGrowthMod = iValue; } @@ -44160,7 +44160,7 @@ int CvPlayer::GetNumPlotsBought() const /// Sets how many Plot has this player bought (costs should ramp up as more are purchased) void CvPlayer::SetNumPlotsBought(int iValue) { - CvAssert(iValue >= 0); + ASSERT(iValue >= 0); m_iNumPlotsBought = iValue; } @@ -45718,7 +45718,7 @@ CvCity* CvPlayer::GetHolyCity() void CvPlayer::SetHolyCity(int iCityID) { // This should only be set once under normal circumstances - CvAssert(m_iHolyCityID == -1); + ASSERT(m_iHolyCityID == -1); m_iHolyCityID = iCityID; } @@ -46349,7 +46349,7 @@ int CvPlayer::GetMissionaryExtraStrength() const void CvPlayer::ChangeMissionaryExtraStrength(int iChange) { m_iMissionaryExtraStrength += iChange; - CvAssert(m_iMissionaryExtraStrength >= 0); + ASSERT(m_iMissionaryExtraStrength >= 0); } int CvPlayer::GetNumFaithGreatPeople() const diff --git a/CvGameCoreDLL_Expansion2/CvPlayerAI.cpp b/CvGameCoreDLL_Expansion2/CvPlayerAI.cpp index 91d20258a1..95d4560f18 100644 --- a/CvGameCoreDLL_Expansion2/CvPlayerAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlayerAI.cpp @@ -46,8 +46,8 @@ static CvEnumMap s_players; CvPlayerAI& CvPlayerAI::getPlayer(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer != NO_PLAYER, "Player is not assigned a valid value"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "Player is not assigned a valid value"); + ASSERT(ePlayer != NO_PLAYER, "Player is not assigned a valid value"); + ASSERT(ePlayer < MAX_PLAYERS, "Player is not assigned a valid value"); if (ePlayer <= NO_PLAYER || ePlayer >= MAX_PLAYERS) ePlayer = BARBARIAN_PLAYER; @@ -101,9 +101,9 @@ void CvPlayerAI::AI_reset() void CvPlayerAI::AI_doTurnPre() { - CvAssertMsg(getPersonalityType() != NO_LEADER, "getPersonalityType() is not expected to be equal with NO_LEADER"); - CvAssertMsg(getLeaderType() != NO_LEADER, "getLeaderType() is not expected to be equal with NO_LEADER"); - CvAssertMsg(getCivilizationType() != NO_CIVILIZATION, "getCivilizationType() is not expected to be equal with NO_CIVILIZATION"); + ASSERT(getPersonalityType() != NO_LEADER, "getPersonalityType() is not expected to be equal with NO_LEADER"); + ASSERT(getLeaderType() != NO_LEADER, "getLeaderType() is not expected to be equal with NO_LEADER"); + ASSERT(getCivilizationType() != NO_CIVILIZATION, "getCivilizationType() is not expected to be equal with NO_CIVILIZATION"); if(isHuman()) { @@ -1197,7 +1197,7 @@ void CvPlayerAI::AI_DoEventChoice(EventTypes eChosenEvent) void CvPlayerAI::AI_doResearch() { - CvAssertMsg(!isHuman(), "isHuman did not return false as expected"); + ASSERT(!isHuman(), "isHuman did not return false as expected"); if(GetPlayerTechs()->GetCurrentResearch() == NO_TECH) { @@ -1339,7 +1339,7 @@ void CvPlayerAI::ProcessGreatPeople(void) { SpecialUnitTypes eSpecialUnitGreatPerson = (SpecialUnitTypes) GC.getInfoTypeForString("SPECIALUNIT_PEOPLE"); - CvAssert(isAlive()); + ASSERT(isAlive()); if(!isAlive()) return; @@ -1414,13 +1414,13 @@ void CvPlayerAI::ProcessGreatPeople(void) bool PreparingForWar(CvPlayerAI* pPlayer) { - CvAssertMsg(pPlayer, "Need a player"); + ASSERT(pPlayer, "Need a player"); if(!pPlayer) { return false; } CvMilitaryAI* pMilitaryAI = pPlayer->GetMilitaryAI(); - CvAssertMsg(pMilitaryAI, "No military AI"); + ASSERT(pMilitaryAI, "No military AI"); if(!pMilitaryAI) { return false; diff --git a/CvGameCoreDLL_Expansion2/CvPlot.cpp b/CvGameCoreDLL_Expansion2/CvPlot.cpp index 22f819951b..c0d7971345 100644 --- a/CvGameCoreDLL_Expansion2/CvPlot.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlot.cpp @@ -377,7 +377,7 @@ void CvPlot::doTurn() if(pLoopUnit) { - CvAssertMsg(pLoopUnit->atPlot(*this), "pLoopUnit is expected to be at the current plot instance"); + ASSERT(pLoopUnit->atPlot(*this), "pLoopUnit is expected to be at the current plot instance"); if(!pLoopUnit->atPlot(*this)) { removeUnit(pLoopUnit, true); @@ -399,13 +399,13 @@ void CvPlot::doImprovement() int iResourceNum = 0; CvTeam& thisTeam = GET_TEAM(getTeam()); - CvAssert(isBeingWorked() && isOwned()); + ASSERT(isBeingWorked() && isOwned()); if(m_eImprovementType != NO_IMPROVEMENT) { if(m_eResourceType == NO_RESOURCE) { - CvAssertMsg((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvPlot::doImprovement"); + ASSERT((0 < GC.getNumResourceInfos()), "GC.getNumResourceInfos() is not greater than zero but an array is being allocated in CvPlot::doImprovement"); int iNumResourceInfos = GC.getNumResourceInfos(); CvImprovementEntry* thisImprovementInfo = GC.getImprovementInfo((ImprovementTypes)m_eImprovementType); for(iI = 0; iI < iNumResourceInfos; ++iI) @@ -481,7 +481,7 @@ FogOfWarModeTypes CvPlot::GetActiveFogOfWarMode() const { CvGame& Game = GC.getGame(); const TeamTypes activeTeam = Game.getActiveTeam(); - CvAssert(activeTeam != NO_TEAM); + ASSERT(activeTeam != NO_TEAM); FogOfWarModeTypes eFOWMode = FOGOFWARMODE_UNEXPLORED; @@ -531,7 +531,7 @@ void CvPlot::updateVisibility() // Any unit that has visibility rules (it can become invisible to another player) needs to update itself. const TeamTypes eActiveTeam = GC.getGame().getActiveTeam(); - CvAssert(eActiveTeam != NO_TEAM); + ASSERT(eActiveTeam != NO_TEAM); if (eActiveTeam != NO_TEAM) { IDInfo* pUnitNode = headUnitNode(); @@ -1307,7 +1307,7 @@ bool CvPlot::isRiverCrossingFlowClockwise(DirectionTypes eDirection) const } break; default: - CvAssert(false); + ASSERT(false); break; } @@ -1370,7 +1370,7 @@ bool CvPlot::isRiverConnection(DirectionTypes eDirection) const break; default: - CvAssert(false); + ASSERT(false); break; } @@ -1387,7 +1387,7 @@ CvPlot* CvPlot::getNeighboringPlot(DirectionTypes eDirection) const /// Is there a river on this side of the plot? bool CvPlot::IsRiverSide(DirectionTypes eDirection) const { - CvAssertMsg(eDirection != NO_DIRECTION, "eDirection is not assigned a valid value"); + ASSERT(eDirection != NO_DIRECTION, "eDirection is not assigned a valid value"); CvPlot* pAdjacentPlot = plotDirection(getX(), getY(), eDirection); switch (eDirection) { @@ -1424,7 +1424,7 @@ bool CvPlot::IsRiverSide(DirectionTypes eDirection) const /// Is there a river on this side of the plot? bool CvPlot::IsLakeSide(DirectionTypes eDirection) const { - CvAssertMsg(eDirection != NO_DIRECTION, "eDirection is not assigned a valid value"); + ASSERT(eDirection != NO_DIRECTION, "eDirection is not assigned a valid value"); CvPlot* pAdjacentPlot = plotDirection(getX(), getY(), eDirection); return pAdjacentPlot && pAdjacentPlot->isLake(); } @@ -1434,7 +1434,7 @@ bool CvPlot::IsLakeSide(DirectionTypes eDirection) const /// As long as both plots are on the same side of a river system, it counts. bool CvPlot::IsAlongSameRiver(const CvPlot* pToPlot) const { - CvAssert(pToPlot); + ASSERT(pToPlot); DirectionTypes eDirection = directionXY(this, pToPlot); DirectionTypes eNextDirection = static_cast((eDirection + 1) % 6); DirectionTypes ePrevDirection = static_cast((eDirection + 5) % 6); @@ -1494,7 +1494,7 @@ int CvPlot::seeFromLevel(TeamTypes eTeam) const { int iLevel = 0; - CvAssertMsg(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); + ASSERT(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); // Plot recon-ed? if(getReconCount() > 0) @@ -2358,7 +2358,7 @@ void CvPlot::updateSeeFromSight(bool bIncrement, bool bRecalculate) // -------------------------------------------------------------------------------- bool CvPlot::canHaveResource(ResourceTypes eResource, bool bIgnoreLatitude, bool bIgnoreCiv) const { - CvAssertMsg(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); + ASSERT(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); if(eResource == NO_RESOURCE) { @@ -3231,7 +3231,7 @@ int CvPlot::getBuildTime(BuildTypes eBuild, PlayerTypes ePlayer) const return 0; } - CvAssertMsg(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); + ASSERT(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); CvBuildInfo* pkBuildInfo = GC.getBuildInfo(eBuild); int iTime = pkBuildInfo->getTime(); @@ -4900,7 +4900,7 @@ bool CvPlot::isVisibleEnemyDefender(const CvUnit* pUnit) const if (!isVisible(eTeam)) return false; - CvAssertMsg(pUnit, "Source unit must be valid"); + ASSERT(pUnit, "Source unit must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnit && pUnitNode) { @@ -5019,7 +5019,7 @@ int CvPlot::getNumVisibleEnemyDefenders(const CvUnit* pUnit) const if (!isVisible(eTeam)) return 0; - CvAssertMsg(pUnit, "Source unit must be valid"); + ASSERT(pUnit, "Source unit must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnit && pUnitNode) { @@ -5104,7 +5104,7 @@ bool CvPlot::isVisibleEnemyUnit(PlayerTypes ePlayer) const if (!isVisible(eTeam)) return false; - CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid"); + ASSERT(ePlayer != NO_PLAYER, "Source player must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnitNode) { @@ -5142,7 +5142,7 @@ bool CvPlot::isVisibleEnemyUnit(const CvUnit* pUnit) const if (!isVisible(eTeam)) return false; - CvAssertMsg(pUnit, "Source unit must be valid"); + ASSERT(pUnit, "Source unit must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnit && pUnitNode) { @@ -5182,7 +5182,7 @@ bool CvPlot::isVisibleOtherUnit(PlayerTypes ePlayer) const if (!isVisible(eTeam)) return false; - CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid"); + ASSERT(ePlayer != NO_PLAYER, "Source player must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnitNode) { @@ -5212,7 +5212,7 @@ bool CvPlot::isEnemyUnit(PlayerTypes ePlayer, bool bCombatOnly, bool bCheckVisib if (bCheckVisibility && !isVisible(eTeam)) return false; - CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid"); + ASSERT(ePlayer != NO_PLAYER, "Source player must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnitNode) { @@ -5258,7 +5258,7 @@ bool CvPlot::isNeutralUnit(PlayerTypes ePlayer, bool bCombat, bool bCheckVisibil if (bCheckVisibility && !isVisible(eTeam)) return false; - CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid"); + ASSERT(ePlayer != NO_PLAYER, "Source player must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnitNode) { @@ -5308,7 +5308,7 @@ bool CvPlot::isFriendlyUnit(PlayerTypes ePlayer, bool bCombatOnly, bool bSamePla if (!isVisible(eTeam)) return false; - CvAssertMsg(ePlayer != NO_PLAYER, "Source player must be valid"); + ASSERT(ePlayer != NO_PLAYER, "Source player must be valid"); const IDInfo* pUnitNode = m_units.head(); if(pUnitNode) { @@ -5380,7 +5380,7 @@ bool CvPlot::isCityFighting() const // --------------------------------------------------------------------------- bool CvPlot::canHaveFeature(FeatureTypes eFeature) const { - CvAssertMsg(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); + ASSERT(getTerrainType() != NO_TERRAIN, "TerrainType is not assigned a valid value"); if(eFeature == NO_FEATURE) { @@ -5806,7 +5806,7 @@ void CvPlot::setOwnershipDuration(int iNewValue) bOldOwnershipScore = isOwnershipScore(); m_iOwnershipDuration = iNewValue; - CvAssert(getOwnershipDuration() >= 0); + ASSERT(getOwnershipDuration() >= 0); if(bOldOwnershipScore != isOwnershipScore()) { @@ -5840,7 +5840,7 @@ int CvPlot::getImprovementDuration() const void CvPlot::setImprovementDuration(int iNewValue) { m_iImprovementDuration = iNewValue; - CvAssert(getImprovementDuration() >= 0); + ASSERT(getImprovementDuration() >= 0); } @@ -5896,7 +5896,7 @@ int CvPlot::getUpgradeTimeLeft(ImprovementTypes eImprovement, PlayerTypes ePlaye void CvPlot::setUpgradeProgress(int iNewValue) { m_iUpgradeProgress = iNewValue; - CvAssert(getUpgradeProgress() >= 0); + ASSERT(getUpgradeProgress() >= 0); } @@ -6097,7 +6097,7 @@ int CvPlot::getNumMajorCivsRevealed() const void CvPlot::setNumMajorCivsRevealed(int iNewValue) { m_iNumMajorCivsRevealed = iNewValue; - CvAssert(getNumMajorCivsRevealed() >= 0); + ASSERT(getNumMajorCivsRevealed() >= 0); } @@ -6126,7 +6126,7 @@ int CvPlot::isCityRadius() const void CvPlot::changeCityRadiusCount(int iChange) { m_iCityRadiusCount = (m_iCityRadiusCount + iChange); - CvAssert(getCityRadiusCount() >= 0); + ASSERT(getCityRadiusCount() >= 0); } @@ -6159,7 +6159,7 @@ void CvPlot::setNEOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) if((isNEOfRiver() != bNewValue) || (eRiverDir != m_eRiverSWFlowDirection)) { - CvAssertMsg(m_eRiverSWFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(m_eRiverSWFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); if(isNEOfRiver() != bNewValue) { #if defined(MOD_EVENTS_TERRAFORMING) @@ -6190,7 +6190,7 @@ void CvPlot::setNEOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) } } - CvAssertMsg(eRiverDir == FLOWDIRECTION_NORTHWEST || eRiverDir == FLOWDIRECTION_SOUTHEAST || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(eRiverDir == FLOWDIRECTION_NORTHWEST || eRiverDir == FLOWDIRECTION_SOUTHEAST || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); m_eRiverSWFlowDirection = eRiverDir; } } @@ -6211,7 +6211,7 @@ void CvPlot::setWOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) if((isWOfRiver() != bNewValue) || (eRiverDir != m_eRiverEFlowDirection)) { - CvAssertMsg(m_eRiverEFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(m_eRiverEFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); if(isWOfRiver() != bNewValue) { #if defined(MOD_EVENTS_TERRAFORMING) @@ -6242,7 +6242,7 @@ void CvPlot::setWOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) } } - CvAssertMsg(eRiverDir == FLOWDIRECTION_NORTH || eRiverDir == FLOWDIRECTION_SOUTH || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(eRiverDir == FLOWDIRECTION_NORTH || eRiverDir == FLOWDIRECTION_SOUTH || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); m_eRiverEFlowDirection= eRiverDir; } } @@ -6263,7 +6263,7 @@ void CvPlot::setNWOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) if((isNWOfRiver() != bNewValue) || (eRiverDir != m_eRiverSEFlowDirection)) { - CvAssertMsg(m_eRiverSEFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(m_eRiverSEFlowDirection == NO_FLOWDIRECTION && eRiverDir != NO_FLOWDIRECTION, "invalid parameter"); if(isNWOfRiver() != bNewValue) { #if defined(MOD_EVENTS_TERRAFORMING) @@ -6294,7 +6294,7 @@ void CvPlot::setNWOfRiver(bool bNewValue, FlowDirectionTypes eRiverDir) } } - CvAssertMsg(eRiverDir == FLOWDIRECTION_NORTHEAST || eRiverDir == FLOWDIRECTION_SOUTHWEST || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); + ASSERT(eRiverDir == FLOWDIRECTION_NORTHEAST || eRiverDir == FLOWDIRECTION_SOUTHWEST || eRiverDir == NO_FLOWDIRECTION, "invalid parameter"); m_eRiverSEFlowDirection = eRiverDir; } } @@ -7593,7 +7593,7 @@ ResourceTypes CvPlot::getNonObsoleteResourceType(TeamTypes eTeam) const { ResourceTypes eResource; - CvAssert(eTeam != NO_TEAM); + ASSERT(eTeam != NO_TEAM); eResource = getResourceType(eTeam); @@ -7627,7 +7627,7 @@ void CvPlot::setResourceType(ResourceTypes eNewValue, int iResourceNum, bool bFo { if (!bForMinorCivPlot) { - CvAssertMsg(false, "Tried to place a city-state unique luxury when not allowed. PLEASE send Anton your save game, settings, and version!"); + ASSERT(false, "Tried to place a city-state unique luxury when not allowed."); return; } } @@ -7733,15 +7733,15 @@ int CvPlot::getNumResource() const void CvPlot::setNumResource(int iNum) { m_iResourceNum = iNum; - CvAssert(getNumResource() >= 0); - FAssertMsg(getResourceType() == NO_RESOURCE || m_iResourceNum > 0, "If a plot contains a Resource it should always have a quantity of at least 1."); + ASSERT(getNumResource() >= 0); + ASSERT(getResourceType() == NO_RESOURCE || m_iResourceNum > 0, "If a plot contains a Resource it should always have a quantity of at least 1."); } // -------------------------------------------------------------------------------- void CvPlot::changeNumResource(int iChange) { setNumResource(getNumResource() + iChange); - CvAssert(getNumResource() >= 0); + ASSERT(getNumResource() >= 0); } // -------------------------------------------------------------------------------- @@ -7821,8 +7821,8 @@ ImprovementTypes CvPlot::getImprovementType() const // -------------------------------------------------------------------------------- ImprovementTypes CvPlot::getImprovementTypeNeededToImproveResource(PlayerTypes ePlayer, bool bTestPlotOwner, bool bIgnoreSpecialImprovements) { - CvAssertMsg(ePlayer == NO_PLAYER || ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer == NO_PLAYER || ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer == NO_PLAYER || ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer == NO_PLAYER || ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)"); ResourceTypes eResource = NO_RESOURCE; if(ePlayer != NO_PLAYER) @@ -8489,7 +8489,7 @@ void CvPlot::setImprovementType(ImprovementTypes eNewValue, PlayerTypes eBuilder { CvString strBuffer; CvResourceInfo* pSelectedResourceInfo = GC.getResourceInfo(eSelectedResource); - CvAssert(pSelectedResourceInfo); + ASSERT(pSelectedResourceInfo); NotificationTypes eNotificationType = NO_NOTIFICATION_TYPE; strBuffer = GetLocalizedText("TXT_KEY_NOTIFICATION_FOUND_RESOURCE", pSelectedResourceInfo->GetTextKey()); @@ -9310,7 +9310,7 @@ void CvPlot::updateCityRoute() if(isCity()) { - CvAssertMsg(isOwned(), "isOwned is expected to be true"); + ASSERT(isOwned(), "isOwned is expected to be true"); eCityRoute = GET_PLAYER(getOwner()).getBestRoute(); @@ -9610,7 +9610,7 @@ void CvPlot::SetResourceLinkedCity(const CvCity* pCity) if (pCity != NULL) { - CvAssertMsg(pCity->getOwner() == getOwner(), "Argument city pNewValue's owner is expected to be the same as the current instance"); + ASSERT(pCity->getOwner() == getOwner(), "Argument city pNewValue's owner is expected to be the same as the current instance"); m_ResourceLinkedCity = pCity->GetIDInfo(); GetResourceLinkedCity()->ChangeNumResourceLocal(getResourceType(), iResourceChange, true); ImprovementTypes eImprovement = getImprovementType(); @@ -9807,7 +9807,7 @@ int CvPlot::getReconCount() const void CvPlot::changeReconCount(int iChange) { m_iReconCount = (m_iReconCount + iChange); - CvAssert(getReconCount() >= 0); + ASSERT(getReconCount() >= 0); } @@ -9822,14 +9822,14 @@ int CvPlot::getRiverCrossingCount() const void CvPlot::changeRiverCrossingCount(int iChange) { m_iRiverCrossingCount = (m_iRiverCrossingCount + iChange); - CvAssert(getRiverCrossingCount() >= 0); + ASSERT(getRiverCrossingCount() >= 0); } // -------------------------------------------------------------------------------- int CvPlot::getYield(YieldTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return (int)(m_aiYield[eIndex]); } @@ -10090,7 +10090,7 @@ int CvPlot::calculateNatureYield(YieldTypes eYield, PlayerTypes ePlayer, Feature if (eImprovement != NO_IMPROVEMENT) { CvImprovementEntry* pkImprovementEntry = GC.getImprovementInfo(eImprovement); - CvAssert(pkImprovementEntry); + ASSERT(pkImprovementEntry); if (pkImprovementEntry->IsNoFollowUp() && !IsImprovementPillaged()) { @@ -11344,8 +11344,8 @@ void CvPlot::setFoundValue(PlayerTypes eIndex, int iNewValue) // -------------------------------------------------------------------------------- int CvPlot::getPlayerCityRadiusCount(PlayerTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiPlayerCityRadiusCount[eIndex]; } @@ -11361,13 +11361,13 @@ bool CvPlot::isPlayerCityRadius(PlayerTypes eIndex) const // -------------------------------------------------------------------------------- void CvPlot::changePlayerCityRadiusCount(PlayerTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_PLAYERS, "eIndex is expected to be within maximum bounds (invalid Index)"); if(0 != iChange) { m_aiPlayerCityRadiusCount[eIndex] += iChange; - CvAssert(getPlayerCityRadiusCount(eIndex) >= 0); + ASSERT(getPlayerCityRadiusCount(eIndex) >= 0); } } @@ -11392,8 +11392,8 @@ int CvPlot::getVisiblityCount(TeamTypes eTeam) // -------------------------------------------------------------------------------- PlotVisibilityChangeResult CvPlot::changeVisibilityCount(TeamTypes eTeam, int iChange, InvisibleTypes eSeeInvisible, bool bInformExplorationTracking, bool bAlwaysSeeInvisible, CvUnit* pUnit) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); PlotVisibilityChangeResult eResult = VISIBILTY_CHANGE_NONE; if (iChange == 0) @@ -11550,8 +11550,8 @@ PlayerTypes CvPlot::getRevealedOwner(TeamTypes eTeam, bool bDebug) const } else { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (PlayerTypes)m_aiRevealedOwner[eTeam]; } @@ -11561,8 +11561,8 @@ PlayerTypes CvPlot::getRevealedOwner(TeamTypes eTeam, bool bDebug) const // -------------------------------------------------------------------------------- TeamTypes CvPlot::getRevealedTeam(TeamTypes eTeam, bool bDebug) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); PlayerTypes eRevealedOwner = getRevealedOwner(eTeam, bDebug); @@ -11579,8 +11579,8 @@ TeamTypes CvPlot::getRevealedTeam(TeamTypes eTeam, bool bDebug) const // -------------------------------------------------------------------------------- PlayerTypes CvPlot::getRevealedOwner(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (PlayerTypes)m_aiRevealedOwner[eTeam]; } @@ -11589,8 +11589,8 @@ PlayerTypes CvPlot::getRevealedOwner(TeamTypes eTeam) const // -------------------------------------------------------------------------------- TeamTypes CvPlot::getRevealedTeam(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); PlayerTypes eRevealedOwner = getRevealedOwner(eTeam); @@ -11608,8 +11608,8 @@ TeamTypes CvPlot::getRevealedTeam(TeamTypes eTeam) const // -------------------------------------------------------------------------------- bool CvPlot::setRevealedOwner(TeamTypes eTeam, PlayerTypes eNewValue) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); if(getRevealedOwner(eTeam, false) != eNewValue) { @@ -11623,7 +11623,7 @@ bool CvPlot::setRevealedOwner(TeamTypes eTeam, PlayerTypes eNewValue) return true; } - CvAssert(m_aiRevealedOwner[eTeam] == eNewValue); + ASSERT(m_aiRevealedOwner[eTeam] == eNewValue); return false; } @@ -11631,8 +11631,8 @@ bool CvPlot::setRevealedOwner(TeamTypes eTeam, PlayerTypes eNewValue) // -------------------------------------------------------------------------------- void CvPlot::updateRevealedOwner(TeamTypes eTeam) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); //we change the revealed owner when the plot or a neighbor is visible (not revealed) bool bRevealed = isVisible(eTeam); @@ -11663,7 +11663,7 @@ void CvPlot::updateRevealedOwner(TeamTypes eTeam) // -------------------------------------------------------------------------------- bool CvPlot::isRiverCrossing(DirectionTypes eIndex) const { - CvAssertMsg(eIndex < NUM_DIRECTION_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex < NUM_DIRECTION_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(eIndex == NO_DIRECTION) { @@ -11680,8 +11680,8 @@ bool CvPlot::isRiverCrossing(DirectionTypes eIndex) const void CvPlot::updateRiverCrossing(DirectionTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DIRECTION_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DIRECTION_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); bool bValid = false; CvPlot* pPlot = plotDirection(getX(), getY(), eIndex); @@ -11728,7 +11728,7 @@ void CvPlot::updateRiverCrossing(DirectionTypes eIndex) break; default: - CvAssert(false); + ASSERT(false); break; } } @@ -11772,8 +11772,8 @@ bool CvPlot::IsResourceForceReveal(TeamTypes eTeam) const /// Set force reveal a Resource for a team (for Goody Huts) void CvPlot::SetResourceForceReveal(TeamTypes eTeam, bool bValue) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); m_abResourceForceReveal[eTeam] = bValue; } @@ -11784,8 +11784,8 @@ RoutePlanTypes CvPlot::GetPlannedRouteState(PlayerTypes ePlayer) const void CvPlot::SetPlannedRouteState(PlayerTypes ePlayer, RoutePlanTypes eRoutePlanType) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); m_aeHumanPlannedRouteState[ePlayer] = eRoutePlanType; } @@ -11793,8 +11793,8 @@ void CvPlot::SetPlannedRouteState(PlayerTypes ePlayer, RoutePlanTypes eRoutePlan /// Current player's knowledge of other players' visibility count int CvPlot::GetKnownVisibilityCount(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_aiKnownVisibilityCount[eTeam]; } @@ -11828,8 +11828,8 @@ bool CvPlot::IsKnownVisibleToEnemy(PlayerTypes ePlayer) const void CvPlot::IncreaseKnownVisibilityCount(TeamTypes eTeam, TeamTypes eTeam2) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); m_aiKnownVisibilityCount[eTeam]++; if (eTeam2 != NO_TEAM) m_aiKnownVisibilityCount[eTeam2]++; @@ -11847,16 +11847,16 @@ void CvPlot::ResetKnownVisibility() // -------------------------------------------------------------------------------- bool CvPlot::IsTeamImpassable(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < REALLY_MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < REALLY_MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_abIsImpassable[eTeam]; } // -------------------------------------------------------------------------------- /// Set force reveal a Resource for a team (for Goody Huts) void CvPlot::SetTeamImpassable(TeamTypes eTeam, bool bValue) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < REALLY_MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < REALLY_MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); m_abIsImpassable[eTeam] = bValue; } #endif @@ -11870,8 +11870,8 @@ bool CvPlot::setRevealed(TeamTypes eTeam, bool bNewValue, CvUnit* pUnit, bool bT int iRevealedMajors = getNumMajorCivsRevealed(); #endif - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); TeamTypes eActiveTeam = GC.getGame().getActiveTeam(); ICvUserInterface2* pInterface = GC.GetEngineUserInterface(); @@ -12342,8 +12342,8 @@ ImprovementTypes CvPlot::getRevealedImprovementType(TeamTypes eTeam, bool bDebug } else { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (ImprovementTypes)m_aeRevealedImprovementType[eTeam]; } @@ -12352,8 +12352,8 @@ ImprovementTypes CvPlot::getRevealedImprovementType(TeamTypes eTeam, bool bDebug // -------------------------------------------------------------------------------- ImprovementTypes CvPlot::getRevealedImprovementType(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (ImprovementTypes)m_aeRevealedImprovementType[eTeam]; } @@ -12361,8 +12361,8 @@ ImprovementTypes CvPlot::getRevealedImprovementType(TeamTypes eTeam) const // -------------------------------------------------------------------------------- bool CvPlot::setRevealedImprovementType(TeamTypes eTeam, ImprovementTypes eNewValue) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); if (eNewValue < NO_IMPROVEMENT) return false; if (eNewValue > NO_IMPROVEMENT && GC.getImprovementInfo(eNewValue) == NULL) return false; @@ -12398,8 +12398,8 @@ RouteTypes CvPlot::getRevealedRouteType(TeamTypes eTeam, bool bDebug) const } else { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (RouteTypes)m_aeRevealedRouteType[eTeam]; } @@ -12408,8 +12408,8 @@ RouteTypes CvPlot::getRevealedRouteType(TeamTypes eTeam, bool bDebug) const // -------------------------------------------------------------------------------- RouteTypes CvPlot::getRevealedRouteType(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return (RouteTypes)m_aeRevealedRouteType[eTeam]; } @@ -12417,8 +12417,8 @@ RouteTypes CvPlot::getRevealedRouteType(TeamTypes eTeam) const // -------------------------------------------------------------------------------- bool CvPlot::setRevealedRouteType(TeamTypes eTeam, RouteTypes eNewValue) { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); if (eNewValue < NO_ROUTE) return false; if (eNewValue > NO_ROUTE && GC.getRouteInfo(eNewValue) == NULL) return false; @@ -12530,7 +12530,7 @@ int CvPlot::GetStealPlotValue(PlayerTypes eStealingPlayer, bool& bStoleHighValue if (eImprovement != NO_IMPROVEMENT) { CvImprovementEntry* pkImprovementInfo = GC.getImprovementInfo(eImprovement); - CvAssert(pkImprovementInfo); + ASSERT(pkImprovementInfo); if (bChokePoint) { @@ -12588,7 +12588,7 @@ bool CvPlot::changeBuildProgress(BuildTypes eBuild, int iChange, PlayerTypes ePl CvPlayer &kPlayer = GET_PLAYER(ePlayer); CvBuildInfo* pkBuildInfo = GC.getBuildInfo(eBuild); - CvAssert(pkBuildInfo); + ASSERT(pkBuildInfo); //This shouldn't happen. if(pkBuildInfo == NULL) @@ -12609,7 +12609,7 @@ bool CvPlot::changeBuildProgress(BuildTypes eBuild, int iChange, PlayerTypes ePl m_iLastTurnBuildChanged = GC.getGame().getGameTurn(); m_buildProgress[eBuild] += iChange; - CvAssert(getBuildProgress(eBuild) >= 0); + ASSERT(getBuildProgress(eBuild) >= 0); if(getBuildProgress(eBuild) >= getBuildTime(eBuild, ePlayer)) { @@ -12715,7 +12715,7 @@ bool CvPlot::changeBuildProgress(BuildTypes eBuild, int iChange, PlayerTypes ePl { if(pkBuildInfo->isFeatureRemove(getFeatureType())) { - CvAssertMsg(ePlayer != NO_PLAYER, "ePlayer should be valid"); + ASSERT(ePlayer != NO_PLAYER, "ePlayer should be valid"); iProduction = getFeatureProduction(eBuild, ePlayer, &pCity); @@ -12823,8 +12823,8 @@ void CvPlot::setCenterUnit(CvUnit* pNewValue) } int CvPlot::getInvisibleVisibilityCountUnit(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); for (size_t i = 0; i < m_vInvisibleVisibilityUnitCount.size(); i++) if (m_vInvisibleVisibilityUnitCount[i].first == eTeam) return m_vInvisibleVisibilityUnitCount[i].second; @@ -12842,8 +12842,8 @@ void CvPlot::changeInvisibleVisibilityCountUnit(TeamTypes eTeam, int iChange) bool bOldInvisibleVisible = false; bool bNewInvisibleVisible = false; - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); if (eTeam < 0 || eTeam >= MAX_TEAMS) return; if (iChange != 0) @@ -12901,10 +12901,10 @@ void CvPlot::changeInvisibleVisibilityCountUnit(TeamTypes eTeam, int iChange) // -------------------------------------------------------------------------------- int CvPlot::getInvisibleVisibilityCount(TeamTypes eTeam, InvisibleTypes eInvisible) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eInvisible >= 0, "eInvisible is expected to be non-negative (invalid Index)"); - CvAssertMsg(eInvisible < NUM_INVISIBLE_TYPES, "eInvisible is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eInvisible >= 0, "eInvisible is expected to be non-negative (invalid Index)"); + ASSERT(eInvisible < NUM_INVISIBLE_TYPES, "eInvisible is expected to be within maximum bounds (invalid Index)"); if (eTeam < 0 || eTeam >= MAX_TEAMS) return 0; if (eInvisible < 0 || eInvisible >= NUM_INVISIBLE_TYPES) return 0; @@ -12929,10 +12929,10 @@ void CvPlot::changeInvisibleVisibilityCount(TeamTypes eTeam, InvisibleTypes eInv bool bOldInvisibleVisible = false; bool bNewInvisibleVisible = false; - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eInvisible >= 0, "eInvisible is expected to be non-negative (invalid Index)"); - CvAssertMsg(eInvisible < NUM_INVISIBLE_TYPES, "eInvisible is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eInvisible >= 0, "eInvisible is expected to be non-negative (invalid Index)"); + ASSERT(eInvisible < NUM_INVISIBLE_TYPES, "eInvisible is expected to be within maximum bounds (invalid Index)"); if (eTeam < 0 || eTeam >= MAX_TEAMS) return; if (eInvisible < 0 || eInvisible >= NUM_INVISIBLE_TYPES) return; @@ -13184,11 +13184,11 @@ int CvPlot::getUnitIndex(CvUnit* pUnit) const // --------------------------------------------------------------------------- void CvPlot::addUnit(CvUnit* pUnit, bool bUpdate) { - CvAssertMsg(pUnit, "pUnit is expected to be non-NULL"); + ASSERT(pUnit, "pUnit is expected to be non-NULL"); if(pUnit == NULL) return; - CvAssertMsg(pUnit->at(getX(), getY()), "pUnit is expected to be at getX_INLINE and getY_INLINE"); + ASSERT(pUnit->at(getX(), getY()), "pUnit is expected to be at getX_INLINE and getY_INLINE"); IDInfo* pUnitNode = headUnitNode(); while(pUnitNode != NULL) @@ -13229,7 +13229,7 @@ void CvPlot::removeUnit(CvUnit* pUnit, bool bUpdate) { if(GetPlayerUnit(*pUnitNode) == pUnit) { - CvAssertMsg(GetPlayerUnit(*pUnitNode)->at(getX(), getY()), "The current unit instance is expected to be at getX_INLINE and getY_INLINE"); + ASSERT(GetPlayerUnit(*pUnitNode)->at(getX(), getY()), "The current unit instance is expected to be at getX_INLINE and getY_INLINE"); m_units.deleteNode(pUnitNode); break; } @@ -16037,7 +16037,7 @@ FDataStream& operator<<(FDataStream& saveTo, const CvPlot* const& readFrom) if (readFrom != NULL) { idx = readFrom->GetPlotIndex(); - CvAssertMsg(GC.getMap().plotByIndex(idx) == readFrom, "Saving plot pointer that is not member of map"); + ASSERT(GC.getMap().plotByIndex(idx) == readFrom, "Saving plot pointer that is not member of map"); } saveTo << idx; return saveTo; @@ -16053,7 +16053,7 @@ FDataStream& operator>>(FDataStream& loadFrom, const CvPlot*& writeTo) if (idx != -1) { writeTo = GC.getMap().plotByIndex(idx); - CvAssertMsg(writeTo != NULL, "Read plot pointer index that is out of bounds"); + ASSERT(writeTo != NULL, "Read plot pointer index that is out of bounds"); } else { diff --git a/CvGameCoreDLL_Expansion2/CvPlot.h b/CvGameCoreDLL_Expansion2/CvPlot.h index ebc83b4a7e..6be4afa790 100644 --- a/CvGameCoreDLL_Expansion2/CvPlot.h +++ b/CvGameCoreDLL_Expansion2/CvPlot.h @@ -605,8 +605,8 @@ class CvPlot inline int getVisibilityCount(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); //With delayed visibility, return the hacked visibility count so plots which were once visible this turn stay that way return MOD_CORE_DELAYED_VISIBILITY ? m_aiVisibilityCountThisTurnMax[eTeam] : m_aiVisibilityCount[eTeam]; @@ -635,15 +635,15 @@ class CvPlot { if(bDebug && GC.getGame().isDebugMode()) return true; - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_bfRevealed.GetBit(eTeam); } bool isRevealed(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)"); return m_bfRevealed.GetBit(eTeam); } diff --git a/CvGameCoreDLL_Expansion2/CvPlotInfo.cpp b/CvGameCoreDLL_Expansion2/CvPlotInfo.cpp index 2e3c9a9611..7820db0795 100644 --- a/CvGameCoreDLL_Expansion2/CvPlotInfo.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlotInfo.cpp @@ -34,8 +34,8 @@ bool CvPlotInfo::isImpassable() const int CvPlotInfo::getYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYields ? m_piYields[i] : -1; } @@ -43,10 +43,10 @@ int CvPlotInfo::getYield(int i) const //------------------------------------------------------------------------------ int CvPlotInfo::GetAdjacentFeatureYieldChange(FeatureTypes eFeature, YieldTypes eYield, bool bNaturalWonderPlot) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eFeature > -1, "Index out of bounds"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eFeature > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map>>::const_iterator itFeature = m_pppiAdjacentFeatureYieldChange.find(eFeature); int iYieldChange = 0; @@ -103,8 +103,8 @@ bool CvPlotInfo::IsAdjacentFeatureYieldChange(bool bNaturalWonderPlot) const /// Check if a plot gains yields from a particular feature bool CvPlotInfo::IsAdjacentFeatureYieldChange(FeatureTypes eFeature, bool bNaturalWonderPlot) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eFeature > -1, "Index out of bounds"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eFeature > -1, "Index out of bounds"); std::map>>::const_iterator itFeature = m_pppiAdjacentFeatureYieldChange.find(eFeature); if (itFeature != m_pppiAdjacentFeatureYieldChange.end()) diff --git a/CvGameCoreDLL_Expansion2/CvPolicyAI.cpp b/CvGameCoreDLL_Expansion2/CvPolicyAI.cpp index 258f079fc3..303d7cddc4 100644 --- a/CvGameCoreDLL_Expansion2/CvPolicyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvPolicyAI.cpp @@ -36,11 +36,11 @@ void CvPolicyAI::Reset() m_iPolicyWeightPropagationLevels = /*2*/ GD_INT_GET(POLICY_WEIGHT_PROPAGATION_LEVELS); m_iPolicyWeightPercentDropNewBranch = /*90*/ max(GD_INT_GET(POLICY_WEIGHT_PERCENT_DROP_NEW_BRANCH), 0); - CvAssertMsg(m_pCurrentPolicies != NULL, "Policy AI init failure: player policy data is NULL"); + ASSERT(m_pCurrentPolicies != NULL, "Policy AI init failure: player policy data is NULL"); if(m_pCurrentPolicies != NULL) { CvPolicyXMLEntries* pPolicyEntries = m_pCurrentPolicies->GetPolicies(); - CvAssertMsg(pPolicyEntries != NULL, "Policy AI init failure: no policy data"); + ASSERT(pPolicyEntries != NULL, "Policy AI init failure: no policy data"); if(pPolicyEntries != NULL) { // Loop through reading each one and add an entry with 0 weight to our vector @@ -5180,7 +5180,7 @@ int CvPolicyAI::WeighBranch(CvPlayer* pPlayer, PolicyBranchTypes eBranch) bool CvPolicyAI::IsBranchEffectiveInGame(PolicyBranchTypes eBranch) { CvPolicyBranchEntry* pBranchInfo = GC.getPolicyBranchInfo(eBranch); - CvAssertMsg(pBranchInfo, "Branch info not found! Please send Anton your save file and version."); + ASSERT(pBranchInfo, "Branch info not found!"); if (!pBranchInfo) return false; if (pBranchInfo->IsDelayWhenNoReligion()) diff --git a/CvGameCoreDLL_Expansion2/CvPolicyClasses.cpp b/CvGameCoreDLL_Expansion2/CvPolicyClasses.cpp index e8cf92208b..d34083ea13 100644 --- a/CvGameCoreDLL_Expansion2/CvPolicyClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvPolicyClasses.cpp @@ -2631,8 +2631,8 @@ int CvPolicyEntry::GetPrereqAndPolicies(int i) const /// Change to yield by type int CvPolicyEntry::GetYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifier ? m_piYieldModifier[i] : -1; } @@ -2645,8 +2645,8 @@ int* CvPolicyEntry::GetYieldModifierArray() const /// Change to traderoute yield modifier by type int CvPolicyEntry::GetInternationalRouteYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piInternationalRouteYieldModifiers ? m_piInternationalRouteYieldModifiers[i] : -1; } @@ -2672,8 +2672,8 @@ std::map CvPolicyEntry::GetUnitClassReplacements /// Change to yield in every City by type int CvPolicyEntry::GetCityYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCityYieldChange ? m_piCityYieldChange[i] : -1; } @@ -2686,8 +2686,8 @@ int* CvPolicyEntry::GetCityYieldChangeArray() const /// Change to yield in coastal Cities by type int CvPolicyEntry::GetCoastalCityYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCoastalCityYieldChange ? m_piCoastalCityYieldChange[i] : -1; } @@ -2700,8 +2700,8 @@ int* CvPolicyEntry::GetCoastalCityYieldChangeArray() const /// Change to yield in Capital by type int CvPolicyEntry::GetCapitalYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCapitalYieldChange ? m_piCapitalYieldChange[i] : -1; } @@ -2714,8 +2714,8 @@ int* CvPolicyEntry::GetCapitalYieldChangeArray() const /// Change to yield in Capital by type (per pop) int CvPolicyEntry::GetCapitalYieldPerPopChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCapitalYieldPerPopChange ? m_piCapitalYieldPerPopChange[i] : -1; } @@ -2729,8 +2729,8 @@ int* CvPolicyEntry::GetCapitalYieldPerPopChangeArray() const /// Change to yield in Capital by type (per pop) int CvPolicyEntry::GetCapitalYieldPerPopChangeEmpire(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCapitalYieldPerPopChangeEmpire ? m_piCapitalYieldPerPopChangeEmpire[i] : -1; } @@ -2742,8 +2742,8 @@ int* CvPolicyEntry::GetCapitalYieldPerPopChangeEmpireArray() const /// Change to yield in capital by type int CvPolicyEntry::GetCapitalYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piCapitalYieldModifier ? m_piCapitalYieldModifier[i] : -1; } @@ -2756,8 +2756,8 @@ int* CvPolicyEntry::GetCapitalYieldModifierArray() const /// Change to Great Work yield by type int CvPolicyEntry::GetGreatWorkYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGreatWorkYieldChange ? m_piGreatWorkYieldChange[i] : -1; } @@ -2770,8 +2770,8 @@ int* CvPolicyEntry::GetGreatWorkYieldChangeArray() const /// Extra specialist yield by yield type int CvPolicyEntry::GetSpecialistExtraYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piSpecialistExtraYield ? m_piSpecialistExtraYield[i] : -1; } @@ -2784,15 +2784,15 @@ int* CvPolicyEntry::GetSpecialistExtraYieldArray() const /// Production modifier by unit type int CvPolicyEntry::GetUnitCombatProductionModifiers(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiUnitCombatProductionModifiers ? m_paiUnitCombatProductionModifiers[i] : -1; } /// Do all Units get Promotion ID i? bool CvPolicyEntry::IsFreePromotion(int i) const { - CvAssertMsg(i < GC.getNumPromotionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPromotionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pabFreePromotion[i]; } @@ -2845,8 +2845,8 @@ bool CvPolicyEntry::IsFaithPurchaseUnitClass(const int eUnitClass, const int eCu /// What is the golden age modifier for the specific yield type? int CvPolicyEntry::GetYieldChangesPerReligionTimes100(int iYield) const { - CvAssertMsg((YieldTypes)iYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg((YieldTypes)iYield > -1, "Index out of bounds"); + ASSERT((YieldTypes)iYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT((YieldTypes)iYield > -1, "Index out of bounds"); return m_piYieldChangesPerReligion ? m_piYieldChangesPerReligion[iYield] : 0; } @@ -2860,135 +2860,135 @@ int* CvPolicyEntry::GetYieldChangesPerReligionTimes100Array() const /// Free experience by unit type int CvPolicyEntry::GetUnitCombatFreeExperiences(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiUnitCombatFreeExperiences ? m_paiUnitCombatFreeExperiences[i] : -1; } /// Amount of extra Culture per turn a BuildingClass provides int CvPolicyEntry::GetBuildingClassCultureChange(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassCultureChanges ? m_paiBuildingClassCultureChanges[i] : -1; } /// Amount of extra Security per turn a BuildingClass provides int CvPolicyEntry::GetBuildingClassSecurityChange(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassSecurityChanges ? m_paiBuildingClassSecurityChanges[i] : -1; } /// Amount of extra Culture per turn a BuildingClass provides int CvPolicyEntry::GetBuildingClassHappiness(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassHappiness ? m_paiBuildingClassHappiness[i] : -1; } /// Number of free Units provided by this Policy int CvPolicyEntry::GetNumFreeUnitsByClass(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFreeUnitClasses ? m_paiFreeUnitClasses[i] : -1; } /// Instant tourism bump when a unit of a particular class is created int CvPolicyEntry::GetTourismByUnitClassCreated(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiTourismOnUnitCreation ? m_paiTourismOnUnitCreation[i] : -1; } /// Modifier to Hurry cost int CvPolicyEntry::GetHurryModifier(int i) const { - CvAssertMsg(i < GC.getNumHurryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumHurryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiHurryModifier ? m_paiHurryModifier[i] : -1; } /// Is this type of specialist now valid? bool CvPolicyEntry::IsSpecialistValid(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pabSpecialistValid ? m_pabSpecialistValid[i] : false; } #if defined(MOD_BALANCE_CORE) /// Does this Policy grant a free building? int CvPolicyEntry::GetFreeChosenBuilding(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiFreeChosenBuilding ? m_paiFreeChosenBuilding[i] : -1; } #endif #if defined(MOD_BALANCE_CORE_POLICIES) int CvPolicyEntry::GetResourceFromCSAlly(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourcefromCSAlly[i]; } /// Does this Policy grant yields from citizen birth? int CvPolicyEntry::GetYieldFromBirth(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirth[i]; } /// Does this Policy grant yields from citizen birth in the Capital? int CvPolicyEntry::GetYieldFromBirthCapital(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirthCapital[i]; } int CvPolicyEntry::GetYieldFromBirthRetroactive(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirthRetroactive[i]; } /// Does this Policy grant yields from citizen birth in the Capital? int CvPolicyEntry::GetYieldFromBirthCapitalRetroactive(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBirthCapitalRetroactive[i]; } /// Does this Policy grant yields from constructing buildings? int CvPolicyEntry::GetYieldFromConstruction(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromConstruction[i]; } /// Does this Policy grant yields from constructing buildings? int CvPolicyEntry::GetYieldFromWorldWonderConstruction(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromWorldWonderConstruction[i]; } /// Does this Policy grant yields from researching techs? int CvPolicyEntry::GetYieldFromTech(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromTech[i]; } /// Does this Policy grant yields from techs that were already researched? int CvPolicyEntry::GetYieldFromTechRetroactive(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromTechRetroactive[i]; } /// Does this Policy negate expansion unhappiness? @@ -3102,15 +3102,15 @@ int CvPolicyEntry::GetPressureMod() const /// Does this Policy grant yields from border growth? int CvPolicyEntry::GetYieldFromBorderGrowth(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBorderGrowth[i]; } /// Does this Policy grant yields from expending GPs? int CvPolicyEntry::GetYieldGPExpend(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldGPExpend[i]; } /// Does this Policy grant unhappiness reduction from garrisons? @@ -3190,39 +3190,39 @@ bool CvPolicyEntry::IsNoPartisans() const /// Does this Policy grant yields from conquering cities? int CvPolicyEntry::GetConquerorYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piConquerorYield[i]; } /// Does this Policy grant yields from conquering cities? int CvPolicyEntry::GetFounderYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFounderYield[i]; } /// Does this Policy boost yields from having your religion in the city? int CvPolicyEntry::GetReligionYieldMod(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piReligionYieldMod[i]; } /// Does this Policy boost building yields from having your religion in the city? int CvPolicyEntry::GetReligionBuildingYieldMod(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiReligionBuildingYieldMod[i][j]; } /// Does this Policy boost yields from golden ages? int CvPolicyEntry::GetGoldenAgeYieldMod(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoldenAgeYieldMod[i]; } @@ -3236,106 +3236,106 @@ int CvPolicyEntry::GetInvestmentModifier () const /// Yield modifier for a specific improvement by yield type int CvPolicyEntry::GetImprovementYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiImprovementYieldChanges[i][j]; } /// Yield modifier for a specific plot by yield type int CvPolicyEntry::GetPlotYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumPlotInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPlotInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiPlotYieldChanges[i][j]; } int CvPolicyEntry::GetFeatureYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiFeatureYieldChanges[i][j]; } int CvPolicyEntry::GetCityYieldFromUnimprovedFeature(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiCityYieldFromUnimprovedFeature[i][j]; } int CvPolicyEntry::GetUnimprovedFeatureYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiUnimprovedFeatureYieldChanges[i][j]; } int CvPolicyEntry::GetResourceYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiResourceYieldChanges[i][j]; } int CvPolicyEntry::GetTerrainYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTerrainYieldChanges[i][j]; } int CvPolicyEntry::GetTradeRouteYieldChange(int i, int j) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTradeRouteYieldChange[i][j]; } int CvPolicyEntry::GetSpecialistYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiSpecialistYieldChanges[i][j]; } int CvPolicyEntry::GetGreatPersonExpendedYield(int i, int j) const { - CvAssertMsg(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiGreatPersonExpendedYield[i][j]; } int CvPolicyEntry::GetGoldenAgeGreatPersonRateModifier(int i) const { - CvAssertMsg(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piGoldenAgeGreatPersonRateModifier ? m_piGoldenAgeGreatPersonRateModifier[i] : 0; } int CvPolicyEntry::GetYieldFromKills(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromKills ? m_piYieldFromKills[i] : 0; } @@ -3346,8 +3346,8 @@ int* CvPolicyEntry::GetYieldFromKillsArray() const int CvPolicyEntry::GetYieldFromBarbarianKills(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromBarbarianKills ? m_piYieldFromBarbarianKills[i] : 0; } @@ -3358,8 +3358,8 @@ int* CvPolicyEntry::GetYieldFromBarbarianKillsArray() const int CvPolicyEntry::GetYieldChangeTradeRoute(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeTradeRoute ? m_piYieldChangeTradeRoute[i] : 0; } @@ -3370,8 +3370,8 @@ int* CvPolicyEntry::GetYieldChangeTradeRouteArray() const int CvPolicyEntry::GetYieldChangesNaturalWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangesNaturalWonder ? m_piYieldChangesNaturalWonder[i] : 0; } @@ -3382,8 +3382,8 @@ int* CvPolicyEntry::GetYieldChangesNaturalWonderArray() const int CvPolicyEntry::GetYieldChangeWorldWonder(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldChangeWorldWonder ? m_piYieldChangeWorldWonder[i] : 0; } @@ -3394,8 +3394,8 @@ int* CvPolicyEntry::GetYieldChangeWorldWonderArray() const int CvPolicyEntry::GetYieldFromMinorDemand(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromMinorDemand ? m_piYieldFromMinorDemand[i] : 0; } @@ -3406,8 +3406,8 @@ int* CvPolicyEntry::GetYieldFromMinorDemandArray() const int CvPolicyEntry::GetYieldFromWLTKD(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromWLTKD ? m_piYieldFromWLTKD[i] : 0; } @@ -3418,8 +3418,8 @@ int* CvPolicyEntry::GetYieldFromWLTKDArray() const int CvPolicyEntry::GetArtifactYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piArtifactYieldChanges ? m_piArtifactYieldChanges[i] : 0; } @@ -3430,8 +3430,8 @@ int* CvPolicyEntry::GetArtifactYieldChangesArray() const int CvPolicyEntry::GetArtYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piArtYieldChanges ? m_piArtYieldChanges[i] : 0; } @@ -3442,8 +3442,8 @@ int* CvPolicyEntry::GetArtYieldChangesArray() const int CvPolicyEntry::GetLitYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piLitYieldChanges ? m_piLitYieldChanges[i] : 0; } @@ -3454,8 +3454,8 @@ int* CvPolicyEntry::GetLitYieldChangesArray() const int CvPolicyEntry::GetMusicYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piMusicYieldChanges ? m_piMusicYieldChanges[i] : 0; } @@ -3466,8 +3466,8 @@ int* CvPolicyEntry::GetMusicYieldChangesArray() const int CvPolicyEntry::GetRelicYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piRelicYieldChanges ? m_piRelicYieldChanges[i] : 0; } @@ -3478,8 +3478,8 @@ int* CvPolicyEntry::GetRelicYieldChangesArray() const int CvPolicyEntry::GetFilmYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFilmYieldChanges ? m_piFilmYieldChanges[i] : 0; } @@ -3490,8 +3490,8 @@ int* CvPolicyEntry::GetFilmYieldChangesArray() const int CvPolicyEntry::GetYieldFromNonSpecialistCitizens(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromNonSpecialistCitizens ? m_piYieldFromNonSpecialistCitizens[i] : 0; } @@ -3501,8 +3501,8 @@ int* CvPolicyEntry::GetYieldFromNonSpecialistCitizensArray() const } int CvPolicyEntry::GetYieldModifierFromGreatWorks(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifierFromGreatWorks ? m_piYieldModifierFromGreatWorks[i] : 0; } @@ -3513,8 +3513,8 @@ int* CvPolicyEntry::GetYieldModifierFromGreatWorksArray() const int CvPolicyEntry::GetYieldModifierFromActiveSpies(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldModifierFromActiveSpies ? m_piYieldModifierFromActiveSpies[i] : 0; } @@ -3525,8 +3525,8 @@ int* CvPolicyEntry::GetYieldModifierFromActiveSpiesArray() const int CvPolicyEntry::GetYieldFromDelegateCount(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromDelegateCount ? m_piYieldFromDelegateCount[i] : 0; } @@ -3537,8 +3537,8 @@ int* CvPolicyEntry::GetYieldFromDelegateCountArray() const int CvPolicyEntry::GetYieldFromXMilitaryUnits(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldFromXMilitaryUnits ? m_piYieldFromXMilitaryUnits[i] : 0; } @@ -3549,8 +3549,8 @@ int* CvPolicyEntry::GetYieldFromXMilitaryUnitsArray() const int CvPolicyEntry::GetYieldPerCityOverStrengthThreshold(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldPerCityOverStrengthThreshold ? m_piYieldPerCityOverStrengthThreshold[i] : 0; } @@ -3598,59 +3598,59 @@ bool CvPolicyEntry::IsCSResourcesForMonopolies() const /// Yield modifier for a specific BuildingClass by yield type int CvPolicyEntry::GetBuildingClassYieldModifiers(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldModifiers[i][j]; } /// Yield change for a specific BuildingClass by yield type int CvPolicyEntry::GetBuildingClassYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiBuildingClassYieldChanges[i][j]; } /// Production modifier for a specific BuildingClass int CvPolicyEntry::GetBuildingClassProductionModifier(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassProductionModifiers[i]; } /// Production modifier for a specific UnitClass int CvPolicyEntry::GetUnitClassProductionModifiers(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiUnitClassProductionModifiers[i]; } /// Tourism modifier for a specific BuildingClass int CvPolicyEntry::GetBuildingClassTourismModifier(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiBuildingClassTourismModifiers[i]; } /// Find value of flavors associated with this policy int CvPolicyEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : 0; } /// Culture modifier for a specific improvement int CvPolicyEntry::GetImprovementCultureChanges(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piImprovementCultureChange[i]; } @@ -3658,16 +3658,16 @@ int CvPolicyEntry::GetImprovementCultureChanges(int i) const /// Yields whenever you identify a foreign spy int CvPolicyEntry::GetYieldForSpyID(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldForSpyID[i]; } /// Yields whenever you liberate a city int CvPolicyEntry::GetYieldForLiberation(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piYieldForLiberation[i]; } /// Influence in all CS whenever you liberate a city @@ -3683,8 +3683,8 @@ int CvPolicyEntry::GetExperienceForLiberation() const /// Building in the liberated city whenever you liberate a city int CvPolicyEntry::GetBuildingClassInLiberatedCities(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piBuildingClassInLiberatedCities[i]; } /// Units in the liberated city whenever you liberate a city @@ -3695,8 +3695,8 @@ int CvPolicyEntry::GetUnitsInLiberatedCities() const ///Gives your corp an extra franchise for every improvement of this type int CvPolicyEntry::getFranchisesPerImprovement(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFranchisesPerImprovement[i]; } ///Gives extra air slots to every city @@ -4009,28 +4009,28 @@ void CvPlayerPolicies::Init(CvPolicyXMLEntries* pPolicies, CvPlayer* pPlayer, bo m_pPlayer = pPlayer; // Initialize policy status array - CvAssertMsg(m_pabFreePolicy==NULL, "about to leak memory, CvPlayerPolicies::m_pabFreePolicy"); + ASSERT(m_pabFreePolicy==NULL, "about to leak memory, CvPlayerPolicies::m_pabFreePolicy"); m_pabFreePolicy = FNEW(bool[m_pPolicies->GetNumPolicies()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pabHasPolicy==NULL, "about to leak memory, CvPlayerPolicies::m_pabHasPolicy"); + ASSERT(m_pabHasPolicy==NULL, "about to leak memory, CvPlayerPolicies::m_pabHasPolicy"); m_pabHasPolicy = FNEW(bool[m_pPolicies->GetNumPolicies()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pabHasOneShotPolicyFired==NULL, "about to leak memory, CvPlayerPolicies::m_pabHasOneShotPolicyFired"); + ASSERT(m_pabHasOneShotPolicyFired==NULL, "about to leak memory, CvPlayerPolicies::m_pabHasOneShotPolicyFired"); m_pabHasOneShotPolicyFired = FNEW(bool[m_pPolicies->GetNumPolicies()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pabHaveOneShotFreeUnitsFired==NULL, "about to leak memory, CvPlayerPolicies::m_pabHaveOneShotFreeUnitsFired"); + ASSERT(m_pabHaveOneShotFreeUnitsFired==NULL, "about to leak memory, CvPlayerPolicies::m_pabHaveOneShotFreeUnitsFired"); m_pabHaveOneShotFreeUnitsFired = FNEW(bool[m_pPolicies->GetNumPolicies()], c_eCiv5GameplayDLL, 0); // Policy Branches Chosen - CvAssertMsg(m_pabPolicyBranchUnlocked==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchUnlocked"); + ASSERT(m_pabPolicyBranchUnlocked==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchUnlocked"); m_pabPolicyBranchUnlocked = FNEW(bool[m_pPolicies->GetNumPolicyBranches()], c_eCiv5GameplayDLL, 0); // Policy Branches Blocked by choices - CvAssertMsg(m_pabPolicyBranchBlocked==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchBlocked"); + ASSERT(m_pabPolicyBranchBlocked==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchBlocked"); m_pabPolicyBranchBlocked = FNEW(bool[m_pPolicies->GetNumPolicyBranches()], c_eCiv5GameplayDLL, 0); // Policy Branches finished - CvAssertMsg(m_pabPolicyBranchFinished==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchFinished"); + ASSERT(m_pabPolicyBranchFinished==NULL, "about to leak memory, CvPlayerPolicies::m_pabPolicyBranchFinished"); m_pabPolicyBranchFinished = FNEW(bool[m_pPolicies->GetNumPolicyBranches()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paePolicyBlockedBranchCheck==NULL, "about to leak memory, CvPlayerPolicies::m_paePolicyBlockedBranchCheck"); + ASSERT(m_paePolicyBlockedBranchCheck==NULL, "about to leak memory, CvPlayerPolicies::m_paePolicyBlockedBranchCheck"); m_paePolicyBlockedBranchCheck = FNEW(PolicyBranchTypes[m_pPolicies->GetNumPolicies()], c_eCiv5GameplayDLL, 0); // Create AI object @@ -4085,7 +4085,7 @@ void CvPlayerPolicies::Reset() m_pPolicyAI->Reset(); - CvAssert( m_pPolicies->GetNumPolicies() == m_pPolicies->GetNumPolicies()); + ASSERT( m_pPolicies->GetNumPolicies() == m_pPolicies->GetNumPolicies()); // Pre-calculate a policy to branch table so we don't do this over and over again. for (iI = 0; iI < m_pPolicies->GetNumPolicies(); ++iI) { @@ -4129,7 +4129,7 @@ void CvPlayerPolicies::Reset() template void CvPlayerPolicies::Serialize(PlayerPolicies& playerPolicies, Visitor& visitor) { - CvAssertMsg(playerPolicies.m_pPolicies != NULL && playerPolicies.m_pPolicies->GetNumPolicies() > 0, "Number of policies to serialize is expected to greater than 0"); + ASSERT(playerPolicies.m_pPolicies != NULL && playerPolicies.m_pPolicies->GetNumPolicies() > 0, "Number of policies to serialize is expected to greater than 0"); const int iPolicyCount = playerPolicies.m_pPolicies->GetNumPolicies(); const int iPolicyBranchCount = playerPolicies.m_pPolicies->GetNumPolicyBranches(); @@ -4226,22 +4226,22 @@ void CvPlayerPolicies::UpdateModifierCache() /// Accessor: does a player have a policy bool CvPlayerPolicies::HasPolicy(PolicyTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabHasPolicy[eIndex]; } /// Accessor: was this policy given for free bool CvPlayerPolicies::IsFreePolicy(PolicyTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabFreePolicy[eIndex]; } /// Accessor: set whether player has a policy void CvPlayerPolicies::SetPolicy(PolicyTypes eIndex, bool bNewValue, bool bFree) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < m_pPolicies->GetNumPolicies(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < m_pPolicies->GetNumPolicies(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(eIndex); if (pkPolicyInfo == NULL) @@ -4341,31 +4341,31 @@ void CvPlayerPolicies::SetPolicy(PolicyTypes eIndex, bool bNewValue, bool bFree) /// Accessor: is a one-shot policy spent? bool CvPlayerPolicies::HasOneShotPolicyFired(PolicyTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabHasOneShotPolicyFired[eIndex]; } /// mark a one shot policy as spent void CvPlayerPolicies::SetOneShotPolicyFired(PolicyTypes eIndex, bool bFired) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_pabHasOneShotPolicyFired[eIndex] = bFired; } bool CvPlayerPolicies::HaveOneShotFreeUnitsFired(PolicyTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabHaveOneShotFreeUnitsFired[eIndex]; } /// mark a one shot policy as spent void CvPlayerPolicies::SetOneShotFreeUnitsFired(PolicyTypes eIndex, bool bFired) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_pabHaveOneShotFreeUnitsFired[eIndex] = bFired; } @@ -5114,8 +5114,8 @@ int CvPlayerPolicies::GetNextPolicyCost() /// Can we adopt this policy? bool CvPlayerPolicies::CanAdoptPolicy(PolicyTypes eIndex, bool bIgnoreCost) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPolicyInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvPolicyEntry* pkPolicyEntry = GC.getPolicyInfo(eIndex); if(pkPolicyEntry == NULL) @@ -5459,16 +5459,16 @@ bool CvPlayerPolicies::CanUnlockPolicyBranch(PolicyBranchTypes eBranchType) /// Accessor: has a player unlocked eBranchType to pick Policies from? bool CvPlayerPolicies::IsPolicyBranchUnlocked(PolicyBranchTypes eBranchType) const { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabPolicyBranchUnlocked[eBranchType]; } /// Accessor: sets that a player has (or hasn't) unlocked eBranchType to pick Policies from void CvPlayerPolicies::SetPolicyBranchUnlocked(PolicyBranchTypes eBranchType, bool bNewValue, bool bRevolution) { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (IsPolicyBranchUnlocked(eBranchType) != bNewValue) { @@ -5706,8 +5706,8 @@ void CvPlayerPolicies::DoSwitchToPolicyBranch(PolicyBranchTypes eBranchType) /// Accessor: is eBranchType blocked because of branch choices? void CvPlayerPolicies::SetPolicyBranchBlocked(PolicyBranchTypes eBranchType, bool bValue) { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvPolicyBranchEntry* pkPolicyBranchEntry = GC.getPolicyBranchInfo(eBranchType); if(pkPolicyBranchEntry) @@ -5748,16 +5748,16 @@ void CvPlayerPolicies::SetPolicyBranchBlocked(PolicyBranchTypes eBranchType, boo /// Accessor: is eBranchType blocked because of branch choices? bool CvPlayerPolicies::IsPolicyBranchBlocked(PolicyBranchTypes eBranchType) const { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabPolicyBranchBlocked[eBranchType]; } /// Accessor: is eType blocked because of choices? bool CvPlayerPolicies::IsPolicyBlocked(PolicyTypes eType) const { - CvAssertMsg(eType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eType < m_pPolicies->GetNumPolicies(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eType < m_pPolicies->GetNumPolicies(), "eIndex is expected to be within maximum bounds (invalid Index)"); // Get the policy branch we have to check. PolicyBranchTypes eBranch = m_paePolicyBlockedBranchCheck[eType]; @@ -5790,7 +5790,7 @@ bool CvPlayerPolicies::HasAdoptedIdeology(PolicyBranchTypes eIdeology) const void CvPlayerPolicies::DoSwitchIdeologies(PolicyBranchTypes eNewBranchType) { PolicyBranchTypes eOldBranchType = GetLateGamePolicyTree(); - CvAssertMsg(eOldBranchType != eNewBranchType && eNewBranchType != NO_POLICY_BRANCH_TYPE && eOldBranchType != NO_POLICY_BRANCH_TYPE, "Illegal time for Ideology change"); + ASSERT(eOldBranchType != eNewBranchType && eNewBranchType != NO_POLICY_BRANCH_TYPE && eOldBranchType != NO_POLICY_BRANCH_TYPE, "Illegal time for Ideology change"); GAMEEVENTINVOKE_HOOK(GAMEEVENT_IdeologySwitched, GetPlayer()->GetID(), eOldBranchType, eNewBranchType); @@ -5909,8 +5909,8 @@ int CvPlayerPolicies::GetNumPolicyBranchesFinished() const /// Accessor: is eBranchType finished? void CvPlayerPolicies::SetPolicyBranchFinished(PolicyBranchTypes eBranchType, bool bValue) { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (bValue != IsPolicyBranchFinished(eBranchType)) { @@ -5987,8 +5987,8 @@ void CvPlayerPolicies::SetPolicyBranchFinished(PolicyBranchTypes eBranchType, bo /// Accessor: is eBranchType finished? bool CvPlayerPolicies::IsPolicyBranchFinished(PolicyBranchTypes eBranchType) const { - CvAssertMsg(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eBranchType >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eBranchType < m_pPolicies->GetNumPolicyBranches(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabPolicyBranchFinished[eBranchType]; } diff --git a/CvGameCoreDLL_Expansion2/CvPreGame.cpp b/CvGameCoreDLL_Expansion2/CvPreGame.cpp index 13a9f73cff..5a84f63294 100644 --- a/CvGameCoreDLL_Expansion2/CvPreGame.cpp +++ b/CvGameCoreDLL_Expansion2/CvPreGame.cpp @@ -2300,7 +2300,7 @@ void setCalendar(const CvString& c) Database::SingleResult kResult; if(!DB.SelectAt(kResult, "Calendars", "Type", c.c_str())) { - CvAssertMsg(false, "Cannot find calendar info."); + ASSERT(false, "Cannot find calendar info."); } s_calendarInfo.CacheResult(kResult); @@ -2367,7 +2367,7 @@ void setClimate(const CvString& c) void setCustomWorldSize(int iWidth, int iHeight, int iPlayers, int iMinorCivs) { - FAssertMsg(iWidth >= 20 && iHeight >= 20, "Cannot have a map that small!"); + ASSERT(iWidth >= 20 && iHeight >= 20, "Cannot have a map that small!"); const int iArea = iWidth * iHeight; @@ -2956,7 +2956,7 @@ void setGameType(const CvString& g) } else { - //CvAssertMsg(false, "Invalid game type in ini file!"); + //ASSERT(false, "Invalid game type in ini file!"); setGameType(GAME_TYPE_NONE); } } @@ -3364,7 +3364,7 @@ void setTurnTimer(TurnTimerTypes t) Database::SingleResult kResult; if(!DB.SelectAt(kResult, "TurnTimers", "ID", static_cast(t))) { - CvAssertMsg(false, "Cannot find turn timer info."); + ASSERT(false, "Cannot find turn timer info."); } s_turnTimer.CacheResult(kResult); } @@ -3374,7 +3374,7 @@ void setTurnTimer(const CvString& t) Database::SingleResult kResult; if(!DB.SelectAt(kResult, "TurnTimers", "Type", t.c_str())) { - CvAssertMsg(false, "Cannot find turn timer info."); + ASSERT(false, "Cannot find turn timer info."); } s_turnTimer.CacheResult(kResult); @@ -3399,7 +3399,7 @@ void setVictory(VictoryTypes v, bool isValid) void setVictories(const std::vector& v) { - CvAssert(v.size() <= std::size_t(s_numVictoryInfos)); + ASSERT(v.size() <= std::size_t(s_numVictoryInfos)); for (std::size_t i = 0; i < v.size(); i++) s_victories[i] = v[i]; } @@ -3468,7 +3468,7 @@ void VerifyHandicap(PlayerTypes p, bool bHumanPlayerSwap) void setWorldSize(WorldSizeTypes w, bool bResetSlots) { - CvAssert(!gameStarted() || isNetworkMultiplayerGame() || isHotSeatGame()); + ASSERT(!gameStarted() || isNetworkMultiplayerGame() || isHotSeatGame()); //Query Database::Results kQuery; @@ -3484,13 +3484,13 @@ void setWorldSize(WorldSizeTypes w, bool bResetSlots) } else { - CvAssertMsg(false, "Could not find world size entry.") + ASSERT(false, "Could not find world size entry.") } } void setWorldSize(const CvString& w) { - CvAssert(!gameStarted() || isNetworkMultiplayerGame() || isHotSeatGame()); + ASSERT(!gameStarted() || isNetworkMultiplayerGame() || isHotSeatGame()); Database::Results kQuery; @@ -3505,7 +3505,7 @@ void setWorldSize(const CvString& w) } else { - CvAssertMsg(false, "Could not find world size entry.") + ASSERT(false, "Could not find world size entry.") } } @@ -3530,7 +3530,7 @@ const std::vector& GetSlotStatus() void StringToBools(const char* szString, int* iNumBools, bool** ppBools) { - FAssertMsg(szString, "null string"); + ASSERT(szString, "null string"); if(szString) { *iNumBools = strlen(szString); @@ -3932,7 +3932,7 @@ bool isKnownPlayerReq(PlayerTypes ePlayer) bool handleKnownPlayerReq(PlayerTypes ePlayer) { // Only makes sense for Network MP - CvAssertMsg(isNetworkMultiplayerGame(), "Checking known players table does not make sense outside of Network MP games!"); + ASSERT(isNetworkMultiplayerGame(), "Checking known players table does not make sense outside of Network MP games!"); // decode actual player ID - it was encoded as -(ePlayer+2), probably in StagingRoom.lua ePlayer = static_cast(-ePlayer - 2); diff --git a/CvGameCoreDLL_Expansion2/CvProcessProductionAI.cpp b/CvGameCoreDLL_Expansion2/CvProcessProductionAI.cpp index 26373e25d7..7b91a49139 100644 --- a/CvGameCoreDLL_Expansion2/CvProcessProductionAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvProcessProductionAI.cpp @@ -352,7 +352,7 @@ int CvProcessProductionAI::CheckProcessBuildSanity(ProcessTypes eProcess, int iT for (uint i = 0; i < veRewards.size(); i++) { CvLeagueProjectRewardEntry* pRewardInfo = GC.getLeagueProjectRewardInfo(veRewards[i]); - CvAssert(pRewardInfo); + ASSERT(pRewardInfo); if (!pRewardInfo) continue; // Free Building in Capital @@ -516,7 +516,7 @@ void CvProcessProductionAI::LogPossibleBuilds() CvString strDesc; CvString strLogName; - CvAssert(m_pCity); + ASSERT(m_pCity); if(!m_pCity) return; // Find the name of this civ and city @@ -526,7 +526,7 @@ void CvProcessProductionAI::LogPossibleBuilds() // Open the log file FILogFile* pLog = NULL; pLog = LOGFILEMGR.GetLog(m_pCity->GetCityStrategyAI()->GetLogFileName(playerName, cityName), FILogFile::kDontTimeStamp); - CvAssert(pLog); + ASSERT(pLog); if(!pLog) return; // Get the leading info for this line diff --git a/CvGameCoreDLL_Expansion2/CvProjectClasses.cpp b/CvGameCoreDLL_Expansion2/CvProjectClasses.cpp index a1b63d5745..7cf90a20bc 100644 --- a/CvGameCoreDLL_Expansion2/CvProjectClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvProjectClasses.cpp @@ -212,8 +212,8 @@ int CvProjectEntry::GetVictoryDelayPercent() const /// Find value of flavors associated with this building int CvProjectEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFlavorTypes() && m_piFlavorValue) { @@ -352,8 +352,8 @@ void CvProjectEntry::SetCreateSound(const char* szVal) /// Resources consumed to construct int CvProjectEntry::GetResourceQuantityRequirement(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumResourceInfos() && m_piResourceQuantityRequirements) { @@ -366,8 +366,8 @@ int CvProjectEntry::GetResourceQuantityRequirement(int i) const /// Maximum number of these needed for victory condition int CvProjectEntry::GetVictoryThreshold(int i) const { - CvAssertMsg(i < GC.getNumVictoryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumVictoryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumVictoryInfos() && m_piVictoryThreshold) { @@ -380,8 +380,8 @@ int CvProjectEntry::GetVictoryThreshold(int i) const /// Minimum number of these needed for victory condition int CvProjectEntry::GetVictoryMinThreshold(int i) const { - CvAssertMsg(i < GC.getNumVictoryInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumVictoryInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumVictoryInfos()) { @@ -399,8 +399,8 @@ int CvProjectEntry::GetVictoryMinThreshold(int i) const /// Other projects required before this one can be built int CvProjectEntry::GetProjectsNeeded(int i) const { - CvAssertMsg(i < GC.getNumProjectInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumProjectInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumProjectInfos() && m_piProjectsNeeded) { diff --git a/CvGameCoreDLL_Expansion2/CvProjectProductionAI.cpp b/CvGameCoreDLL_Expansion2/CvProjectProductionAI.cpp index b2f9a6b01e..ac278141c1 100644 --- a/CvGameCoreDLL_Expansion2/CvProjectProductionAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvProjectProductionAI.cpp @@ -100,7 +100,7 @@ int CvProjectProductionAI::GetWeight(ProjectTypes eProject) /// Recommend highest-weighted Project ProjectTypes CvProjectProductionAI::RecommendProject() { - CvAssert(m_pCity); + ASSERT(m_pCity); if(!m_pCity) return NO_PROJECT; @@ -372,7 +372,7 @@ void CvProjectProductionAI::LogPossibleBuilds() CvString strDesc; CvString strLogName; - CvAssert(m_pCity); + ASSERT(m_pCity); if(!m_pCity) return; // Find the name of this civ and city @@ -382,7 +382,7 @@ void CvProjectProductionAI::LogPossibleBuilds() // Open the log file FILogFile* pLog = NULL; pLog = LOGFILEMGR.GetLog(m_pCity->GetCityStrategyAI()->GetLogFileName(playerName, cityName), FILogFile::kDontTimeStamp); - CvAssert(pLog); + ASSERT(pLog); if(!pLog) return; // Get the leading info for this line diff --git a/CvGameCoreDLL_Expansion2/CvPromotionClasses.cpp b/CvGameCoreDLL_Expansion2/CvPromotionClasses.cpp index f49a63a1c1..59c57517be 100644 --- a/CvGameCoreDLL_Expansion2/CvPromotionClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvPromotionClasses.cpp @@ -737,7 +737,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -745,7 +745,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iTerrainID = pResults->GetInt("TerrainID"); - CvAssert(iTerrainID > -1 && iTerrainID < iNumTerrains); + ASSERT(iTerrainID > -1 && iTerrainID < iNumTerrains); const int iTerrainAttack = pResults->GetInt("Attack"); m_piTerrainAttackPercent[iTerrainID] = iTerrainAttack; @@ -807,7 +807,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -815,7 +815,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iFeatureID = pResults->GetInt("FeatureID"); - CvAssert(iFeatureID > -1 && iFeatureID < iNumFeatures); + ASSERT(iFeatureID > -1 && iFeatureID < iNumFeatures); const int iFeatureAttack = pResults->GetInt("Attack"); m_piFeatureAttackPercent[iFeatureID] = iFeatureAttack; @@ -867,7 +867,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -875,7 +875,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iYieldID = pResults->GetInt("YieldID"); - CvAssert(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); + ASSERT(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); const int iYield = pResults->GetInt("Yield"); m_piYieldFromScouting[iYieldID] = iYield; @@ -894,7 +894,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -902,7 +902,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iYieldID = pResults->GetInt("YieldID"); - CvAssert(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); + ASSERT(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); const int iYield = pResults->GetInt("Yield"); m_piYieldFromKills[iYieldID] = iYield; @@ -920,7 +920,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -928,7 +928,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iYieldID = pResults->GetInt("YieldID"); - CvAssert(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); + ASSERT(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); const int iYield = pResults->GetInt("Yield"); m_piGarrisonYield[iYieldID] = iYield; @@ -947,7 +947,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if (!pResults) return false; pResults->Bind(1, szPromotionType); @@ -955,7 +955,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while (pResults->Step()) { const int iYieldID = pResults->GetInt("YieldID"); - CvAssert(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); + ASSERT(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); const int iYield = pResults->GetInt("Yield"); m_piGarrisonYield[iYieldID] = iYield; @@ -974,7 +974,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -982,7 +982,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iYieldID = pResults->GetInt("YieldID"); - CvAssert(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); + ASSERT(iYieldID > -1 && iYieldID < NUM_YIELD_TYPES); const int iYield = pResults->GetInt("Yield"); m_piYieldFromBarbarianKills[iYieldID] = iYield; @@ -1003,7 +1003,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1011,7 +1011,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iUnitClassID = pResults->GetInt(0); - CvAssert(iUnitClassID > -1 && iUnitClassID < iNumUnitClasses); + ASSERT(iUnitClassID > -1 && iUnitClassID < iNumUnitClasses); const int iModifier = pResults->GetInt("Modifier"); m_piUnitClassModifierPercent[iUnitClassID] = iModifier; @@ -1041,7 +1041,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1049,7 +1049,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iUnitCombatID = pResults->GetInt(0); - CvAssert(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); + ASSERT(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); const int iModifier = pResults->GetInt("Modifier"); m_piCombatModPerAdjacentUnitCombatModifierPercent[iUnitCombatID] = iModifier; @@ -1106,7 +1106,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1114,7 +1114,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iDomainID = pResults->GetInt(0); - CvAssert(iDomainID > -1 && iDomainID < iNumDomains); + ASSERT(iDomainID > -1 && iDomainID < iNumDomains); const int iModifier = pResults->GetInt("Modifier"); if (iDomainID > -1 && iDomainID < NUM_DOMAIN_TYPES) @@ -1144,7 +1144,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1152,7 +1152,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iUnitCombatID = pResults->GetInt(0); - CvAssert(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); + ASSERT(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); const int iUnitCombatMod = pResults->GetInt(1); m_piUnitCombatModifierPercent[iUnitCombatID] = iUnitCombatMod; @@ -1173,7 +1173,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1181,7 +1181,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iUnitCombatInfoID = pResults->GetInt(0); - CvAssert(iUnitCombatInfoID < iNumUnitCombatClasses); + ASSERT(iUnitCombatInfoID < iNumUnitCombatClasses); m_pbUnitCombat[iUnitCombatInfoID] = true; } @@ -1201,7 +1201,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili pResults = kUtility.PrepareResults(sqlKey, szSQL); } - CvAssert(pResults); + ASSERT(pResults); if(!pResults) return false; pResults->Bind(1, szPromotionType); @@ -1209,7 +1209,7 @@ bool CvPromotionEntry::CacheResults(Database::Results& kResults, CvDatabaseUtili while(pResults->Step()) { const int iUnit = (UnitTypes)pResults->GetInt(0); - CvAssert(iUnit < iNumUnitTypes); + ASSERT(iUnit < iNumUnitTypes); m_pbCivilianUnitType[iUnit] = true; } @@ -2669,8 +2669,8 @@ void CvPromotionEntry::SetSound(const char* szVal) /// Percentage bonus when attacking a tile of a given terrain int CvPromotionEntry::GetTerrainAttackPercent(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_piTerrainAttackPercent) { @@ -2683,8 +2683,8 @@ int CvPromotionEntry::GetTerrainAttackPercent(int i) const /// Percentage bonus when when defending a tile of a given terrain int CvPromotionEntry::GetTerrainDefensePercent(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_piTerrainDefensePercent) { @@ -2697,8 +2697,8 @@ int CvPromotionEntry::GetTerrainDefensePercent(int i) const /// Percentage bonus when when attacking a tile with a given feature int CvPromotionEntry::GetFeatureAttackPercent(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_piFeatureAttackPercent) { @@ -2711,8 +2711,8 @@ int CvPromotionEntry::GetFeatureAttackPercent(int i) const /// Percentage bonus when when defending a tile with a given feature int CvPromotionEntry::GetFeatureDefensePercent(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_piFeatureDefensePercent) { @@ -2725,8 +2725,8 @@ int CvPromotionEntry::GetFeatureDefensePercent(int i) const /// Modifier to yield by type int CvPromotionEntry::GetYieldModifier(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_YIELD_TYPES && m_piYieldModifier) { return m_piYieldModifier[i]; @@ -2738,8 +2738,8 @@ int CvPromotionEntry::GetYieldModifier(int i) const /// Modifier to yield by type int CvPromotionEntry::GetYieldChange(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i > -1 && i < NUM_YIELD_TYPES && m_piYieldChange) { return m_piYieldChange[i]; @@ -2749,8 +2749,8 @@ int CvPromotionEntry::GetYieldChange(int i) const } int CvPromotionEntry::GetYieldFromScouting(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_YIELD_TYPES && m_piYieldFromScouting) { @@ -2762,8 +2762,8 @@ int CvPromotionEntry::GetYieldFromScouting(int i) const #endif int CvPromotionEntry::GetYieldFromKills(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_YIELD_TYPES && m_piYieldFromKills) { @@ -2775,8 +2775,8 @@ int CvPromotionEntry::GetYieldFromKills(int i) const int CvPromotionEntry::GetGarrisonYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_YIELD_TYPES && m_piGarrisonYield) { @@ -2788,8 +2788,8 @@ int CvPromotionEntry::GetGarrisonYield(int i) const int CvPromotionEntry::GetFortificationYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i > -1 && i < NUM_YIELD_TYPES && m_piFortificationYield) { @@ -2801,8 +2801,8 @@ int CvPromotionEntry::GetFortificationYield(int i) const int CvPromotionEntry::GetYieldFromBarbarianKills(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_YIELD_TYPES && m_piYieldFromBarbarianKills) { @@ -2815,8 +2815,8 @@ int CvPromotionEntry::GetYieldFromBarbarianKills(int i) const /// Percentage bonus when fighting against a specific unit *combat* class int CvPromotionEntry::GetUnitCombatModifierPercent(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitCombatClassInfos() && m_piUnitCombatModifierPercent) { @@ -2829,8 +2829,8 @@ int CvPromotionEntry::GetUnitCombatModifierPercent(int i) const /// Percentage bonus when fighting against a specific unit class int CvPromotionEntry::GetUnitClassModifierPercent(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitClassInfos() && m_piUnitClassModifierPercent) { @@ -2843,8 +2843,8 @@ int CvPromotionEntry::GetUnitClassModifierPercent(int i) const /// Percentage bonus when attacking a specific unit class int CvPromotionEntry::GetUnitClassAttackModifier(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitClassInfos() && m_piUnitClassAttackModifier) { @@ -2857,8 +2857,8 @@ int CvPromotionEntry::GetUnitClassAttackModifier(int i) const /// Percentage bonus when defending against a specific unit class int CvPromotionEntry::GetUnitClassDefenseModifier(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitClassInfos() && m_piUnitClassDefenseModifier) { @@ -2871,8 +2871,8 @@ int CvPromotionEntry::GetUnitClassDefenseModifier(int i) const /// Percentage bonus when fighting against a unit with a specific domain (LAND/SEA/AIR) int CvPromotionEntry::GetDomainModifierPercent(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_DOMAIN_TYPES && m_piDomainModifierPercent) { @@ -2885,8 +2885,8 @@ int CvPromotionEntry::GetDomainModifierPercent(int i) const /// Percentage bonus when attacking a unit with a specific domain (LAND/SEA/AIR) int CvPromotionEntry::GetDomainAttackPercent(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_DOMAIN_TYPES && m_piDomainAttackPercent) { @@ -2899,8 +2899,8 @@ int CvPromotionEntry::GetDomainAttackPercent(int i) const /// Percentage bonus when defending against a unit with a specific domain (LAND/SEA/AIR) int CvPromotionEntry::GetDomainDefensePercent(int i) const { - CvAssertMsg(i < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < NUM_DOMAIN_TYPES && m_piDomainDefensePercent) { @@ -2914,8 +2914,8 @@ int CvPromotionEntry::GetDomainDefensePercent(int i) const #if defined(MOD_BALANCE_CORE) int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatModifierPercent(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitCombatClassInfos() && m_piCombatModPerAdjacentUnitCombatModifierPercent) { @@ -2928,8 +2928,8 @@ int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatModifierPercent(int i) co /// Percentage bonus when attacking next to friendly unit *combat* classes (increases with more adjacent units) int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatAttackModifier(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitCombatClassInfos() && m_piCombatModPerAdjacentUnitCombatAttackModifier) { @@ -2942,8 +2942,8 @@ int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatAttackModifier(int i) con /// Percentage bonus when defending next to friendly unit *combat* classes (increases with more adjacent units) [not enemy as intended] int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatDefenseModifier(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitCombatClassInfos() && m_piCombatModPerAdjacentUnitCombatDefenseModifier) { @@ -2956,8 +2956,8 @@ int CvPromotionEntry::GetCombatModPerAdjacentUnitCombatDefenseModifier(int i) co /// Immediately gain these Yields when the promotion is gained std::pair CvPromotionEntry::GetInstantYields(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i > -1 && i < NUM_YIELD_TYPES && !m_piInstantYields.empty()) { @@ -2975,8 +2975,8 @@ std::pair CvPromotionEntry::GetInstantYields(int i) const /// Indicates if a feature type is traversable by the unit int CvPromotionEntry::GetFeaturePassableTech(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_piFeaturePassableTech) { @@ -2989,8 +2989,8 @@ int CvPromotionEntry::GetFeaturePassableTech(int i) const /// Indicates if a unit ignores terrain cost in a type of terrain bool CvPromotionEntry::GetIgnoreTerrainCostIn(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbIgnoreTerrainCostIn) { @@ -3003,8 +3003,8 @@ bool CvPromotionEntry::GetIgnoreTerrainCostIn(int i) const /// Indicates if a unit ignores terrain cost from a type of terrain bool CvPromotionEntry::GetIgnoreTerrainCostFrom(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbIgnoreTerrainCostFrom) { @@ -3017,8 +3017,8 @@ bool CvPromotionEntry::GetIgnoreTerrainCostFrom(int i) const /// Indicates if a unit ignores terrain cost in a type of terrain feature bool CvPromotionEntry::GetIgnoreFeatureCostIn(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbIgnoreFeatureCostIn) { @@ -3031,8 +3031,8 @@ bool CvPromotionEntry::GetIgnoreFeatureCostIn(int i) const /// Indicates if a unit ignores terrain cost in a type of terrain feature bool CvPromotionEntry::GetIgnoreFeatureCostFrom(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbIgnoreFeatureCostFrom) { @@ -3045,8 +3045,8 @@ bool CvPromotionEntry::GetIgnoreFeatureCostFrom(int i) const /// Indicates if a unit can move twice as fast in a type of terrain bool CvPromotionEntry::GetTerrainDoubleMove(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbTerrainDoubleMove) { @@ -3059,8 +3059,8 @@ bool CvPromotionEntry::GetTerrainDoubleMove(int i) const /// Indicates if a unit can move twice as fast in a type of terrain feature bool CvPromotionEntry::GetFeatureDoubleMove(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbFeatureDoubleMove) { @@ -3074,8 +3074,8 @@ bool CvPromotionEntry::GetFeatureDoubleMove(int i) const /// Indicates if a unit can move half as fast in a type of terrain bool CvPromotionEntry::GetTerrainHalfMove(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbTerrainHalfMove) { @@ -3088,8 +3088,8 @@ bool CvPromotionEntry::GetTerrainHalfMove(int i) const /// Indicates if a unit loses one movement point when entering a given terrain bool CvPromotionEntry::GetTerrainExtraMove(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i > -1 && i < GC.getNumTerrainInfos() && m_pbTerrainExtraMove) { @@ -3102,8 +3102,8 @@ bool CvPromotionEntry::GetTerrainExtraMove(int i) const /// Indicates if a unit can move half as fast in a type of feature bool CvPromotionEntry::GetFeatureHalfMove(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbFeatureHalfMove) { @@ -3116,8 +3116,8 @@ bool CvPromotionEntry::GetFeatureHalfMove(int i) const /// Indicates if a unit loses one movement point when entering a given feature bool CvPromotionEntry::GetFeatureExtraMove(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if (i > -1 && i < GC.getNumFeatureInfos() && m_pbFeatureExtraMove) { @@ -3131,8 +3131,8 @@ bool CvPromotionEntry::GetFeatureExtraMove(int i) const /// Indicates if a unit can heal twice as fast in a type of terrain bool CvPromotionEntry::GetTerrainDoubleHeal(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbTerrainDoubleHeal) { @@ -3145,8 +3145,8 @@ bool CvPromotionEntry::GetTerrainDoubleHeal(int i) const /// Indicates if a unit can heal twice as fast in a type of feature bool CvPromotionEntry::GetFeatureDoubleHeal(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbFeatureDoubleHeal) { @@ -3159,8 +3159,8 @@ bool CvPromotionEntry::GetFeatureDoubleHeal(int i) const /// Indicates if a terrain type is impassable bool CvPromotionEntry::GetTerrainImpassable(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_pbTerrainImpassable) { @@ -3173,8 +3173,8 @@ bool CvPromotionEntry::GetTerrainImpassable(int i) const /// Indicates what tech is needed to pass through a terrain type int CvPromotionEntry::GetTerrainPassableTech(int i) const { - CvAssertMsg(i < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumTerrainInfos() && m_piTerrainPassableTech) { @@ -3187,8 +3187,8 @@ int CvPromotionEntry::GetTerrainPassableTech(int i) const /// Indicates if a feature type is impassable bool CvPromotionEntry::GetFeatureImpassable(int i) const { - CvAssertMsg(i < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumFeatureInfos() && m_pbFeatureImpassable) { @@ -3201,8 +3201,8 @@ bool CvPromotionEntry::GetFeatureImpassable(int i) const /// Returns the combat classes that this promotion is available for bool CvPromotionEntry::GetUnitCombatClass(int i) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitCombatClassInfos() && m_pbUnitCombat) { @@ -3215,8 +3215,8 @@ bool CvPromotionEntry::GetUnitCombatClass(int i) const /// Returns the civilian unit type that this promotion is available for bool CvPromotionEntry::GetCivilianUnitType(int i) const { - CvAssertMsg(i < GC.getNumUnitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); if(i > -1 && i < GC.getNumUnitInfos() && m_pbCivilianUnitType) { @@ -3231,8 +3231,8 @@ bool CvPromotionEntry::GetCivilianUnitType(int i) const /// The first element of the pair is the flat amount, the second element is the era scaling amount. std::pair CvPromotionEntry::GetYieldFromPillage(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); - CvAssertMsg(eYield > NO_YIELD, "Yield index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); + ASSERT(eYield > NO_YIELD, "Yield index out of bounds"); if (eYield < NUM_YIELD_TYPES && eYield > NO_YIELD) { @@ -3250,8 +3250,8 @@ std::pair CvPromotionEntry::GetYieldFromPillage(YieldTypes eYield) con /// If this a promotion that names a unit bool CvPromotionEntry::IsUnitNaming(int i) const { - CvAssertMsg(i < GC.getNumPromotionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPromotionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbUnitName ? m_pbUnitName[i] : false; } @@ -3273,8 +3273,8 @@ void CvPromotionEntry::GetUnitName(UnitTypes eUnit, CvString& sUnitName) const /// If this a promotion that can randomly turn into other c bool CvPromotionEntry::IsPostCombatRandomPromotion(int i) const { - CvAssertMsg(i < GC.getNumPromotionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPromotionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbPostCombatRandomPromotion ? m_pbPostCombatRandomPromotion[i] : false; } @@ -3399,8 +3399,8 @@ FDataStream& operator<<(FDataStream& stream, const CvUnitPromotions& unitPromoti /// Accessor: Does the unit have a certain promotion bool CvUnitPromotions::HasPromotion(PromotionTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPromotionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(eIndex >= 0 && eIndex < GC.getNumPromotionInfos()) { @@ -3413,8 +3413,8 @@ bool CvUnitPromotions::HasPromotion(PromotionTypes eIndex) const /// Sets the promotion to a certain value void CvUnitPromotions::SetPromotion(PromotionTypes eIndex, bool bValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumPromotionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(eIndex >= 0 && eIndex < GC.getNumPromotionInfos()) { @@ -3653,7 +3653,7 @@ void PromotionArrayHelpers::ReadV3(FDataStream& kStream, CvBitfield& kPromotions CvString szError; szError.Format("LOAD ERROR: Promotion Type not found: %s", sTemp.c_str()); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); bool bDummy = false; kStream >> bDummy; } @@ -3695,7 +3695,7 @@ void PromotionArrayHelpers::Read(FDataStream& kStream, CvBitfield& kPromotions) CvString szError; szError.Format("LOAD ERROR: Promotion Type not found for hash: %u", uiHashTemp); GC.LogMessage(szError.GetCString()); - CvAssertMsg(false, szError); + ASSERT(false, szError); bool bDummy = false; kStream >> bDummy; } diff --git a/CvGameCoreDLL_Expansion2/CvReligionClasses.cpp b/CvGameCoreDLL_Expansion2/CvReligionClasses.cpp index a961208535..026598ef00 100644 --- a/CvGameCoreDLL_Expansion2/CvReligionClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvReligionClasses.cpp @@ -188,7 +188,7 @@ FDataStream& operator<<(FDataStream& saveTo, const CvReligion& readFrom) CvString CvReligion::GetName() const { CvReligionEntry* pEntry = GC.getReligionInfo(m_eReligion); - CvAssertMsg(pEntry, "pEntry for religion not expected to be NULL. Please send Anton or Ed your save file and version."); + ASSERT(pEntry, "pEntry for religion not expected to be NULL."); if (pEntry) { CvString szReligionName = strlen(m_szCustomName) == 0 ? pEntry->GetDescriptionKey() : m_szCustomName; @@ -1454,7 +1454,7 @@ void CvGameReligions::EnhanceReligion(PlayerTypes ePlayer, ReligionTypes eReligi } if (!bFoundIt) { - CvAssertMsg(false, "Internal error in religion code."); + ASSERT(false, "Internal error in religion code."); CUSTOMLOG("Trying to enhance a religion/pantheon that doesn't exist!!!"); return; } @@ -1637,7 +1637,7 @@ void CvGameReligions::AddReformationBelief(PlayerTypes ePlayer, ReligionTypes eR } if(!bFoundIt) { - CvAssertMsg(false, "Internal error in religion code."); + ASSERT(false, "Internal error in religion code."); return; } @@ -5324,7 +5324,7 @@ void CvCityReligions::RecomputeFollowers(CvReligiousFollowChangeReason eReason, // Safety check to avoid divide by zero if (iUnassignedFollowers < 1) { - CvAssertMsg (false, "Invalid city population when recomputing followers"); + ASSERT(false, "Invalid city population when recomputing followers"); return; } @@ -5424,7 +5424,7 @@ void CvCityReligions::SimulateFollowers() // safety check if (iTotalPressure == 0 || iUnassignedFollowers == 0) { - CvAssertMsg(false, "Internal religion data error. Send save to Ed"); + ASSERT(false, "Internal religion data error. Send save to Ed"); return; } diff --git a/CvGameCoreDLL_Expansion2/CvSerialize.h b/CvGameCoreDLL_Expansion2/CvSerialize.h index 6cdfc113cb..d166297b82 100644 --- a/CvGameCoreDLL_Expansion2/CvSerialize.h +++ b/CvGameCoreDLL_Expansion2/CvSerialize.h @@ -48,7 +48,7 @@ class CvStreamSaveVisitor template inline CvStreamSaveVisitor& operator>>(const T& value) { - CvAssertMsg(false, "CvStreamSaveVisitor is not meant for loading"); + ASSERT(false, "CvStreamSaveVisitor is not meant for loading"); return *this; } @@ -74,13 +74,13 @@ class CvStreamSaveVisitor template inline void loadAssign(Dst& dst, const Src& src) { - CvAssertMsg(false, "CvStreamSaveVisitor is not meant for loading"); + ASSERT(false, "CvStreamSaveVisitor is not meant for loading"); } template void loadIgnore() { - CvAssertMsg(false, "CvStreamSaveVisitor is not meant for loading"); + ASSERT(false, "CvStreamSaveVisitor is not meant for loading"); } private: @@ -112,7 +112,7 @@ class CvStreamLoadVisitor template inline CvStreamLoadVisitor& operator<<(const T& value) { - CvAssertMsg(false, "CvStreamLoadVisitor is not meant for saving"); + ASSERT(false, "CvStreamLoadVisitor is not meant for saving"); return *this; } @@ -340,7 +340,7 @@ class CvSyncArchive : public FAutoArchive // Call once at initialization in multiplayer inline void initSyncVars(SyncVars& syncVars) { - CvAssert(m_syncVarsStorage == NULL); + ASSERT(m_syncVarsStorage == NULL); m_syncVarsStorage = &syncVars; } inline void destroySyncVars() diff --git a/CvGameCoreDLL_Expansion2/CvSiteEvaluationClasses.cpp b/CvGameCoreDLL_Expansion2/CvSiteEvaluationClasses.cpp index 435d00d230..3da5b96f9f 100644 --- a/CvGameCoreDLL_Expansion2/CvSiteEvaluationClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvSiteEvaluationClasses.cpp @@ -56,7 +56,7 @@ CvCitySiteEvaluator::CvCitySiteEvaluator() /// Is it valid for this player to found a city here? bool CvCitySiteEvaluator::CanFoundCity(const CvPlot* pPlot, const CvPlayer* pPlayer, bool bIgnoreDistanceToExistingCities) const { - CvAssert(pPlot); + ASSERT(pPlot); if(!pPlot) return false; @@ -277,7 +277,7 @@ void CvSiteEvaluatorForSettler::ComputeFlavorMultipliers(const CvPlayer* pPlayer /// Retrieve the relative value of this plot (including plots that would be in city radius) int CvSiteEvaluatorForSettler::PlotFoundValue(CvPlot* pPlot, const CvPlayer* pPlayer, const std::vector& ignorePlots, bool bCoastOnly, CvString* pDebug) { - CvAssert(pPlot); + ASSERT(pPlot); if(!pPlot) return -1; diff --git a/CvGameCoreDLL_Expansion2/CvSpan.h b/CvGameCoreDLL_Expansion2/CvSpan.h index 0f2189ff79..d53cbd7281 100644 --- a/CvGameCoreDLL_Expansion2/CvSpan.h +++ b/CvGameCoreDLL_Expansion2/CvSpan.h @@ -43,13 +43,13 @@ class CvSpan inline explicit CvSpan(It first, typename CvMeta::EnableIf::iterator_category, std::random_access_iterator_tag>::Value, SizeType>::Type count) : m_begin(&(*first)) { - CvAssert(m_begin != NULL && count == TExtent); + ASSERT(m_begin != NULL && count == TExtent); } template inline explicit CvSpan(It first, typename CvMeta::EnableIf::iterator_category, std::random_access_iterator_tag>::Value, It>::Type last) : m_begin(&(*first)) { - CvAssert(last - first == TExtent); + ASSERT(last - first == TExtent); } inline CvSpan(ElementType(&arr)[TExtent]) : m_begin(arr) @@ -59,7 +59,7 @@ class CvSpan inline CvSpan(const CvSpan& src, typename CvMeta::EnableIf::ValueType, ValueType>::Value && (N == TExtent || N == DYNAMIC_EXTENT), int>::Type = 0) : m_begin(&(*src.begin())) { - CvAssert(src.size() == TExtent); + ASSERT(src.size() == TExtent); } inline Iterator begin() const @@ -90,7 +90,7 @@ class CvSpan } inline Reference operator[](SizeType idx) const { - CvAssert(idx < TExtent); + ASSERT(idx < TExtent); return m_begin[idx]; } inline Pointer data() const @@ -142,14 +142,14 @@ class CvSpan : m_begin(&(*first)) , m_end(m_begin + count) { - CvAssert(count == 0 || m_begin != NULL); + ASSERT(count == 0 || m_begin != NULL); } template inline CvSpan(It first, typename CvMeta::EnableIf::iterator_category, std::random_access_iterator_tag>::Value, It>::Type last) : m_begin(&(*first)) , m_end(&(*last)) { - CvAssert(m_begin <= m_end); + ASSERT(m_begin <= m_end); } template inline CvSpan(ElementType(&arr)[N]) @@ -184,17 +184,17 @@ class CvSpan inline Reference front() const { - CvAssert(!empty()); + ASSERT(!empty()); return *m_begin; } inline Reference back() const { - CvAssert(!empty()); + ASSERT(!empty()); return *(m_end - 1); } inline Reference operator[](SizeType idx) const { - CvAssert(idx < size()); + ASSERT(idx < size()); return m_begin[idx]; } inline Pointer data() const @@ -246,17 +246,17 @@ class CvSpan template inline explicit CvSpan(It first, typename CvMeta::EnableIf::iterator_category, std::random_access_iterator_tag>::Value, SizeType>::Type count) { - CvAssert(count == 0); + ASSERT(count == 0); } template inline explicit CvSpan(It first, typename CvMeta::EnableIf::iterator_category, std::random_access_iterator_tag>::Value, It>::Type last) { - CvAssert(m_end - m_begin == 0); + ASSERT(m_end - m_begin == 0); } template inline CvSpan(const CvSpan& src, typename CvMeta::EnableIf::ValueType, ValueType>::Value && (N == 0 || N == DYNAMIC_EXTENT), int>::Type = 0) { - CvAssert(src.size() == 0); + ASSERT(src.size() == 0); } inline Iterator begin() const @@ -279,17 +279,17 @@ class CvSpan inline Reference front() const { - CvAssertMsg(false, "front() of empty extent is always invalid"); + ASSERT(false, "front() of empty extent is always invalid"); BUILTIN_TRAP(); } inline Reference back() const { - CvAssertMsg(false, "back() of empty extent is always invalid"); + ASSERT(false, "back() of empty extent is always invalid"); BUILTIN_TRAP(); } inline Reference operator[](SizeType idx) const { - CvAssertMsg(false, "operator[] of empty extent is always invalid"); + ASSERT(false, "operator[] of empty extent is always invalid"); BUILTIN_TRAP(); } inline Pointer data() const diff --git a/CvGameCoreDLL_Expansion2/CvStartPositioner.cpp b/CvGameCoreDLL_Expansion2/CvStartPositioner.cpp index b568f95761..4f3ded9ece 100644 --- a/CvGameCoreDLL_Expansion2/CvStartPositioner.cpp +++ b/CvGameCoreDLL_Expansion2/CvStartPositioner.cpp @@ -238,7 +238,7 @@ void CvStartPositioner::AssignStartingLocations() } } - CvAssertMsg(iPlayersPlaced == iMajorCivs, "AssignStartingLocations() can't find enough starting locations for major civs"); + ASSERT(iPlayersPlaced == iMajorCivs, "AssignStartingLocations() can't find enough starting locations for major civs"); // MINOR CIVS m_iRequiredSeparation = StartingPlotRange(); @@ -369,7 +369,7 @@ void CvStartPositioner::ComputeTileFertilityValues() { // Add to total for area CvArea* pArea = GC.getMap().getAreaById(pLoopPlot->getArea()); - CvAssert(pArea); + ASSERT(pArea); if(!pArea) continue; pArea->setTotalFoundValue(pArea->getTotalFoundValue() + iFertility); @@ -493,7 +493,7 @@ void CvStartPositioner::SubdivideRegion(CvStartRegion region, int iNumDivisions) iLaterSubdivisions = 8; break; default: - CvAssertMsg(false, "Trying to create regions for more than 18 major civs."); + ASSERT(false, "Trying to create regions for more than 18 major civs."); } #endif // CUSTOMLOG(" divide now %i, divide later %i", iNumDivides, iLaterSubdivisions); @@ -520,9 +520,9 @@ void CvStartPositioner::SubdivideRegion(CvStartRegion region, int iNumDivisions) /// Performs the mechanics of dividing a region into two equal fertility subregions void CvStartPositioner::ChopIntoTwoRegions(bool bTaller, CvStartRegion* region, CvStartRegion* secondRegion, int iChopPercent) { - CvAssert(region); + ASSERT(region); if(!region) return; - CvAssert(secondRegion); + ASSERT(secondRegion); if(!secondRegion) return; int uiTargetFertility = 0; @@ -588,11 +588,11 @@ void CvStartPositioner::ChopIntoTwoRegions(bool bTaller, CvStartRegion* region, /// Performs the mechanics of dividing a region into three equal fertility subregions void CvStartPositioner::ChopIntoThreeRegions(bool bTaller, CvStartRegion* region, CvStartRegion* secondRegion, CvStartRegion* thirdRegion) { - CvAssert(region); + ASSERT(region); if(!region) return; - CvAssert(secondRegion); + ASSERT(secondRegion); if(!secondRegion) return; - CvAssert(thirdRegion); + ASSERT(thirdRegion); if(!thirdRegion) return; // Chop off the first third @@ -729,7 +729,7 @@ bool PlotTooCloseToAnotherCiv(CvPlot* pPlot, int iRequiredSeparation) { bool rtnValue = false; - CvAssert(pPlot); + ASSERT(pPlot); if(!pPlot) return rtnValue; @@ -772,7 +772,7 @@ bool PlotMeetsFoodRequirement(CvPlot* pPlot, PlayerTypes ePlayer, int iFoodRequi { bool bFoundFoodPlot = false; - CvAssert(pPlot); + ASSERT(pPlot); if(!pPlot) return bFoundFoodPlot; diff --git a/CvGameCoreDLL_Expansion2/CvTacticalAI.h b/CvGameCoreDLL_Expansion2/CvTacticalAI.h index c853d4c8b2..467f119f24 100644 --- a/CvGameCoreDLL_Expansion2/CvTacticalAI.h +++ b/CvGameCoreDLL_Expansion2/CvTacticalAI.h @@ -56,7 +56,7 @@ class CvTacticalUnit void SetHealthPercent(int curHitPoints, int maxHitPoints) { - CvAssert(maxHitPoints != 0); + ASSERT(maxHitPoints != 0); m_iHealthPercent = curHitPoints * 100 / maxHitPoints; } int GetHealthPercent() const diff --git a/CvGameCoreDLL_Expansion2/CvTeam.cpp b/CvGameCoreDLL_Expansion2/CvTeam.cpp index cd15d143c9..13f777ce9d 100644 --- a/CvGameCoreDLL_Expansion2/CvTeam.cpp +++ b/CvGameCoreDLL_Expansion2/CvTeam.cpp @@ -42,8 +42,8 @@ CvTeam* CvTeam::m_aTeams = NULL; CvTeam& CvTeam::getTeam(TeamTypes eTeam) { - CvAssertMsg(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); - CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is not assigned a valid value"); + ASSERT(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); + ASSERT(eTeam < MAX_TEAMS, "eTeam is not assigned a valid value"); if (eTeam == NO_TEAM || eTeam >= MAX_TEAMS) eTeam = BARBARIAN_TEAM; @@ -426,8 +426,8 @@ void CvTeam::addTeam(TeamTypes eTeam) int iI = 0; int iJ = 0; - CvAssert(eTeam != NO_TEAM); - CvAssert(eTeam != GetID()); + ASSERT(eTeam != NO_TEAM); + ASSERT(eTeam != GetID()); for(iI = 0; iI < MAX_PLAYERS; iI++) { @@ -629,8 +629,8 @@ void CvTeam::shareItems(TeamTypes eTeam) int iJ = 0; int iK = 0; - CvAssert(eTeam != NO_TEAM); - CvAssert(eTeam != GetID()); + ASSERT(eTeam != NO_TEAM); + ASSERT(eTeam != GetID()); CvTeam& kTeam = GET_TEAM(eTeam); @@ -796,7 +796,7 @@ void CvTeam::processBuilding(BuildingTypes eBuilding, int iChange) // -------------------------------------------------------------------------------- void CvTeam::doTurn() { - CvAssertMsg(isAlive(), "isAlive is expected to be true"); + ASSERT(isAlive(), "isAlive is expected to be true"); // Barbarians get all Techs that 3/4 of alive players get if (isBarbarian()) @@ -892,7 +892,7 @@ void CvTeam::doTurn() if(!isAtWar(GET_PLAYER((PlayerTypes) iMinorLoop).getTeam())) continue; - CvAssertMsg(GET_PLAYER((PlayerTypes) iMinorLoop).GetMinorCivAI()->GetAlly() != getLeaderID(), "Major civ is now at war with a minor it is allied with! This is dumb and bad. Please send Jon this along with your last 5 autosaves and a changelist #."); + ASSERT(GET_PLAYER((PlayerTypes) iMinorLoop).GetMinorCivAI()->GetAlly() != getLeaderID(), "Major civ is now at war with a minor it is allied with! This is dumb and bad."); } #endif } @@ -923,7 +923,7 @@ void CvTeam::DoBarbarianTech() } } - CvAssertMsg(iPossibleCount > 0, "Zero possible players? Uhhh..."); + ASSERT(iPossibleCount > 0, "Zero possible players? Uhhh..."); // x% of majors (rounded down) need the tech for the Barbs to get it int iTechPercent = /*75 in CP, 80 in VP*/ GD_INT_GET(BARBARIAN_TECH_PERCENT); @@ -989,7 +989,7 @@ void CvTeam::DoMinorCivTech() } } - CvAssertMsg(iPossibleCount > 0, "Zero possible players? Uhhh..."); + ASSERT(iPossibleCount > 0, "Zero possible players? Uhhh..."); // x% of majors (rounded down) need the tech for the Minors to get it int iTechPercent = /*40 in CP, 60 in VP*/ GD_INT_GET(MINOR_CIV_TECH_PERCENT); @@ -1116,7 +1116,7 @@ void CvTeam::changeCorporationsEnabledCount(int iChange) } } m_iCorporationsEnabledCount = m_iCorporationsEnabledCount + iChange; - CvAssert(getCorporationsEnabledCount() >= 0); + ASSERT(getCorporationsEnabledCount() >= 0); } #endif @@ -1244,8 +1244,8 @@ void CvTeam::DoDeclareWar(PlayerTypes eOriginatingPlayer, bool bAggressor, TeamT Localization::String locSummary; int iI = 0; - CvAssertMsg(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); - CvAssertMsg(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); + ASSERT(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); + ASSERT(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); // War declarations on vassals are redirected to the master if (!isMinorCiv()) @@ -2142,8 +2142,8 @@ void CvTeam::DoMakePeace(PlayerTypes eOriginatingPlayer, bool bPacifier, TeamTyp { CvString strBuffer; - CvAssertMsg(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); - CvAssertMsg(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); + ASSERT(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); + ASSERT(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); // Not at war? Do nothing! if (!isAtWar(eTeam)) @@ -2664,7 +2664,7 @@ int CvTeam::getAtWarCount(bool bIgnoreMinors) const { if(isAtWar((TeamTypes)iI)) { - CvAssert(iI != GetID()); + ASSERT(iI != GetID()); iCount++; } } @@ -2693,7 +2693,7 @@ int CvTeam::getHasMetCivCount(bool bIgnoreMinors) const { if(isHasMet((TeamTypes)iI)) { - CvAssert(iI != GetID()); + ASSERT(iI != GetID()); iCount++; } } @@ -2720,7 +2720,7 @@ bool CvTeam::hasMetHuman() const { if(isHasMet((TeamTypes)iI)) { - CvAssert(iI != GetID()); + ASSERT(iI != GetID()); return true; } } @@ -3097,7 +3097,7 @@ HandicapTypes CvTeam::getHandicapType() const if(iCount > 0) { - CvAssertMsg((iGameHandicap / iCount) >= 0, "(iGameHandicap / iCount) is expected to be non-negative (invalid Index)"); + ASSERT((iGameHandicap / iCount) >= 0, "(iGameHandicap / iCount) is expected to be non-negative (invalid Index)"); return ((HandicapTypes)(iGameHandicap / iCount)); } else @@ -3231,7 +3231,7 @@ int CvTeam::getAliveCount() const void CvTeam::changeAliveCount(int iChange) { m_iAliveCount = (m_iAliveCount + iChange); - CvAssert(getAliveCount() >= 0); + ASSERT(getAliveCount() >= 0); } @@ -3253,7 +3253,7 @@ int CvTeam::isEverAlive() const void CvTeam::changeEverAliveCount(int iChange) { m_iEverAliveCount = (m_iEverAliveCount + iChange); - CvAssert(getEverAliveCount() >= 0); + ASSERT(getEverAliveCount() >= 0); } @@ -3268,7 +3268,7 @@ int CvTeam::getNumCities() const void CvTeam::changeNumCities(int iChange) { m_iNumCities = (m_iNumCities + iChange); - CvAssert(getNumCities() >= 0); + ASSERT(getNumCities() >= 0); } @@ -3283,7 +3283,7 @@ int CvTeam::getTotalPopulation() const void CvTeam::changeTotalPopulation(int iChange) { m_iTotalPopulation = (m_iTotalPopulation + iChange); - CvAssert(getTotalPopulation() >= 0); + ASSERT(getTotalPopulation() >= 0); } @@ -3298,7 +3298,7 @@ int CvTeam::getTotalLand() const void CvTeam::changeTotalLand(int iChange) { m_iTotalLand = (m_iTotalLand + iChange); - CvAssert(getTotalLand() >= 0); + ASSERT(getTotalLand() >= 0); } @@ -3313,7 +3313,7 @@ int CvTeam::getNukeInterception() const void CvTeam::changeNukeInterception(int iChange) { m_iNukeInterception = (m_iNukeInterception + iChange); - CvAssert(getNukeInterception() >= 0); + ASSERT(getNukeInterception() >= 0); } @@ -3335,7 +3335,7 @@ bool CvTeam::isForceTeamVoteEligible(VoteSourceTypes eVoteSource) const void CvTeam::changeForceTeamVoteEligibilityCount(VoteSourceTypes eVoteSource, int iChange) { m_aiForceTeamVoteEligibilityCount[eVoteSource] += iChange; - CvAssert(getForceTeamVoteEligibilityCount(eVoteSource) >= 0); + ASSERT(getForceTeamVoteEligibilityCount(eVoteSource) >= 0); } @@ -3361,7 +3361,7 @@ void CvTeam::changeExtraWaterSeeFromCount(int iChange) GC.getMap().updateSight(false); m_iExtraWaterSeeFromCount = (m_iExtraWaterSeeFromCount + iChange); - CvAssert(getExtraWaterSeeFromCount() >= 0); + ASSERT(getExtraWaterSeeFromCount() >= 0); GC.getMap().updateSight(true); } @@ -3386,7 +3386,7 @@ bool CvTeam::isMapTrading() const void CvTeam::changeMapTradingCount(int iChange) { m_iMapTradingCount = (m_iMapTradingCount + iChange); - CvAssert(getMapTradingCount() >= 0); + ASSERT(getMapTradingCount() >= 0); } @@ -3408,7 +3408,7 @@ bool CvTeam::isTechTrading() const void CvTeam::changeTechTradingCount(int iChange) { m_iTechTradingCount = (m_iTechTradingCount + iChange); - CvAssert(getTechTradingCount() >= 0); + ASSERT(getTechTradingCount() >= 0); } @@ -3430,7 +3430,7 @@ bool CvTeam::isGoldTrading() const void CvTeam::changeGoldTradingCount(int iChange) { m_iGoldTradingCount = (m_iGoldTradingCount + iChange); - CvAssert(getGoldTradingCount() >= 0); + ASSERT(getGoldTradingCount() >= 0); } // -------------------------------------------------------------------------------- @@ -3473,7 +3473,7 @@ bool CvTeam::isAllowEmbassyTradingAllowed() const void CvTeam::changeAllowEmbassyTradingAllowedCount(int iChange) { m_iAllowEmbassyTradingAllowedCount = (m_iAllowEmbassyTradingAllowedCount + iChange); - CvAssert(getAllowEmbassyTradingAllowedCount() >= 0); + ASSERT(getAllowEmbassyTradingAllowedCount() >= 0); } @@ -3500,7 +3500,7 @@ bool CvTeam::isOpenBordersTradingAllowedWithTeam(TeamTypes eTeam) const void CvTeam::changeOpenBordersTradingAllowedCount(int iChange) { m_iOpenBordersTradingAllowedCount = (m_iOpenBordersTradingAllowedCount + iChange); - CvAssert(getOpenBordersTradingAllowedCount() >= 0); + ASSERT(getOpenBordersTradingAllowedCount() >= 0); } @@ -3530,7 +3530,7 @@ bool CvTeam::isDefensivePactTradingAllowedWithTeam(TeamTypes eTeam) const void CvTeam::changeDefensivePactTradingAllowedCount(int iChange) { m_iDefensivePactTradingAllowedCount = (m_iDefensivePactTradingAllowedCount + iChange); - CvAssert(getDefensivePactTradingAllowedCount() >= 0); + ASSERT(getDefensivePactTradingAllowedCount() >= 0); } @@ -3557,7 +3557,7 @@ bool CvTeam::IsResearchAgreementTradingAllowedWithTeam(TeamTypes eTeam) const void CvTeam::ChangeResearchAgreementTradingAllowedCount(int iChange) { m_iResearchAgreementTradingAllowedCount = (m_iResearchAgreementTradingAllowedCount + iChange); - CvAssert(GetResearchAgreementTradingAllowedCount() >= 0); + ASSERT(GetResearchAgreementTradingAllowedCount() >= 0); } #if defined(MOD_TECHS_CITY_WORKING) @@ -3663,7 +3663,7 @@ void CvTeam::changeBridgeBuildingCount(int iChange) if(iChange != 0) { m_iBridgeBuildingCount = (m_iBridgeBuildingCount + iChange); - CvAssert(getBridgeBuildingCount() >= 0); + ASSERT(getBridgeBuildingCount() >= 0); if(m_eID == GC.getGame().getActiveTeam()) { @@ -3698,7 +3698,7 @@ void CvTeam::changeCityLessEmbarkCost(int iChange) if(iChange != 0) { m_iCityLessEmbarkCost = (m_iCityLessEmbarkCost + iChange); - CvAssert(getCityLessEmbarkCost() >= 0); + ASSERT(getCityLessEmbarkCost() >= 0); } } // -------------------------------------------------------------------------------- @@ -3717,7 +3717,7 @@ void CvTeam::changeCityNoEmbarkCost(int iChange) if(iChange != 0) { m_iCityNoEmbarkCost = (m_iCityNoEmbarkCost + iChange); - CvAssert(getCityNoEmbarkCost() >= 0); + ASSERT(getCityNoEmbarkCost() >= 0); } } #endif @@ -3741,7 +3741,7 @@ void CvTeam::changeWaterWorkCount(int iChange) if(iChange != 0) { m_iWaterWorkCount = (m_iWaterWorkCount + iChange); - CvAssert(getWaterWorkCount() >= 0); + ASSERT(getWaterWorkCount() >= 0); } } @@ -3763,7 +3763,7 @@ void CvTeam::changeBorderObstacleCount(int iChange) if(iChange != 0) { m_iBorderObstacleCount = (m_iBorderObstacleCount + iChange); - CvAssert(getBorderObstacleCount() >= 0); + ASSERT(getBorderObstacleCount() >= 0); } } @@ -3800,8 +3800,8 @@ TeamTypes CvTeam::GetID() const // -------------------------------------------------------------------------------- int CvTeam::getTechShareCount(int iIndex) const { - CvAssertMsg(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(iIndex < MAX_TEAMS, "iIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); + ASSERT(iIndex < MAX_TEAMS, "iIndex is expected to be within maximum bounds (invalid Index)"); if(iIndex < 0 || iIndex >= MAX_TEAMS) return 0; // as set in reset() return m_aiTechShareCount[iIndex]; } @@ -3817,13 +3817,13 @@ bool CvTeam::isTechShare(int iIndex) const // -------------------------------------------------------------------------------- void CvTeam::changeTechShareCount(int iIndex, int iChange) { - CvAssertMsg(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(iIndex < MAX_TEAMS, "iIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(iIndex >= 0, "iIndex is expected to be non-negative (invalid Index)"); + ASSERT(iIndex < MAX_TEAMS, "iIndex is expected to be within maximum bounds (invalid Index)"); if(iIndex < 0 || iIndex >= MAX_TEAMS) return; if(iChange != 0) { m_aiTechShareCount[iIndex] = (m_aiTechShareCount[iIndex] + iChange); - CvAssert(getTechShareCount(iIndex) >= 0); + ASSERT(getTechShareCount(iIndex) >= 0); if(isTechShare(iIndex)) { @@ -3836,8 +3836,8 @@ void CvTeam::changeTechShareCount(int iIndex, int iChange) // -------------------------------------------------------------------------------- int CvTeam::getExtraMoves(DomainTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiExtraMoves[eIndex]; } @@ -3845,10 +3845,10 @@ int CvTeam::getExtraMoves(DomainTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::changeExtraMoves(DomainTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiExtraMoves[eIndex] = (m_aiExtraMoves[eIndex] + iChange); - CvAssert(getExtraMoves(eIndex) >= 0); + ASSERT(getExtraMoves(eIndex) >= 0); } @@ -3969,7 +3969,7 @@ void CvTeam::changeDefensiveEmbarkCount(int iChange) } } } - CvAssert(getDefensiveEmbarkCount() >= 0); + ASSERT(getDefensiveEmbarkCount() >= 0); } // -------------------------------------------------------------------------------- @@ -4041,7 +4041,7 @@ void CvTeam::ChangeNumNaturalWondersDiscovered(int iChange) { m_iNumNaturalWondersDiscovered += iChange; } - CvAssert(GetNumNaturalWondersDiscovered() >= 0); + ASSERT(GetNumNaturalWondersDiscovered() >= 0); } // -------------------------------------------------------------------------------- @@ -4057,7 +4057,7 @@ void CvTeam::ChangeNumLandmarksBuilt(int iChange) { m_iNumLandmarksBuilt += iChange; } - CvAssert(GetNumLandmarksBuilt() >= 0); + ASSERT(GetNumLandmarksBuilt() >= 0); } // -------------------------------------------------------------------------------- @@ -4079,8 +4079,8 @@ bool CvTeam::isHasMet(TeamTypes eIndex) const if (eIndex == NO_TEAM) return false; - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); if (isObserver()) { @@ -4275,32 +4275,32 @@ void CvTeam::makeHasMet(TeamTypes eIndex, bool bSuppressMessages) // -------------------------------------------------------------------------------- int CvTeam::GetTurnsSinceMeetingTeam(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return GC.getGame().getGameTurn() - m_aiTurnTeamMet[eTeam]; } // -------------------------------------------------------------------------------- int CvTeam::GetTurnTeamMet(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiTurnTeamMet[eTeam]; } // -------------------------------------------------------------------------------- void CvTeam::SetTurnTeamMet(TeamTypes eTeam, int iTurn) { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiTurnTeamMet[eTeam] = iTurn; } // -------------------------------------------------------------------------------- int CvTeam::GetNumTurnsAtWar(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); int iTurn = m_aiTurnWarStarted[eTeam]; if (iTurn == -1) return INT_MAX; @@ -4311,8 +4311,8 @@ int CvTeam::GetNumTurnsAtWar(TeamTypes eTeam) const // -------------------------------------------------------------------------------- void CvTeam::SetTurnWarStarted(TeamTypes eTeam, int iTurn) { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiTurnWarStarted[eTeam] = iTurn; } @@ -4320,8 +4320,8 @@ void CvTeam::SetTurnWarStarted(TeamTypes eTeam, int iTurn) /// Have we seen ePlayer's territory before? bool CvTeam::IsHasFoundPlayersTerritory(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); return m_abHasFoundPlayersTerritory[ePlayer]; } @@ -4329,8 +4329,8 @@ bool CvTeam::IsHasFoundPlayersTerritory(PlayerTypes ePlayer) const /// Sets us to have seen ePlayer's territory before bool CvTeam::SetHasFoundPlayersTerritory(PlayerTypes ePlayer, bool bValue) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if (IsHasFoundPlayersTerritory(ePlayer) != bValue) { @@ -4345,24 +4345,24 @@ bool CvTeam::SetHasFoundPlayersTerritory(PlayerTypes ePlayer, bool bValue) // -------------------------------------------------------------------------------- bool CvTeam::isAggressor(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return (isAtWar(eIndex) && m_abAggressorPacifier[eIndex]); } // -------------------------------------------------------------------------------- bool CvTeam::isPacifier(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return (!isAtWar(eIndex) && m_abAggressorPacifier[eIndex]); } // -------------------------------------------------------------------------------- bool CvTeam::isAtWar(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abAtWar[eIndex]; } @@ -4370,9 +4370,9 @@ bool CvTeam::isAtWar(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::setAtWar(TeamTypes eIndex, bool bNewValue, bool bAggressorPacifier) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex != GetID() || bNewValue == false, "Team is setting war with itself!"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex != GetID() || bNewValue == false, "Team is setting war with itself!"); if (eIndex == GetID()) return; @@ -4524,8 +4524,8 @@ bool CvTeam::HasCommonEnemy(TeamTypes eOtherTeam) const /// How long are we locked into a war with eTeam? int CvTeam::GetNumTurnsLockedIntoWar(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiNumTurnsLockedIntoWar[eTeam]; } @@ -4560,8 +4560,8 @@ void CvTeam::ChangeNumTurnsLockedIntoWar(TeamTypes eTeam, int iChange) // -------------------------------------------------------------------------------- int CvTeam::GetTurnMadePeaceTreatyWithTeam(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiTurnMadePeaceTreatyWithTeam[eIndex]; } @@ -4569,16 +4569,16 @@ int CvTeam::GetTurnMadePeaceTreatyWithTeam(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::SetTurnMadePeaceTreatyWithTeam(TeamTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiTurnMadePeaceTreatyWithTeam[eIndex] = iNewValue; } // -------------------------------------------------------------------------------- bool CvTeam::isPermanentWarPeace(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abPermanentWarPeace[eIndex]; } @@ -4586,8 +4586,8 @@ bool CvTeam::isPermanentWarPeace(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::setPermanentWarPeace(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_abPermanentWarPeace[eIndex] = bNewValue; } @@ -4650,8 +4650,8 @@ void CvTeam::SetKilledByTeam(TeamTypes eIndex) // -------------------------------------------------------------------------------- void CvTeam::CloseEmbassyAtTeam(TeamTypes eIndex) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); SetHasEmbassyAtTeam(eIndex, false); SetHasDefensivePact(eIndex, false); @@ -4680,8 +4680,8 @@ bool CvTeam::HasEmbassyAtTeam(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::SetHasEmbassyAtTeam(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); if(HasEmbassyAtTeam(eIndex) != bNewValue) { @@ -4699,7 +4699,7 @@ void CvTeam::SetHasEmbassyAtTeam(TeamTypes eIndex, bool bNewValue) if(pCity) { CvPlot* pPlot = pCity->plot(); - CvAssertMsg(pPlot, "Capital city lacks plot? How'd that happen?"); + ASSERT(pPlot, "Capital city lacks plot? How'd that happen?"); if(pPlot) { const int iPopRange = 2; @@ -4765,8 +4765,8 @@ void CvTeam::SetHasEmbassyAtTeam(TeamTypes eIndex, bool bNewValue) // -------------------------------------------------------------------------------- bool CvTeam::HasSpyAtTeam(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); for (uint uiMyPlayer = 0; uiMyPlayer < MAX_MAJOR_CIVS; uiMyPlayer++) { @@ -4881,8 +4881,8 @@ void CvTeam::SetAllowsOpenBordersToTeam(TeamTypes eIndex, bool bNewValue) // -------------------------------------------------------------------------------- bool CvTeam::IsHasDefensivePact(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abDefensivePact[eIndex]; } @@ -4890,8 +4890,8 @@ bool CvTeam::IsHasDefensivePact(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::SetHasDefensivePact(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_abDefensivePact[eIndex] = bNewValue; @@ -4990,8 +4990,8 @@ int CvTeam::GetTotalNumResearchAgreements() const // -------------------------------------------------------------------------------- bool CvTeam::IsHasResearchAgreement(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abResearchAgreement[eIndex]; } @@ -4999,8 +4999,8 @@ bool CvTeam::IsHasResearchAgreement(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::SetHasResearchAgreement(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); if(IsHasResearchAgreement(eIndex) != bNewValue) { @@ -5034,8 +5034,8 @@ void CvTeam::CancelResearchAgreement(TeamTypes eIndex) // -------------------------------------------------------------------------------- bool CvTeam::isForcePeace(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abForcePeace[eIndex]; } @@ -5043,8 +5043,8 @@ bool CvTeam::isForcePeace(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::setForcePeace(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_abForcePeace[eIndex] = bNewValue; } @@ -5052,8 +5052,8 @@ void CvTeam::setForcePeace(TeamTypes eIndex, bool bNewValue) // -------------------------------------------------------------------------------- bool CvTeam::IsWonLatestWar(TeamTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_abWonLatestWar[eIndex]; } @@ -5061,8 +5061,8 @@ bool CvTeam::IsWonLatestWar(TeamTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::SetWonLatestWar(TeamTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); m_abWonLatestWar[eIndex] = bNewValue; } @@ -5070,16 +5070,16 @@ void CvTeam::SetWonLatestWar(TeamTypes eIndex, bool bNewValue) // -------------------------------------------------------------------------------- int CvTeam::getRouteChange(RouteTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiRouteChange[eIndex]; } // -------------------------------------------------------------------------------- void CvTeam::changeRouteChange(RouteTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiRouteChange[eIndex] = (m_paiRouteChange[eIndex] + iChange); } @@ -5087,16 +5087,16 @@ void CvTeam::changeRouteChange(RouteTypes eIndex, int iChange) // -------------------------------------------------------------------------------- int CvTeam::getTradeRouteDomainExtraRange(DomainTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiTradeRouteDomainExtraRange[eIndex]; } // -------------------------------------------------------------------------------- void CvTeam::changeTradeRouteDomainExtraRange(DomainTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiTradeRouteDomainExtraRange[eIndex] = (m_paiTradeRouteDomainExtraRange[eIndex] + iChange); } #endif @@ -5104,16 +5104,16 @@ void CvTeam::changeTradeRouteDomainExtraRange(DomainTypes eIndex, int iChange) // -------------------------------------------------------------------------------- int CvTeam::getBuildTimeChange(BuildTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildTimeChange[eIndex]; } // -------------------------------------------------------------------------------- void CvTeam::changeBuildTimeChange(BuildTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if (iChange != 0) { m_paiBuildTimeChange[eIndex] = (m_paiBuildTimeChange[eIndex] + iChange); @@ -5131,8 +5131,8 @@ RouteTypes CvTeam::GetBestPossibleRoute() /// Sets what the best route this team can build is void CvTeam::SetBestPossibleRoute(RouteTypes eRoute) { - CvAssertMsg(eRoute >= NO_ROUTE, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eRoute < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eRoute >= NO_ROUTE, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eRoute < GC.getNumRouteInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(GetBestPossibleRoute() != eRoute) { @@ -5194,59 +5194,59 @@ void CvTeam::DoUpdateBestRoute() // -------------------------------------------------------------------------------- int CvTeam::getProjectCount(ProjectTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiProjectCount[eIndex]; } // -------------------------------------------------------------------------------- int CvTeam::getProjectDefaultArtType(ProjectTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiProjectDefaultArtTypes[eIndex]; } // -------------------------------------------------------------------------------- void CvTeam::setProjectDefaultArtType(ProjectTypes eIndex, int value) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiProjectDefaultArtTypes[eIndex] = value; } // -------------------------------------------------------------------------------- int CvTeam::getProjectArtType(ProjectTypes eIndex, int number) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(number >= 0, "number is expected to be non-negative (invalid Index)"); - CvAssertMsg(number < getProjectCount(eIndex), "number is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(number >= 0, "number is expected to be non-negative (invalid Index)"); + ASSERT(number < getProjectCount(eIndex), "number is expected to be within maximum bounds (invalid Index)"); return m_pavProjectArtTypes[eIndex][number]; } // -------------------------------------------------------------------------------- void CvTeam::setProjectArtType(ProjectTypes eIndex, int number, int value) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(number >= 0, "number is expected to be non-negative (invalid Index)"); - CvAssertMsg(number < getProjectCount(eIndex), "number is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(number >= 0, "number is expected to be non-negative (invalid Index)"); + ASSERT(number < getProjectCount(eIndex), "number is expected to be within maximum bounds (invalid Index)"); m_pavProjectArtTypes[eIndex][number] = value; } // -------------------------------------------------------------------------------- bool CvTeam::isProjectMaxedOut(ProjectTypes eIndex, int iExtra) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(!isTeamProject(eIndex)) { return false; } - CvAssertMsg(getProjectCount(eIndex) <= GC.getProjectInfo(eIndex)->GetMaxTeamInstances(), "Current Project count is expected to not exceed the maximum number of instances for this project"); + ASSERT(getProjectCount(eIndex) <= GC.getProjectInfo(eIndex)->GetMaxTeamInstances(), "Current Project count is expected to not exceed the maximum number of instances for this project"); return ((getProjectCount(eIndex) + iExtra) >= GC.getProjectInfo(eIndex)->GetMaxTeamInstances()); } @@ -5254,8 +5254,8 @@ bool CvTeam::isProjectMaxedOut(ProjectTypes eIndex, int iExtra) const // -------------------------------------------------------------------------------- bool CvTeam::isProjectAndArtMaxedOut(ProjectTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(getProjectCount(eIndex) >= GC.getProjectInfo(eIndex)->GetMaxTeamInstances()) { @@ -5303,8 +5303,8 @@ void CvTeam::changeProjectCount(ProjectTypes eIndex, int iChange) int iI = 0; int iJ = 0; - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -5318,7 +5318,7 @@ void CvTeam::changeProjectCount(ProjectTypes eIndex, int iChange) iOldProjectCount = getProjectCount(eIndex); m_paiProjectCount[eIndex] = (m_paiProjectCount[eIndex] + iChange); - CvAssert(getProjectCount(eIndex) >= 0); + ASSERT(getProjectCount(eIndex) >= 0); //adjust default art types if(iChange >= 0) @@ -5336,7 +5336,7 @@ void CvTeam::changeProjectCount(ProjectTypes eIndex, int iChange) for(int i=0; i<-iChange; i++) m_pavProjectArtTypes[eIndex].pop_back(); } - CvAssertMsg(getProjectCount(eIndex) == (int)m_pavProjectArtTypes[eIndex].size(), "[Jason] Unbalanced project art types."); + ASSERT(getProjectCount(eIndex) == (int)m_pavProjectArtTypes[eIndex].size(), "[Jason] Unbalanced project art types."); CvProjectEntry* pkProject = GC.getProjectInfo(eIndex); @@ -5568,8 +5568,8 @@ void CvTeam::changeProjectCount(ProjectTypes eIndex, int iChange) // -------------------------------------------------------------------------------- int CvTeam::getProjectMaking(ProjectTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiProjectMaking[eIndex]; } @@ -5577,18 +5577,18 @@ int CvTeam::getProjectMaking(ProjectTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::changeProjectMaking(ProjectTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumProjectInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiProjectMaking[eIndex] = (m_paiProjectMaking[eIndex] + iChange); - CvAssert(getProjectMaking(eIndex) >= 0); + ASSERT(getProjectMaking(eIndex) >= 0); } // -------------------------------------------------------------------------------- int CvTeam::getUnitClassCount(UnitClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiUnitClassCount[eIndex]; } @@ -5596,8 +5596,8 @@ int CvTeam::getUnitClassCount(UnitClassTypes eIndex) const // -------------------------------------------------------------------------------- bool CvTeam::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvUnitClassInfo* pkUnitClassInfo = GC.getUnitClassInfo(eIndex); if(pkUnitClassInfo == NULL) @@ -5610,7 +5610,7 @@ bool CvTeam::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const return false; } - CvAssertMsg(getUnitClassCount(eIndex) <= pkUnitClassInfo->getMaxTeamInstances(), "The current unit class count is expected not to exceed the maximum number of instances allowed for this team"); + ASSERT(getUnitClassCount(eIndex) <= pkUnitClassInfo->getMaxTeamInstances(), "The current unit class count is expected not to exceed the maximum number of instances allowed for this team"); return ((getUnitClassCount(eIndex) + iExtra) >= pkUnitClassInfo->getMaxTeamInstances()); } @@ -5619,18 +5619,18 @@ bool CvTeam::isUnitClassMaxedOut(UnitClassTypes eIndex, int iExtra) const // -------------------------------------------------------------------------------- void CvTeam::changeUnitClassCount(UnitClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiUnitClassCount[eIndex] = (m_paiUnitClassCount[eIndex] + iChange); - CvAssert(getUnitClassCount(eIndex) >= 0); + ASSERT(getUnitClassCount(eIndex) >= 0); } // -------------------------------------------------------------------------------- int CvTeam::getBuildingClassCount(BuildingClassTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiBuildingClassCount[eIndex]; } @@ -5638,13 +5638,13 @@ int CvTeam::getBuildingClassCount(BuildingClassTypes eIndex) const // -------------------------------------------------------------------------------- bool CvTeam::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvBuildingClassInfo* pkBuildingClassInfo = GC.getBuildingClassInfo(eIndex); if(pkBuildingClassInfo == NULL) { - CvAssertMsg(false, "Could not find BuildingClassInfo for BuildingClassType."); + ASSERT(false, "Could not find BuildingClassInfo for BuildingClassType."); return false; } @@ -5653,7 +5653,7 @@ bool CvTeam::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) cons return false; } - CvAssertMsg(getBuildingClassCount(eIndex) <= pkBuildingClassInfo->getMaxTeamInstances(), "The current building class count is expected not to exceed the maximum number of instances allowed for this team"); + ASSERT(getBuildingClassCount(eIndex) <= pkBuildingClassInfo->getMaxTeamInstances(), "The current building class count is expected not to exceed the maximum number of instances allowed for this team"); return ((getBuildingClassCount(eIndex) + iExtra) >= pkBuildingClassInfo->getMaxTeamInstances()); } @@ -5662,18 +5662,18 @@ bool CvTeam::isBuildingClassMaxedOut(BuildingClassTypes eIndex, int iExtra) cons // -------------------------------------------------------------------------------- void CvTeam::changeBuildingClassCount(BuildingClassTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_paiBuildingClassCount[eIndex] = (m_paiBuildingClassCount[eIndex] + iChange); - CvAssert(getBuildingClassCount(eIndex) >= 0); + ASSERT(getBuildingClassCount(eIndex) >= 0); } // -------------------------------------------------------------------------------- int CvTeam::getObsoleteBuildingCount(BuildingTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiObsoleteBuildingCount[eIndex]; } @@ -5693,15 +5693,15 @@ void CvTeam::changeObsoleteBuildingCount(BuildingTypes eIndex, int iChange) int iLoop = 0; int iI = 0; - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { bOldObsoleteBuilding = isObsoleteBuilding(eIndex); m_paiObsoleteBuildingCount[eIndex] = (m_paiObsoleteBuildingCount[eIndex] + iChange); - CvAssert(getObsoleteBuildingCount(eIndex) >= 0); + ASSERT(getObsoleteBuildingCount(eIndex) >= 0); if(bOldObsoleteBuilding != isObsoleteBuilding(eIndex)) { @@ -5732,8 +5732,8 @@ void CvTeam::enhanceBuilding(BuildingTypes eIndex, int iChange) CvCity* pLoopCity = NULL; int iLoop = 0; - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumBuildingInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); CvBuildingEntry* thisBuildingEntry = GC.getBuildingInfo(eIndex); if(thisBuildingEntry == NULL) @@ -5770,8 +5770,8 @@ void CvTeam::enhanceBuilding(BuildingTypes eIndex, int iChange) // -------------------------------------------------------------------------------- int CvTeam::getTerrainTradeCount(TerrainTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTerrainInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTerrainInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_paiTerrainTradeCount[eIndex]; } @@ -5786,29 +5786,29 @@ bool CvTeam::isTerrainTrade(TerrainTypes eIndex) const // -------------------------------------------------------------------------------- void CvTeam::changeTerrainTradeCount(TerrainTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTerrainInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTerrainInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_paiTerrainTradeCount[eIndex] = (m_paiTerrainTradeCount[eIndex] + iChange); - CvAssert(getTerrainTradeCount(eIndex) >= 0); + ASSERT(getTerrainTradeCount(eIndex) >= 0); } } // -------------------------------------------------------------------------------- int CvTeam::getVictoryCountdown(VictoryTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiVictoryCountdown[eIndex]; } // -------------------------------------------------------------------------------- void CvTeam::setVictoryCountdown(VictoryTypes eIndex, int iTurnsLeft) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_aiVictoryCountdown[eIndex] = iTurnsLeft; } @@ -5816,13 +5816,13 @@ void CvTeam::setVictoryCountdown(VictoryTypes eIndex, int iTurnsLeft) // -------------------------------------------------------------------------------- void CvTeam::changeVictoryCountdown(VictoryTypes eIndex, int iChange) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumVictoryInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_aiVictoryCountdown[eIndex] += iChange; - CvAssert(m_aiVictoryCountdown[eIndex] >= 0); + ASSERT(m_aiVictoryCountdown[eIndex] >= 0); } } @@ -5837,7 +5837,7 @@ int CvTeam::getVictoryDelay(VictoryTypes eVictory) const if(pkProject && iCount < pkProject->GetVictoryMinThreshold(eVictory)) { - CvAssert(false); + ASSERT(false); return -1; } @@ -5955,7 +5955,7 @@ void CvTeam::changeVictoryPoints(int iChange) } // Right now there's no reason VPs should ever be negative - CvAssert(m_iVictoryPoints >= 0); + ASSERT(m_iVictoryPoints >= 0); } // -------------------------------------------------------------------------------- @@ -6154,10 +6154,10 @@ void CvTeam::setHasTech(TechTypes eIndex, bool bNewValue, PlayerTypes ePlayer, b ePlayer = getLeaderID(); } - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); if(ePlayer == NO_PLAYER) { @@ -6285,7 +6285,7 @@ void CvTeam::setHasTech(TechTypes eIndex, bool bNewValue, PlayerTypes ePlayer, b if(eResource != NO_RESOURCE) { CvResourceInfo* pResourceInfo = GC.getResourceInfo(eResource); - CvAssert(pResourceInfo); + ASSERT(pResourceInfo); if (!pResourceInfo) continue; @@ -7336,7 +7336,7 @@ void CvTeam::setHasTech(TechTypes eIndex, bool bNewValue, PlayerTypes ePlayer, b { if (GC.getGame().isFinalInitialized()) { - CvAssert(ePlayer != NO_PLAYER); + ASSERT(ePlayer != NO_PLAYER); if(GET_PLAYER(ePlayer).isHuman()) { if(GET_PLAYER(ePlayer).GetPlayerTechs()->IsResearch() && (GET_PLAYER(ePlayer).GetPlayerTechs()->GetCurrentResearch() == NO_TECH)) @@ -7428,25 +7428,25 @@ int CvTeam::GetTechProgressPercent() const // -------------------------------------------------------------------------------- int CvTeam::getFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiFeatureYieldChange[eIndex1][eIndex2]; } // -------------------------------------------------------------------------------- void CvTeam::changeFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_ppaaiFeatureYieldChange[eIndex1][eIndex2] = (m_ppaaiFeatureYieldChange[eIndex1][eIndex2] + iChange); - CvAssert(getFeatureYieldChange(eIndex1, eIndex2) >= 0); + ASSERT(getFeatureYieldChange(eIndex1, eIndex2) >= 0); updateYield(); } @@ -7455,25 +7455,25 @@ void CvTeam::changeFeatureYieldChange(FeatureTypes eIndex1, YieldTypes eIndex2, // -------------------------------------------------------------------------------- int CvTeam::getTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiTerrainYieldChange[eIndex1][eIndex2]; } // -------------------------------------------------------------------------------- void CvTeam::changeTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_ppaaiTerrainYieldChange[eIndex1][eIndex2] = (m_ppaaiTerrainYieldChange[eIndex1][eIndex2] + iChange); - CvAssert(getTerrainYieldChange(eIndex1, eIndex2) >= 0); + ASSERT(getTerrainYieldChange(eIndex1, eIndex2) >= 0); updateYield(); } @@ -7482,10 +7482,10 @@ void CvTeam::changeTerrainYieldChange(TerrainTypes eIndex1, YieldTypes eIndex2, // -------------------------------------------------------------------------------- int CvTeam::getImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiImprovementYieldChange[eIndex1][eIndex2]; } @@ -7493,15 +7493,15 @@ int CvTeam::getImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eInde // -------------------------------------------------------------------------------- void CvTeam::changeImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_ppaaiImprovementYieldChange[eIndex1][eIndex2] = (m_ppaaiImprovementYieldChange[eIndex1][eIndex2] + iChange); - CvAssert(getImprovementYieldChange(eIndex1, eIndex2) >= 0); + ASSERT(getImprovementYieldChange(eIndex1, eIndex2) >= 0); updateYield(); } @@ -7511,10 +7511,10 @@ void CvTeam::changeImprovementYieldChange(ImprovementTypes eIndex1, YieldTypes e // -------------------------------------------------------------------------------- int CvTeam::getImprovementNoFreshWaterYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiImprovementNoFreshWaterYieldChange[eIndex1][eIndex2]; } @@ -7522,15 +7522,15 @@ int CvTeam::getImprovementNoFreshWaterYieldChange(ImprovementTypes eIndex1, Yiel // -------------------------------------------------------------------------------- void CvTeam::changeImprovementNoFreshWaterYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_ppaaiImprovementNoFreshWaterYieldChange[eIndex1][eIndex2] = (m_ppaaiImprovementNoFreshWaterYieldChange[eIndex1][eIndex2] + iChange); - CvAssert(getImprovementNoFreshWaterYieldChange(eIndex1, eIndex2) >= 0); + ASSERT(getImprovementNoFreshWaterYieldChange(eIndex1, eIndex2) >= 0); updateYield(); } @@ -7540,10 +7540,10 @@ void CvTeam::changeImprovementNoFreshWaterYieldChange(ImprovementTypes eIndex1, // -------------------------------------------------------------------------------- int CvTeam::getImprovementFreshWaterYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); return m_ppaaiImprovementFreshWaterYieldChange[eIndex1][eIndex2]; } @@ -7551,15 +7551,15 @@ int CvTeam::getImprovementFreshWaterYieldChange(ImprovementTypes eIndex1, YieldT // -------------------------------------------------------------------------------- void CvTeam::changeImprovementFreshWaterYieldChange(ImprovementTypes eIndex1, YieldTypes eIndex2, int iChange) { - CvAssertMsg(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex1 >= 0, "eIndex1 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "eIndex1 is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex2 >= 0, "eIndex2 is expected to be non-negative (invalid Index)"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "eIndex2 is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { m_ppaaiImprovementFreshWaterYieldChange[eIndex1][eIndex2] = (m_ppaaiImprovementFreshWaterYieldChange[eIndex1][eIndex2] + iChange); - CvAssert(getImprovementFreshWaterYieldChange(eIndex1, eIndex2) >= 0); + ASSERT(getImprovementFreshWaterYieldChange(eIndex1, eIndex2) >= 0); updateYield(); } @@ -7601,7 +7601,7 @@ void CvTeam::updateTechShare(TechTypes eTech) { if(isHasMet((TeamTypes)iI)) { - CvAssertMsg(iI != GetID(), "iI is not expected to be equal with GetID()"); + ASSERT(iI != GetID(), "iI is not expected to be equal with GetID()"); iCount++; } } @@ -9015,7 +9015,7 @@ int CvTeam::countNumHumanGameTurnActive() const // -------------------------------------------------------------------------------- void CvTeam::setTurnActive(bool bNewValue, bool bDoTurn) { - CvAssert(GC.getGame().isSimultaneousTeamTurns()); + ASSERT(GC.getGame().isSimultaneousTeamTurns()); for(int iPlayer = 0; iPlayer < MAX_PLAYERS; ++iPlayer) { @@ -9030,7 +9030,7 @@ void CvTeam::setTurnActive(bool bNewValue, bool bDoTurn) // -------------------------------------------------------------------------------- bool CvTeam::isTurnActive() const { - CvAssert(GC.getGame().isSimultaneousTeamTurns()); + ASSERT(GC.getGame().isSimultaneousTeamTurns()); for(int iPlayer = 0; iPlayer < MAX_PLAYERS; ++iPlayer) { @@ -9050,7 +9050,7 @@ bool CvTeam::isTurnActive() const // -------------------------------------------------------------------------------- void CvTeam::PushIgnoreWarning (TeamTypes eTeam) { - CvAssertMsg(eTeam != NO_TEAM, "PushIgnoreWarning got NO_TEAM passed to it"); + ASSERT(eTeam != NO_TEAM, "PushIgnoreWarning got NO_TEAM passed to it"); if (eTeam == NO_TEAM) { return; @@ -9062,13 +9062,13 @@ void CvTeam::PushIgnoreWarning (TeamTypes eTeam) // -------------------------------------------------------------------------------- void CvTeam::PopIgnoreWarning (TeamTypes eTeam) { - CvAssertMsg(eTeam != NO_TEAM, "PopIgnoreWarning got NO_TEAM passed to it"); + ASSERT(eTeam != NO_TEAM, "PopIgnoreWarning got NO_TEAM passed to it"); if (eTeam == NO_TEAM) { return; } - CvAssertMsg(m_aiIgnoreWarningCount[eTeam] > 0, "Trying to pop when there's nothing to be popped"); + ASSERT(m_aiIgnoreWarningCount[eTeam] > 0, "Trying to pop when there's nothing to be popped"); if (m_aiIgnoreWarningCount[eTeam] > 0) { m_aiIgnoreWarningCount[eTeam] -= 1; @@ -9078,7 +9078,7 @@ void CvTeam::PopIgnoreWarning (TeamTypes eTeam) // -------------------------------------------------------------------------------- int CvTeam::GetIgnoreWarningCount (TeamTypes eTeam) { - CvAssertMsg(eTeam != NO_TEAM, "GetIgnoreWarningCount got NO_TEAM passed to it"); + ASSERT(eTeam != NO_TEAM, "GetIgnoreWarningCount got NO_TEAM passed to it"); if (eTeam == NO_TEAM) { return -1; @@ -9280,8 +9280,8 @@ void CvTeam::AddNotification(NotificationTypes eNotificationType, const char* st // Acquire the map (territory or world) of eTeam void CvTeam::AcquireMap(TeamTypes eTeam, bool bTerritoryOnly) { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); CvMap& kMap = GC.getMap(); CvPlot* pPlot = NULL; @@ -9338,7 +9338,7 @@ bool CvTeam::IsVassalageTradingAllowed() const void CvTeam::changeVassalageTradingAllowedCount(int iChange) { m_iVassalageTradingAllowedCount = (m_iVassalageTradingAllowedCount + iChange); - CvAssert(getVassalageTradingAllowedCount() >= 0); + ASSERT(getVassalageTradingAllowedCount() >= 0); } // -------------------------------------------------------------------------------- // Find out who we're a vassal of @@ -9883,8 +9883,8 @@ void CvTeam::DoBecomeVassal(TeamTypes eTeam, bool bVoluntary, PlayerTypes eOrigi Localization::String locString; Localization::String summaryString; - CvAssertMsg(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); - CvAssertMsg(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); + ASSERT(eTeam != NO_TEAM, "eTeam is not assigned a valid value"); + ASSERT(eTeam != GetID(), "eTeam is not expected to be equal with GetID()"); // we must be able to become their vassal if(!canBecomeVassal(eTeam, /*bIgnoreAlreadyVassal*/ true)) @@ -10205,17 +10205,17 @@ void CvTeam::ChangeNumTurnsIsVassal(int iChange) // -------------------------------------------------------------------------------- int CvTeam::GetNumTurnsSinceVassalEnded(TeamTypes eTeam) const { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_aiNumTurnsSinceVassalEnded[eTeam]; } // -------------------------------------------------------------------------------- void CvTeam::SetNumTurnsSinceVassalEnded(TeamTypes eTeam, int iValue) { - CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(eTeam != GetID(), "Team is setting vassal ended turns with itself!"); + ASSERT(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTeam != GetID(), "Team is setting vassal ended turns with itself!"); if(eTeam != GetID() || iValue == 0) m_aiNumTurnsSinceVassalEnded[eTeam] = iValue; } @@ -10292,32 +10292,32 @@ void CvTeam::DoApplyVassalTax(PlayerTypes ePlayer, int iPercent) // -------------------------------------------------------------------------------- void CvTeam::SetVassalTax(PlayerTypes ePlayer, int iPercent) { - CvAssertMsg(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index."); m_aiVassalTax[ePlayer] = iPercent; } // -------------------------------------------------------------------------------- int CvTeam::GetVassalTax(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "TEAM: VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "TEAM: VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "TEAM: VASSAL TAX! Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "TEAM: VASSAL TAX! Invalid Player Index."); return m_aiVassalTax[ePlayer]; } // -------------------------------------------------------------------------------- int CvTeam::GetNumTurnsSinceVassalTaxSet(PlayerTypes ePlayer) const { - CvAssertMsg(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index."); return m_aiNumTurnsSinceVassalTaxSet[ePlayer]; } // -------------------------------------------------------------------------------- void CvTeam::ChangeNumTurnsSinceVassalTaxSet(PlayerTypes ePlayer, int iChange) { - CvAssertMsg(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index."); if(iChange != 0) SetNumTurnsSinceVassalTaxSet(ePlayer, GetNumTurnsSinceVassalTaxSet(ePlayer) + iChange); @@ -10325,8 +10325,8 @@ void CvTeam::ChangeNumTurnsSinceVassalTaxSet(PlayerTypes ePlayer, int iChange) // -------------------------------------------------------------------------------- void CvTeam::SetNumTurnsSinceVassalTaxSet(PlayerTypes ePlayer, int iValue) { - CvAssertMsg(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); - CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing."); + ASSERT(ePlayer >= 0, "SET VASSAL TAX! Invalid Player Index."); + ASSERT(ePlayer < MAX_MAJOR_CIVS, "SET VASSAL TAX! Invalid Player Index."); m_aiNumTurnsSinceVassalTaxSet[ePlayer] = iValue; } @@ -10342,8 +10342,8 @@ bool CvTeam::IsTooSoonForVassal(TeamTypes eTeam) const /// How many vassals do we have? int CvTeam::GetNumVassals() { - CvAssertMsg(GetID() >= 0, "TeamID is expected to be non-negative (invalid Index)"); - CvAssertMsg(GetID() < MAX_TEAMS, "TeamID is expected to be within maximum bounds (invalid Index)"); + ASSERT(GetID() >= 0, "TeamID is expected to be non-negative (invalid Index)"); + ASSERT(GetID() < MAX_TEAMS, "TeamID is expected to be within maximum bounds (invalid Index)"); if(GET_TEAM(GetID()).isMinorCiv() || GET_TEAM(GetID()).isBarbarian()) return 0; diff --git a/CvGameCoreDLL_Expansion2/CvTechAI.cpp b/CvGameCoreDLL_Expansion2/CvTechAI.cpp index 99b845e9ca..4fdb0fc474 100644 --- a/CvGameCoreDLL_Expansion2/CvTechAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvTechAI.cpp @@ -30,10 +30,10 @@ CvTechAI::~CvTechAI(void) /// Clear out AI local variables void CvTechAI::Reset() { - CvAssertMsg(m_pCurrentTechs != NULL, "Tech AI init failure: player tech data is NULL"); + ASSERT(m_pCurrentTechs != NULL, "Tech AI init failure: player tech data is NULL"); if(m_pCurrentTechs != NULL) { - CvAssertMsg(m_pCurrentTechs->GetTechs() != NULL, "Tech AI init failure: no tech data"); + ASSERT(m_pCurrentTechs->GetTechs() != NULL, "Tech AI init failure: no tech data"); m_TechAIWeights.clear(); @@ -255,8 +255,8 @@ float CvTechAI::GetTechRatio() } } - CvAssertMsg(iPlayerIndexInList != -1, "Could not find player in list"); - CvAssertMsg(aLeaderWithNumTechs.size() >= 2, "Only one player in the game? Huh?"); + ASSERT(iPlayerIndexInList != -1, "Could not find player in list"); + ASSERT(aLeaderWithNumTechs.size() >= 2, "Only one player in the game? Huh?"); float fTechPositionRatio = 0.0f; if(aLeaderWithNumTechs.size() >= 2) { diff --git a/CvGameCoreDLL_Expansion2/CvTechClasses.cpp b/CvGameCoreDLL_Expansion2/CvTechClasses.cpp index 19c1af6402..756c026137 100644 --- a/CvGameCoreDLL_Expansion2/CvTechClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvTechClasses.cpp @@ -572,8 +572,8 @@ int CvTechEntry::GetTradeRouteDomainExtraRange(int i) const /// Find value of flavors associated with this tech int CvTechEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : -1; } @@ -592,10 +592,10 @@ int CvTechEntry::GetPrereqAndTechs(int i) const //------------------------------------------------------------------------------ int CvTechEntry::GetTechYieldChanges(int i, int j) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiTechYieldChanges[i][j]; } int CvTechEntry::GetHappiness() const @@ -706,23 +706,23 @@ void CvPlayerTechs::Init(CvTechXMLEntries* pTechs, CvPlayer* pPlayer, bool bIsCi // Initialize arrays const int iNumTechs = m_pTechs->GetNumTechs(); - CvAssertMsg(m_pabResearchingTech==NULL, "about to leak memory, CvPlayerTechs::m_pabResearchingTech"); + ASSERT(m_pabResearchingTech==NULL, "about to leak memory, CvPlayerTechs::m_pabResearchingTech"); m_pabResearchingTech = FNEW(bool[iNumTechs], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_piCivTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piCivTechPriority"); + ASSERT(m_piCivTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piCivTechPriority"); m_piCivTechPriority = FNEW(int[iNumTechs], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_piLocaleTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piLocaleTechPriority"); + ASSERT(m_piLocaleTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piLocaleTechPriority"); m_piLocaleTechPriority = FNEW(int[iNumTechs], c_eCiv5GameplayDLL, 0); #if defined(MOD_BALANCE_CORE) - CvAssertMsg(m_piGSTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piGSTechPriority"); + ASSERT(m_piGSTechPriority==NULL, "about to leak memory, CvPlayerTechs::m_piGSTechPriority"); m_piGSTechPriority = FNEW(int[iNumTechs], c_eCiv5GameplayDLL, 0); #endif - CvAssertMsg(m_peLocaleTechResources==NULL, "about to leak memory, CvPlayerTechs::m_peLocaleTechResources"); + ASSERT(m_peLocaleTechResources==NULL, "about to leak memory, CvPlayerTechs::m_peLocaleTechResources"); m_peLocaleTechResources = FNEW(ResourceTypes[iNumTechs], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_peCivTechUniqueUnits==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueUnits"); + ASSERT(m_peCivTechUniqueUnits==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueUnits"); m_peCivTechUniqueUnits = FNEW(UnitTypes[iNumTechs], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_peCivTechUniqueBuildings==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueBuildings"); + ASSERT(m_peCivTechUniqueBuildings==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueBuildings"); m_peCivTechUniqueBuildings = FNEW(BuildingTypes[iNumTechs], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_peCivTechUniqueImprovements==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueImprovements"); + ASSERT(m_peCivTechUniqueImprovements==NULL, "about to leak memory, CvPlayerTechs::m_peCivTechUniqueImprovements"); m_peCivTechUniqueImprovements = FNEW(ImprovementTypes[iNumTechs], c_eCiv5GameplayDLL, 0); // Create AI object @@ -963,7 +963,7 @@ void CvPlayerTechs::Reset() template void CvPlayerTechs::Serialize(PlayerTechs& playerTechs, Visitor& visitor) { - CvAssertMsg(playerTechs.m_pTechs != NULL && playerTechs.m_pTechs->GetNumTechs() > 0, "Number of techs to serialize is expected to greater than 0"); + ASSERT(playerTechs.m_pTechs != NULL && playerTechs.m_pTechs->GetNumTechs() > 0, "Number of techs to serialize is expected to greater than 0"); const int iNumTechs = playerTechs.m_pTechs->GetNumTechs(); visitor(MakeConstSpan(playerTechs.m_pabResearchingTech, iNumTechs)); visitor(MakeConstSpan(playerTechs.m_piCivTechPriority, iNumTechs)); @@ -1035,16 +1035,16 @@ CvTechAI* CvPlayerTechs::GetTechAI() /// Accessor: is a player researching a tech? bool CvPlayerTechs::IsResearchingTech(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabResearchingTech[eIndex]; } /// Accessor: set whether player is researching a tech void CvPlayerTechs::SetResearchingTech(TechTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(m_pabResearchingTech[eIndex] != bNewValue) { @@ -1055,8 +1055,8 @@ void CvPlayerTechs::SetResearchingTech(TechTypes eIndex, bool bNewValue) /// Accessor: set Civ's priority multiplier for researching techs (for instance techs that unlock civ unique bonuses) void CvPlayerTechs::SetCivTechPriority(TechTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piCivTechPriority[eIndex] = iNewValue; } @@ -1064,16 +1064,16 @@ void CvPlayerTechs::SetCivTechPriority(TechTypes eIndex, int iNewValue) /// Accessor: get Civ's priority multiplier for researching techs (for instance techs that unlock civ unique bonuses) int CvPlayerTechs::GetCivTechPriority(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piCivTechPriority[eIndex]; } /// Accessor: set locale priority multiplier for researching techs (for instance techs that unlock nearby resources) void CvPlayerTechs::SetLocaleTechPriority(TechTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piLocaleTechPriority[eIndex] = iNewValue; } @@ -1081,55 +1081,55 @@ void CvPlayerTechs::SetLocaleTechPriority(TechTypes eIndex, int iNewValue) /// Accessor: get locale priority multiplier for researching techs (for instance techs that unlock nearby resources) int CvPlayerTechs::GetLocaleTechPriority(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piLocaleTechPriority[eIndex]; } #if defined(MOD_BALANCE_CORE) /// Accessor: get GC priority multiplier for researching techs int CvPlayerTechs::GetGSTechPriority(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_piGSTechPriority[eIndex]; } /// Accessor: set locale priority multiplier for researching techs void CvPlayerTechs::SetGSTechPriority(TechTypes eIndex, int iNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_piGSTechPriority[eIndex] = iNewValue; } #endif ResourceTypes CvPlayerTechs::GetLocaleTechResource(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_peLocaleTechResources[eIndex]; } UnitTypes CvPlayerTechs::GetCivTechUniqueUnit(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_peCivTechUniqueUnits[eIndex]; } BuildingTypes CvPlayerTechs::GetCivTechUniqueBuilding(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_peCivTechUniqueBuildings[eIndex]; } ImprovementTypes CvPlayerTechs::GetCivTechUniqueImprovement(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_peCivTechUniqueImprovements[eIndex]; } @@ -1563,8 +1563,8 @@ bool CvPlayerTechs::CanResearch(TechTypes eTech, bool bTrade) const /// Can we pick this as a Free Tech (ex. from a Wonder)? bool CvPlayerTechs::CanResearchForFree(TechTypes eTech) const { - CvAssertMsg(eTech >= 0, "eTech is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTech < GC.getNumTechInfos(), "eTech is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTech >= 0, "eTech is expected to be non-negative (invalid Index)"); + ASSERT(eTech < GC.getNumTechInfos(), "eTech is expected to be within maximum bounds (invalid Index)"); if(eTech < 0 || eTech >= GC.getNumTechInfos()) return false; // We can pick any tech that we are able to research @@ -2216,17 +2216,17 @@ void CvTeamTechs::Init(CvTechXMLEntries* pTechs, CvTeam* pTeam) m_pTeam = pTeam; // Initialize status arrays - CvAssertMsg(m_pabHasTech==NULL, "about to leak memory, CvTeamTechs::m_pabHasTech"); + ASSERT(m_pabHasTech==NULL, "about to leak memory, CvTeamTechs::m_pabHasTech"); m_pabHasTech = FNEW(bool[m_pTechs->GetNumTechs()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_pabNoTradeTech==NULL, "about to leak memory, CvTeamTechs::m_pabNoTradeTech"); + ASSERT(m_pabNoTradeTech==NULL, "about to leak memory, CvTeamTechs::m_pabNoTradeTech"); m_pabNoTradeTech = FNEW(bool[m_pTechs->GetNumTechs()], c_eCiv5GameplayDLL, 0); - CvAssertMsg(m_paiResearchProgress==NULL, "about to leak memory, CvTeamTechs::m_paiResearchProgress"); + ASSERT(m_paiResearchProgress==NULL, "about to leak memory, CvTeamTechs::m_paiResearchProgress"); m_paiResearchProgress = FNEW(int [m_pTechs->GetNumTechs()], c_eCiv5GameplayDLL, 0); #if defined(MOD_CIV6_EUREKA) - CvAssertMsg(m_paiEurekaCounter == NULL, "about to leak memory, CvTeamTechs::m_paiEurekaCounter"); + ASSERT(m_paiEurekaCounter == NULL, "about to leak memory, CvTeamTechs::m_paiEurekaCounter"); m_paiEurekaCounter = FNEW(int[m_pTechs->GetNumTechs()], c_eCiv5GameplayDLL, 0); #endif - CvAssertMsg(m_paiTechCount==NULL, "about to leak memory, CvTeamTechs::m_paiTechCount"); + ASSERT(m_paiTechCount==NULL, "about to leak memory, CvTeamTechs::m_paiTechCount"); m_paiTechCount = FNEW(int [m_pTechs->GetNumTechs()], c_eCiv5GameplayDLL, 0); Reset(); @@ -2285,7 +2285,7 @@ void CvTeamTechs::Read(FDataStream& kStream) int iNumActiveTechs = m_pTechs->GetNumTechs(); // Next is an array of the tech IDs that were available when the save was made. - CvAssert(m_pTechs == GC.GetGameTechs()); // The hash to indices conversion will convert the hash to the index in the main game techs array, so these better be the same. + ASSERT(m_pTechs == GC.GetGameTechs()); // The hash to indices conversion will convert the hash to the index in the main game techs array, so these better be the same. int* paTechIDs = (int*)_malloca(iNumSavedTechs * sizeof(int)); CvInfosSerializationHelper::ReadHashedTypeArray(kStream, iNumSavedTechs, paTechIDs, iNumSavedTechs); @@ -2350,8 +2350,8 @@ FDataStream& operator>>(FDataStream& loadFrom, CvTeamTechs& writeTo) /// Accessor: set whether team owns a tech void CvTeamTechs::SetHasTech(TechTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(m_pabHasTech[eIndex] != bNewValue) { @@ -2384,9 +2384,9 @@ bool CvTeamTechs::HasTech(TechTypes eIndex) const return true; } - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(m_pabHasTech != NULL, "m_pabHasTech is not expected to be equal with NULL"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(m_pabHasTech != NULL, "m_pabHasTech is not expected to be equal with NULL"); if(m_pabHasTech != NULL) return m_pabHasTech[eIndex]; else @@ -2402,8 +2402,8 @@ TechTypes CvTeamTechs::GetLastTechAcquired() const /// What was the most recent tech acquired? void CvTeamTechs::SetLastTechAcquired(TechTypes eTech) { - CvAssertMsg(eTech >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTech < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTech >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eTech < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_eLastTechAcquired = eTech; } @@ -2428,8 +2428,8 @@ bool CvTeamTechs::HasResearchedAllTechs() const /// Accessor: set whether team owns a tech void CvTeamTechs::SetNoTradeTech(TechTypes eIndex, bool bNewValue) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); if(m_pabNoTradeTech[eIndex] != bNewValue) { @@ -2440,8 +2440,8 @@ void CvTeamTechs::SetNoTradeTech(TechTypes eIndex, bool bNewValue) /// Accessor: does team have a tech? bool CvTeamTechs::IsNoTradeTech(TechTypes eIndex) const { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_pabNoTradeTech[eIndex]; } @@ -2466,10 +2466,10 @@ void CvTeamTechs::SetResearchProgress(TechTypes eIndex, int iNewValue, PlayerTyp /// Accessor: set research done on one tech (in hundredths) void CvTeamTechs::SetResearchProgressTimes100(TechTypes eIndex, int iNewValue, PlayerTypes ePlayer, int iPlayerOverflow, int iPlayerOverflowDivisorTimes100) { - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); - CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumTechInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)"); //Crash failsafe. if(ePlayer == NO_PLAYER || eIndex == -1) @@ -2575,7 +2575,7 @@ int CvTeamTechs::GetResearchProgressTimes100(TechTypes eIndex) const /// Accessor: what is the cost of researching this tech (taking all modifiers into account) int CvTeamTechs::GetResearchCost(TechTypes eTech) const { - CvAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value"); + ASSERT(eTech != NO_TECH, "Tech is not assigned a valid value"); CvTechEntry* pkTechInfo = GC.getTechInfo(eTech); if(pkTechInfo == NULL) { @@ -2625,7 +2625,7 @@ int CvTeamTechs::GetResearchCost(TechTypes eTech) const #if defined(MOD_CIV6_EUREKA) int CvTeamTechs::GetEurekaDiscount(TechTypes eTech) const { - CvAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value"); + ASSERT(eTech != NO_TECH, "Tech is not assigned a valid value"); CvTechEntry* pkTechInfo = GC.getTechInfo(eTech); if (pkTechInfo == NULL) { diff --git a/CvGameCoreDLL_Expansion2/CvTradeClasses.cpp b/CvGameCoreDLL_Expansion2/CvTradeClasses.cpp index 8f5ca19ab1..c85302b1e1 100644 --- a/CvGameCoreDLL_Expansion2/CvTradeClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvTradeClasses.cpp @@ -585,7 +585,7 @@ bool CvGameTrade::CreateTradeRoute(CvCity* pOriginCity, CvCity* pDestCity, Domai } int iNewTradeRouteIndex = GetEmptyTradeRouteIndex(); - CvAssertMsg(iNewTradeRouteIndex < (int)m_aTradeConnections.size(), "iNewTradeRouteIndex out of bounds"); + ASSERT(iNewTradeRouteIndex < (int)m_aTradeConnections.size(), "iNewTradeRouteIndex out of bounds"); // couldn't find valid connection, bail out if (iNewTradeRouteIndex < 0) @@ -1109,7 +1109,7 @@ bool CvGameTrade::IsTradeRouteIndexEmpty(int iIndex) // -------------------------------------------------------------------------------- bool CvGameTrade::ClearTradeRoute(int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) return false; @@ -1246,7 +1246,7 @@ int CvGameTrade::GetTradeRouteTurns(CvCity* pOriginCity, CvCity* pDestCity, Doma /// Called when a city changes hands void CvGameTrade::ClearAllCityTradeRoutes (CvPlot* pPlot, bool bIncludeTransits) { - CvAssert(pPlot != NULL); + ASSERT(pPlot != NULL); if (pPlot) { @@ -1270,7 +1270,7 @@ void CvGameTrade::ClearAllCityTradeRoutes (CvPlot* pPlot, bool bIncludeTransits) CvPlayer& kPlayer = GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner); UnitTypes eUnitType = kPlayer.GetTrade()->GetTradeUnit(m_aTradeConnections[ui].m_eDomain, &kPlayer); - CvAssertMsg(eUnitType != NO_UNIT, "No trade unit found"); + ASSERT(eUnitType != NO_UNIT, "No trade unit found"); if (eUnitType != NO_UNIT) { GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner).initUnit(eUnitType, m_aTradeConnections[ui].m_iOriginX, m_aTradeConnections[ui].m_iOriginY, UNITAI_TRADE_UNIT); @@ -1333,7 +1333,7 @@ void CvGameTrade::ClearAllCivTradeRoutes (PlayerTypes ePlayer, bool bFromEmbargo CvPlayer& kPlayer = GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner); UnitTypes eUnitType = kPlayer.GetTrade()->GetTradeUnit(m_aTradeConnections[ui].m_eDomain, &kPlayer); - CvAssertMsg(eUnitType != NO_UNIT, "No trade unit found"); + ASSERT(eUnitType != NO_UNIT, "No trade unit found"); if (eUnitType != NO_UNIT) { GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner).initUnit(eUnitType, m_aTradeConnections[ui].m_iOriginX, m_aTradeConnections[ui].m_iOriginY, UNITAI_TRADE_UNIT); @@ -1366,7 +1366,7 @@ void CvGameTrade::ClearAllCityStateTradeRoutes (void) CvPlayer& kPlayer = GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner); UnitTypes eUnitType = kPlayer.GetTrade()->GetTradeUnit(m_aTradeConnections[ui].m_eDomain, &kPlayer); - CvAssertMsg(eUnitType != NO_UNIT, "No trade unit found"); + ASSERT(eUnitType != NO_UNIT, "No trade unit found"); if (eUnitType != NO_UNIT) { GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner).initUnit(eUnitType, m_aTradeConnections[ui].m_iOriginX, m_aTradeConnections[ui].m_iOriginY, UNITAI_TRADE_UNIT); @@ -1404,7 +1404,7 @@ void CvGameTrade::ClearAllCityStateTradeRoutesSpecial (void) CvPlayer& kPlayer = GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner); UnitTypes eUnitType = kPlayer.GetTrade()->GetTradeUnit(m_aTradeConnections[ui].m_eDomain, &kPlayer); - CvAssertMsg(eUnitType != NO_UNIT, "No trade unit found"); + ASSERT(eUnitType != NO_UNIT, "No trade unit found"); if (eUnitType != NO_UNIT) { GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner).initUnit(eUnitType, m_aTradeConnections[ui].m_iOriginX, m_aTradeConnections[ui].m_iOriginY, UNITAI_TRADE_UNIT); @@ -1451,7 +1451,7 @@ void CvGameTrade::ClearTradePlayerToPlayer(PlayerTypes ePlayer, PlayerTypes eToP { CvPlayer& kPlayer = GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner); UnitTypes eUnitType = kPlayer.GetTrade()->GetTradeUnit(m_aTradeConnections[ui].m_eDomain, &kPlayer); - CvAssertMsg(eUnitType != NO_UNIT, "No trade unit found"); + ASSERT(eUnitType != NO_UNIT, "No trade unit found"); if (eUnitType != NO_UNIT) { GET_PLAYER(m_aTradeConnections[ui].m_eOriginOwner).initUnit(eUnitType, m_aTradeConnections[ui].m_iOriginX, m_aTradeConnections[ui].m_iOriginY, UNITAI_TRADE_UNIT); @@ -1656,7 +1656,7 @@ CvCity* CvGameTrade::GetOriginCity(const TradeConnection& kTradeConnection) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_iOriginX, kTradeConnection.m_iOriginY); - CvAssertMsg(pPlot, "CvPlayerTrade - plot is null"); + ASSERT(pPlot, "CvPlayerTrade - plot is null"); if (!pPlot) { return NULL; @@ -1670,7 +1670,7 @@ CvCity* CvGameTrade::GetDestCity(const TradeConnection& kTradeConnection) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_iDestX, kTradeConnection.m_iDestY); - CvAssertMsg(pPlot, "CvPlayerTrade - plot is null"); + ASSERT(pPlot, "CvPlayerTrade - plot is null"); if (!pPlot) { return NULL; @@ -1882,7 +1882,7 @@ int CvGameTrade::GetPolicyDifference(PlayerTypes ePlayer, PlayerTypes ePlayer2) } bool CvGameTrade::IsRecalledUnit (int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return false; @@ -1895,7 +1895,7 @@ bool CvGameTrade::IsRecalledUnit (int iIndex) { // -------------------------------------------------------------------------------- /// recall a trade unit void CvGameTrade::RecallUnit (int iIndex, bool bImmediate) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return; @@ -1913,7 +1913,7 @@ void CvGameTrade::RecallUnit (int iIndex, bool bImmediate) { // -------------------------------------------------------------------------------- /// end a trade route void CvGameTrade::EndTradeRoute (int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return; @@ -1928,7 +1928,7 @@ void CvGameTrade::EndTradeRoute (int iIndex) { /// move a trade unit along its path for all its movement points bool CvGameTrade::MoveUnit (int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return false; @@ -2009,7 +2009,7 @@ bool CvGameTrade::MoveUnit (int iIndex) /// move a trade unit a single step along its path (called by MoveUnit) bool CvGameTrade::StepUnit (int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return false; @@ -2093,7 +2093,7 @@ bool CvGameTrade::StepUnit (int iIndex) // ---------------------------------------------------------------------------- void CvGameTrade::CreateTradeUnitForRoute(int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return; @@ -2121,7 +2121,7 @@ void CvGameTrade::CreateTradeUnitForRoute(int iIndex) // ---------------------------------------------------------------------------- CvUnit* CvGameTrade::GetTradeUnitForRoute(int iIndex) { - CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); + ASSERT(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds"); if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size()) { return NULL; @@ -2146,7 +2146,7 @@ void CvGameTrade::DisplayTemporaryPopupTradeRoute(int iDestX, int iDestY, TradeC CvInterfacePtr pSelectedUnit(GC.GetEngineUserInterface()->GetHeadSelectedUnit()); CvUnit* pkSelectedUnit = GC.UnwrapUnitPointer(pSelectedUnit.get()); - CvAssert(pkSelectedUnit != NULL); + ASSERT(pkSelectedUnit != NULL); if (pkSelectedUnit) { iOriginX = pkSelectedUnit->getX(); @@ -2783,14 +2783,14 @@ int CvPlayerTrade::GetTradeConnectionGPTValueTimes100(const TradeConnection& kTr CvPlot* pPlot = GC.getMap().plot(iX, iY); - CvAssertMsg(pPlot, "CvPlayerTrade - plot is null"); + ASSERT(pPlot, "CvPlayerTrade - plot is null"); if (!pPlot) { return 0; } CvCity* pCity = pPlot->getPlotCity(); - CvAssertMsg(pCity, "CvPlayerTrade - pCity is null"); + ASSERT(pCity, "CvPlayerTrade - pCity is null"); if (!pCity) { return 0; @@ -2826,7 +2826,7 @@ int CvPlayerTrade::GetTradeConnectionResourceValueTimes100(const TradeConnection CvPlot* pOriginPlot = GC.getMap().plot(kTradeConnection.m_iOriginX, kTradeConnection.m_iOriginY); CvPlot* pDestPlot = GC.getMap().plot(kTradeConnection.m_iDestX, kTradeConnection.m_iDestY); - CvAssertMsg(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); + ASSERT(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); if (!pOriginPlot || !pDestPlot) { return 0; @@ -2835,7 +2835,7 @@ int CvPlayerTrade::GetTradeConnectionResourceValueTimes100(const TradeConnection CvCity* pOriginCity = pOriginPlot->getPlotCity(); CvCity* pDestCity = pDestPlot->getPlotCity(); - CvAssertMsg(pOriginCity && pDestCity, "pOriginCity or pDestCity are null"); + ASSERT(pOriginCity && pDestCity, "pOriginCity or pDestCity are null"); if (!pOriginCity || !pDestCity) { return 0; @@ -2914,7 +2914,7 @@ int CvPlayerTrade::GetTradeConnectionYourBuildingValueTimes100(const TradeConnec CvPlot* pOriginPlot = GC.getMap().plot(kTradeConnection.m_iOriginX, kTradeConnection.m_iOriginY); CvPlot* pDestPlot = GC.getMap().plot(kTradeConnection.m_iDestX, kTradeConnection.m_iDestY); - CvAssertMsg(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); + ASSERT(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); if (!pOriginPlot || !pDestPlot) { return 0; @@ -3019,7 +3019,7 @@ int CvPlayerTrade::GetTradeConnectionTheirBuildingValueTimes100(const TradeConne CvPlot* pOriginPlot = GC.getMap().plot(kTradeConnection.m_iOriginX, kTradeConnection.m_iOriginY); CvPlot* pDestPlot = GC.getMap().plot(kTradeConnection.m_iDestX, kTradeConnection.m_iDestY); - CvAssertMsg(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); + ASSERT(pOriginPlot && pDestPlot, "pOriginPlot or pDestPlot are null"); if (!pOriginPlot || !pDestPlot) { return 0; @@ -3310,7 +3310,7 @@ int CvPlayerTrade::GetTradeConnectionRiverValueModifierTimes100(const TradeConne if (bAsOriginPlayer) { CvCity* pOriginCity = CvGameTrade::GetOriginCity(kTradeConnection); - CvAssert(pOriginCity != NULL); + ASSERT(pOriginCity != NULL); if (pOriginCity) { CvPlot* pOriginCityPlot = pOriginCity->plot(); @@ -3323,7 +3323,7 @@ int CvPlayerTrade::GetTradeConnectionRiverValueModifierTimes100(const TradeConne else { CvCity* pDestCity = CvGameTrade::GetDestCity(kTradeConnection); - CvAssert(pDestCity != NULL); + ASSERT(pDestCity != NULL); if (pDestCity) { CvPlot* pDestCityPlot = pDestCity->plot(); @@ -3349,8 +3349,8 @@ int CvPlayerTrade::GetTradeConnectionDiplomatModifierTimes100(const TradeConnect { CvCity* pOriginCity = CvGameTrade::GetOriginCity(kTradeConnection); CvCity* pDestCity = CvGameTrade::GetDestCity(kTradeConnection); - CvAssert(pOriginCity != NULL); - CvAssert(pDestCity != NULL); + ASSERT(pOriginCity != NULL); + ASSERT(pDestCity != NULL); if (pOriginCity && pDestCity) { PlayerTypes eOriginPlayer = pOriginCity->getOwner(); @@ -3909,7 +3909,7 @@ int CvPlayerTrade::GetTradeConnectionValueTimes100 (const TradeConnection& kTrad { if (pTrade->IsConnectionInternational(kTradeConnection)) { - CvAssert(kTradeConnection.m_eConnectionType == TRADE_CONNECTION_INTERNATIONAL); + ASSERT(kTradeConnection.m_eConnectionType == TRADE_CONNECTION_INTERNATIONAL); if (kTradeConnection.m_eDestOwner == m_pPlayer->GetID()) { switch (eYield) @@ -3990,7 +3990,7 @@ int CvPlayerTrade::GetTradeConnectionValueTimes100 (const TradeConnection& kTrad } else { - CvAssert(kTradeConnection.m_eConnectionType != TRADE_CONNECTION_INTERNATIONAL); + ASSERT(kTradeConnection.m_eConnectionType != TRADE_CONNECTION_INTERNATIONAL); switch (kTradeConnection.m_eConnectionType) { case TRADE_CONNECTION_FOOD: @@ -4907,7 +4907,7 @@ bool CvPlayerTrade::PlunderTradeRoute(int iTradeConnectionID, CvUnit* pUnit) CvGameTrade* pTrade = GC.getGame().GetGameTrade(); int iTradeConnectionIndex = pTrade->GetIndexFromID(iTradeConnectionID); - CvAssertMsg(iTradeConnectionIndex >= 0, "iTradeConnectionIndex < 0"); + ASSERT(iTradeConnectionIndex >= 0, "iTradeConnectionIndex < 0"); if (iTradeConnectionIndex < 0) return false; @@ -4931,8 +4931,8 @@ bool CvPlayerTrade::PlunderTradeRoute(int iTradeConnectionID, CvUnit* pUnit) CvCity* pOriginCity = GET_PLAYER(eOwningPlayer).getCity(pTradeConnection->m_iOriginID); CvCity* pDestCity = GET_PLAYER(eDestPlayer).getCity(pTradeConnection->m_iDestID); - CvAssertMsg(pOriginCity, "pOriginCity doesn't exist"); - CvAssertMsg(pDestCity, "pDestCity doesn't exist"); + ASSERT(pOriginCity, "pOriginCity doesn't exist"); + ASSERT(pDestCity, "pDestCity doesn't exist"); // if the trade route was not broken if (!pTrade->ClearTradeRoute(iTradeConnectionIndex)) @@ -5352,7 +5352,7 @@ int CvPlayerTrade::GetTradeRouteSpeed(DomainTypes eDomain) const return iMoves; } - CvAssertMsg(false, "Undefined domain for trade route speed"); + ASSERT(false, "Undefined domain for trade route speed"); return -1; } @@ -5394,7 +5394,7 @@ uint CvPlayerTrade::GetNumTradeRoutesPossible() const { int iNumRoutes = 0; - CvAssert(m_pPlayer->getCivilizationType() != NO_CIVILIZATION); + ASSERT(m_pPlayer->getCivilizationType() != NO_CIVILIZATION); if (m_pPlayer->getCivilizationType() == NO_CIVILIZATION) return 0; @@ -5403,7 +5403,7 @@ uint CvPlayerTrade::GetNumTradeRoutesPossible() const CvTechEntry* pTechInfo = NULL; CvTechXMLEntries* pMyPlayerTechEntries = pMyPlayerTechs->GetTechs(); - CvAssert(pMyPlayerTechEntries); + ASSERT(pMyPlayerTechEntries); if (pMyPlayerTechEntries == NULL) return 0; @@ -5416,7 +5416,7 @@ uint CvPlayerTrade::GetNumTradeRoutesPossible() const } pTechInfo = pMyPlayerTechEntries->GetEntry(eTech); - CvAssertMsg(pTechInfo, "null tech entry"); + ASSERT(pTechInfo, "null tech entry"); if (pTechInfo) { iNumRoutes += pTechInfo->GetNumInternationalTradeRoutesChange(); @@ -6451,7 +6451,7 @@ CvTradeAI::TRSortElement CvTradeAI::ScoreInternationalTR(const TradeConnection& for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { continue; @@ -6500,7 +6500,7 @@ CvTradeAI::TRSortElement CvTradeAI::ScoreInternationalTR(const TradeConnection& for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { break; @@ -6688,7 +6688,7 @@ CvTradeAI::TRSortElement CvTradeAI::ScoreInternationalTR(const TradeConnection& /// Score Food TR int CvTradeAI::ScoreInternalTR(const TradeConnection& kTradeConnection, const std::vector& aTargetCityList) { - CvAssert(kTradeConnection.m_eConnectionType != TRADE_CONNECTION_INTERNATIONAL); + ASSERT(kTradeConnection.m_eConnectionType != TRADE_CONNECTION_INTERNATIONAL); // if we're not going to a target from our list, ignore bool bValidTarget = false; @@ -6807,7 +6807,7 @@ int CvTradeAI::ScoreInternalTR(const TradeConnection& kTradeConnection, const st for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { break; @@ -6823,7 +6823,7 @@ int CvTradeAI::ScoreInternalTR(const TradeConnection& kTradeConnection, const st for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { continue; @@ -7053,7 +7053,7 @@ CvTradeAI::TRSortElement CvTradeAI::ScoreGoldInternalTR(const TradeConnection& k for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { continue; @@ -7074,7 +7074,7 @@ CvTradeAI::TRSortElement CvTradeAI::ScoreGoldInternalTR(const TradeConnection& k for (uint uiPlotList = 0; uiPlotList < kTradeConnection.m_aPlotList.size(); uiPlotList++) { CvPlot* pPlot = GC.getMap().plot(kTradeConnection.m_aPlotList[uiPlotList].m_iX, kTradeConnection.m_aPlotList[uiPlotList].m_iY); - CvAssertMsg(pPlot, "pPlot is null when trying to evaluate the list"); + ASSERT(pPlot, "pPlot is null when trying to evaluate the list"); if (pPlot == NULL) { break; diff --git a/CvGameCoreDLL_Expansion2/CvTraitClasses.cpp b/CvGameCoreDLL_Expansion2/CvTraitClasses.cpp index 3a97c3dde3..f5ca5e7070 100644 --- a/CvGameCoreDLL_Expansion2/CvTraitClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvTraitClasses.cpp @@ -1447,89 +1447,89 @@ int CvTraitEntry::GetStrategicResourceQuantityModifier(int i) const /// Accessor:: Additional quantity of a specific resource int CvTraitEntry::GetResourceQuantityModifier(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityModifiers ? m_piResourceQuantityModifiers[i] : -1; } /// Accessor:: Extra yield from an improvement int CvTraitEntry::GetImprovementYieldChanges(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiImprovementYieldChanges ? m_ppiImprovementYieldChanges[eIndex1][eIndex2] : 0; } #if defined(MOD_BALANCE_CORE) int CvTraitEntry::GetYieldFromTileEarnTerrainType(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTileEarnTerrainType ? m_ppiYieldFromTileEarnTerrainType[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromTilePurchaseTerrainType(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTilePurchaseTerrainType ? m_ppiYieldFromTilePurchaseTerrainType[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromTileConquest(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTileConquest ? m_ppiYieldFromTileConquest[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromTileCultureBomb(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTileCultureBomb ? m_ppiYieldFromTileCultureBomb[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromTileStealCultureBomb(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTileStealCultureBomb ? m_ppiYieldFromTileStealCultureBomb[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromTileSettle(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldFromTileSettle ? m_ppiYieldFromTileSettle[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldChangePerImprovementBuilt(ImprovementTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiYieldChangePerImprovementBuilt ? m_ppiYieldChangePerImprovementBuilt[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromBarbarianCampClear(YieldTypes eIndex1, bool bEraScaling) const { - CvAssertMsg(eIndex1 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex1 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromBarbarianCampClear.find((int)eIndex1); if (itYield != m_pbiYieldFromBarbarianCampClear.end()) // find returns the iterator to map::end if the key eYield is not present in the map { @@ -1549,10 +1549,10 @@ int CvTraitEntry::GetYieldFromBarbarianCampClear(YieldTypes eIndex1, bool bEraSc /// Accessor:: Extra yield from a plot int CvTraitEntry::GetPlotYieldChanges(PlotTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumPlotInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumPlotInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiPlotYieldChanges ? m_ppiPlotYieldChanges[eIndex1][eIndex2] : 0; } @@ -1658,28 +1658,28 @@ int CvTraitEntry::GetFaithCostModifier() const int CvTraitEntry::GetNumPledgeDomainProductionModifier(DomainTypes eDomain) const { - CvAssertMsg((int)eDomain < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg((int)eDomain > -1, "Index out of bounds"); + ASSERT((int)eDomain < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT((int)eDomain > -1, "Index out of bounds"); return m_piNumPledgesDomainProdMod ? m_piNumPledgesDomainProdMod[(int)eDomain] : 0; } int CvTraitEntry::GetDomainFreeExperienceModifier(DomainTypes eDomain) const { - CvAssertMsg((int)eDomain < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg((int)eDomain > -1, "Index out of bounds"); + ASSERT((int)eDomain < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT((int)eDomain > -1, "Index out of bounds"); return m_piDomainFreeExperienceModifier ? m_piDomainFreeExperienceModifier[(int)eDomain] : 0; } int CvTraitEntry::GetFreeUnitClassesDOW(UnitClassTypes eUnitClass) const { - CvAssertMsg((int)eUnitClass < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg((int)eUnitClass > -1, "Index out of bounds"); + ASSERT((int)eUnitClass < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT((int)eUnitClass > -1, "Index out of bounds"); return m_piFreeUnitClassesDOW ? m_piFreeUnitClassesDOW[(int)eUnitClass] : 0; } #endif #if defined(MOD_BALANCE_CORE) && defined(MOD_TRAITS_YIELD_FROM_ROUTE_MOVEMENT_IN_FOREIGN_TERRITORY) int CvTraitEntry::GetYieldFromRouteMovementInForeignTerritory(YieldTypes eIndex, bool bTradePartner) const { - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex > -1, "Index out of bounds"); + ASSERT(eIndex < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromRouteMovementInForeignTerritory.find((int)eIndex); if (itYield != m_pbiYieldFromRouteMovementInForeignTerritory.end()) // find returns the iterator to map::end if the key eYield is not present in the map @@ -1697,10 +1697,10 @@ int CvTraitEntry::GetYieldFromRouteMovementInForeignTerritory(YieldTypes eIndex, int CvTraitEntry::GetBuildingClassYieldChanges(BuildingClassTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiBuildingClassYieldChanges ? m_ppiBuildingClassYieldChanges[eIndex1][eIndex2] : 0; } @@ -1745,62 +1745,62 @@ int CvTraitEntry::GetMusicYieldChanges(int i) const } int CvTraitEntry::GetSeaPlotYieldChanges(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piSeaPlotYieldChanges ? m_piSeaPlotYieldChanges[i] : 0; } int CvTraitEntry::GetFeatureYieldChanges(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiFeatureYieldChanges ? m_ppiFeatureYieldChanges[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetResourceYieldChanges(ResourceTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiResourceYieldChanges ? m_ppiResourceYieldChanges[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetTerrainYieldChanges(TerrainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumTerrainInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiTerrainYieldChanges ? m_ppiTerrainYieldChanges[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetYieldFromKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromKills ? m_piYieldFromKills[(int)eYield] : 0; } int CvTraitEntry::GetYieldFromBarbarianKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromBarbarianKills ? m_piYieldFromBarbarianKills[(int)eYield] : 0; } int CvTraitEntry::GetYieldFromMinorDemand(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromMinorDemand ? m_piYieldFromMinorDemand[(int)eYield] : 0; } int CvTraitEntry::GetYieldFromLuxuryResourceGain(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromLuxuryResourceGain ? m_piYieldFromLuxuryResourceGain[(int)eYield] : 0; } @@ -1816,85 +1816,85 @@ int CvTraitEntry::GetYieldChangeWorldWonder(int i) const int CvTraitEntry::GetTradeRouteYieldChange(DomainTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < NUM_DOMAIN_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < NUM_DOMAIN_TYPES, "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiTradeRouteYieldChange ? m_ppiTradeRouteYieldChange[eIndex1][eIndex2] : 0; } /// Accessor:: Extra yield from an improvement int CvTraitEntry::GetSpecialistYieldChanges(SpecialistTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiSpecialistYieldChanges ? m_ppiSpecialistYieldChanges[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetGreatPersonExpendedYield(GreatPersonTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiGreatPersonExpendedYield ? m_ppiGreatPersonExpendedYield[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetGreatPersonBornYield(GreatPersonTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumGreatPersonInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumGreatPersonInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiGreatPersonBornYield ? m_ppiGreatPersonBornYield[eIndex1][eIndex2] : 0; } int CvTraitEntry::GetGoldenAgeGreatPersonRateModifier(GreatPersonTypes eGreatPerson) const { - CvAssertMsg((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eGreatPerson > -1, "Index out of bounds"); + ASSERT((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eGreatPerson > -1, "Index out of bounds"); return m_piGoldenAgeGreatPersonRateModifier ? m_piGoldenAgeGreatPersonRateModifier[(int)eGreatPerson] : 0; } int CvTraitEntry::GetGreatPersonCostReduction(GreatPersonTypes eGreatPerson) const { - CvAssertMsg((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eGreatPerson > -1, "Index out of bounds"); + ASSERT((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eGreatPerson > -1, "Index out of bounds"); return m_piGreatPersonCostReduction ? m_piGreatPersonCostReduction[(int)eGreatPerson] : 0; } int CvTraitEntry::GetPerPuppetGreatPersonRateModifier(GreatPersonTypes eGreatPerson) const { - CvAssertMsg((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eGreatPerson > -1, "Index out of bounds"); + ASSERT((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eGreatPerson > -1, "Index out of bounds"); return m_piPerPuppetGreatPersonRateModifier ? m_piPerPuppetGreatPersonRateModifier[(int)eGreatPerson] : 0; } int CvTraitEntry::GetGreatPersonGWAM(GreatPersonTypes eGreatPerson) const { - CvAssertMsg((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eGreatPerson > -1, "Index out of bounds"); + ASSERT((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eGreatPerson > -1, "Index out of bounds"); return m_piGreatPersonGWAM ? m_piGreatPersonGWAM[(int)eGreatPerson] : 0; } int CvTraitEntry::GetGoldenAgeFromGreatPersonBirth(GreatPersonTypes eGreatPerson) const { - CvAssertMsg((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eGreatPerson > -1, "Index out of bounds"); + ASSERT((int)eGreatPerson < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eGreatPerson > -1, "Index out of bounds"); return m_piGoldenAgeFromGreatPersonBirth ? m_piGoldenAgeFromGreatPersonBirth[(int)eGreatPerson] : 0; } int CvTraitEntry::GetGreatPersonProgressFromPolicyUnlock(GreatPersonTypes eIndex) const { - CvAssertMsg((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eIndex > -1, "Index out of bounds"); + ASSERT((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eIndex > -1, "Index out of bounds"); return m_piGreatPersonProgressFromPolicyUnlock ? m_piGreatPersonProgressFromPolicyUnlock[(int)eIndex] : 0; } int CvTraitEntry::GetGreatPersonProgressFromKills(GreatPersonTypes eIndex) const { - CvAssertMsg((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eIndex > -1, "Index out of bounds"); + ASSERT((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eIndex > -1, "Index out of bounds"); std::map::const_iterator it = m_piGreatPersonProgressFromKills.find((int)eIndex); if (it != m_piGreatPersonProgressFromKills.end()) // find returns the iterator to map::end if the key eIndex is not present in the map @@ -1907,8 +1907,8 @@ int CvTraitEntry::GetGreatPersonProgressFromKills(GreatPersonTypes eIndex) const int CvTraitEntry::GetRandomGreatPersonProgressFromKills(GreatPersonTypes eIndex) const { - CvAssertMsg((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eIndex > -1, "Index out of bounds"); + ASSERT((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eIndex > -1, "Index out of bounds"); std::map::const_iterator it = m_piRandomGreatPersonProgressFromKills.find((int)eIndex); if (it != m_piRandomGreatPersonProgressFromKills.end()) // find returns the iterator to map::end if the key eIndex is not present in the map @@ -1921,28 +1921,28 @@ int CvTraitEntry::GetRandomGreatPersonProgressFromKills(GreatPersonTypes eIndex) int CvTraitEntry::GetCityYieldFromUnimprovedFeature(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiCityYieldFromUnimprovedFeature ? m_ppiCityYieldFromUnimprovedFeature[eIndex1][eIndex2] : 0; } /// Accessor:: Extra yield from an unimproved feature int CvTraitEntry::GetUnimprovedFeatureYieldChanges(FeatureTypes eIndex1, YieldTypes eIndex2) const { - CvAssertMsg(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); - CvAssertMsg(eIndex1 > -1, "Index out of bounds"); - CvAssertMsg(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex2 > -1, "Index out of bounds"); + ASSERT(eIndex1 < GC.getNumFeatureInfos(), "Index out of bounds"); + ASSERT(eIndex1 > -1, "Index out of bounds"); + ASSERT(eIndex2 < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex2 > -1, "Index out of bounds"); return m_ppiUnimprovedFeatureYieldChanges ? m_ppiUnimprovedFeatureYieldChanges[eIndex1][eIndex2] : 0; } /// Accessor:: Additional moves for a class of combat unit int CvTraitEntry::GetMovesChangeUnitCombat(const int unitCombatID) const { - CvAssertMsg((unitCombatID >= 0), "unitCombatID is less than zero"); - CvAssertMsg((unitCombatID < GC.getNumUnitCombatClassInfos()), "unitCombatID exceeds number of combat classes"); + ASSERT((unitCombatID >= 0), "unitCombatID is less than zero"); + ASSERT((unitCombatID < GC.getNumUnitCombatClassInfos()), "unitCombatID exceeds number of combat classes"); return m_piMovesChangeUnitCombats[unitCombatID]; } @@ -1950,22 +1950,22 @@ int CvTraitEntry::GetMovesChangeUnitCombat(const int unitCombatID) const /// Accessor:: Additional moves for a class of combat unit int CvTraitEntry::GetMovesChangeUnitClass(const int unitClassID) const { - CvAssertMsg((unitClassID >= 0), "unitCombatID is less than zero"); - CvAssertMsg((unitClassID < GC.getNumUnitClassInfos()), "unitCombatID exceeds number of combat classes"); + ASSERT((unitClassID >= 0), "unitCombatID is less than zero"); + ASSERT((unitClassID < GC.getNumUnitClassInfos()), "unitCombatID exceeds number of combat classes"); return m_piMovesChangeUnitClasses[unitClassID]; } int CvTraitEntry::GetGAPToYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiGAPToYield[i]; } int CvTraitEntry::GetMountainRangeYield(int i) const { - CvAssertMsg(i < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_paiMountainRangeYield[i]; } @@ -1974,8 +1974,8 @@ int CvTraitEntry::GetMountainRangeYield(int i) const /// Accessor:: Maintenance Modifier for a class of combat unit int CvTraitEntry::GetMaintenanceModifierUnitCombat(const int unitCombatID) const { - CvAssertMsg((unitCombatID >= 0), "unitCombatID is less than zero"); - CvAssertMsg((unitCombatID < GC.getNumUnitCombatClassInfos()), "unitCombatID exceeds number of combat classes"); + ASSERT((unitCombatID >= 0), "unitCombatID is less than zero"); + ASSERT((unitCombatID < GC.getNumUnitCombatClassInfos()), "unitCombatID exceeds number of combat classes"); return m_piMaintenanceModifierUnitCombats[unitCombatID]; } @@ -2090,8 +2090,8 @@ bool CvTraitEntry::IsFreePromotionUnitClass(const int promotionID, const int uni /// Accessor:: Does the civ have a golden age modifier for the yield type? int CvTraitEntry::GetGoldenAgeYieldModifier(const int iYield) const { - CvAssertMsg(iYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(iYield > -1, "Index out of bounds"); + ASSERT(iYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(iYield > -1, "Index out of bounds"); std::map::const_iterator it = m_piGoldenAgeYieldModifier.find(iYield); if (it != m_piGoldenAgeYieldModifier.end()) // find returns the iterator to map::end if the key iYield is not present in the map @@ -2125,8 +2125,8 @@ bool CvTraitEntry::UnitClassCanBuild(const int buildID, const int unitClassID) c /// Accessor:: Does the civ have a production cost modifier for the unit combat type? And is it only granted during golden ages? std::pair CvTraitEntry::GetUnitCombatProductionCostModifier(const int unitCombatID) const { - CvAssertMsg(unitCombatID >= 0, "unitCombatID expected to be >= 0"); - CvAssertMsg(unitCombatID < GC.getNumUnitCombatClassInfos(), "unitCombatID expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(unitCombatID >= 0, "unitCombatID expected to be >= 0"); + ASSERT(unitCombatID < GC.getNumUnitCombatClassInfos(), "unitCombatID expected to be < GC.getNumUnitCombatInfos()"); std::map>::const_iterator it = m_pibUnitCombatProductionCostModifier.find(unitCombatID); if (it != m_pibUnitCombatProductionCostModifier.end()) // find returns the iterator to map::end if the key iYield is not present in the map @@ -2153,8 +2153,8 @@ bool CvTraitEntry::IsNoBuild(BuildTypes eBuild) const /// Accessor:: Does the civ have a production modifier for domain type per worked specialist? int CvTraitEntry::GetDomainProductionModifiersPerSpecialist(DomainTypes eDomain) const { - CvAssertMsg(eDomain >= 0, "domainID expected to be >= 0"); - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "domainID expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eDomain >= 0, "domainID expected to be >= 0"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "domainID expected to be < NUM_DOMAIN_TYPES"); std::map::const_iterator it = m_piDomainProductionModifiersPerSpecialist.find(eDomain); if (it != m_piDomainProductionModifiersPerSpecialist.end()) // find returns the iterator to map::end if the key eDomain is not present @@ -2673,7 +2673,7 @@ bool CvTraitEntry::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int iTerrainID = pResults->GetInt("TerrainID"); - CvAssert(iTerrainID > -1 && iTerrainID < iNumTerrains); + ASSERT(iTerrainID > -1 && iTerrainID < iNumTerrains); const int iStrategicResourceQuantityModifier = pResults->GetInt("StrategicResourceQuantityModifier"); m_piStrategicResourceQuantityModifier[iTerrainID] = iStrategicResourceQuantityModifier; @@ -2751,7 +2751,7 @@ bool CvTraitEntry::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int iUnitCombatID = pResults->GetInt(0); - CvAssert(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); + ASSERT(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); const int iMovesChange = pResults->GetInt(1); m_piMovesChangeUnitCombats[iUnitCombatID] = iMovesChange; @@ -2957,7 +2957,7 @@ bool CvTraitEntry::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int iUnitClassID = pResults->GetInt(0); -// CvAssert(iUnitCombatID > -1 && iUnitCombatID < iNumUnitClasses); +// ASSERT(iUnitCombatID > -1 && iUnitCombatID < iNumUnitClasses); const int iMovesChange = pResults->GetInt(1); m_piMovesChangeUnitClasses[iUnitClassID] = iMovesChange; @@ -3201,7 +3201,7 @@ bool CvTraitEntry::CacheResults(Database::Results& kResults, CvDatabaseUtility& while(pResults->Step()) { const int iUnitCombatID = pResults->GetInt(0); - CvAssert(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); + ASSERT(iUnitCombatID > -1 && iUnitCombatID < iNumUnitCombatClasses); const int iMaintenanceModifier = pResults->GetInt(1); m_piMaintenanceModifierUnitCombats[iUnitCombatID] = iMaintenanceModifier; @@ -5066,7 +5066,7 @@ void CvPlayerTraits::InitPlayerTraits() } } - CvAssert(GC.getNumTerrainInfos() <= NUM_TERRAIN_TYPES); + ASSERT(GC.getNumTerrainInfos() <= NUM_TERRAIN_TYPES); for(int iTerrain = 0; iTerrain < GC.getNumTerrainInfos(); iTerrain++) { m_iStrategicResourceQuantityModifier[iTerrain] = trait->GetStrategicResourceQuantityModifier(iTerrain); @@ -5674,7 +5674,7 @@ void CvPlayerTraits::Reset() m_aFreeTraitUnits.clear(); int iNumUnitCombatClassInfos = GC.getNumUnitCombatClassInfos(); - CvAssertMsg((0 < iNumUnitCombatClassInfos), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvPlayerTraits::Reset"); + ASSERT((0 < iNumUnitCombatClassInfos), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvPlayerTraits::Reset"); m_paiMovesChangeUnitCombat.clear(); m_paiMaintenanceModifierUnitCombat.clear(); m_paiMovesChangeUnitCombat.resize(iNumUnitCombatClassInfos); @@ -5754,12 +5754,12 @@ void CvPlayerTraits::Reset() /// Does this player possess a specific trait? bool CvPlayerTraits::HasTrait(TraitTypes eTrait) const { - CvAssert(m_pPlayer); + ASSERT(m_pPlayer); if(m_pPlayer != NULL) { - CvAssertMsg((m_pPlayer->getLeaderType() >= 0), "getLeaderType() is less than zero"); - CvAssertMsg((eTrait >= 0), "eTrait is less than zero"); + ASSERT((m_pPlayer->getLeaderType() >= 0), "getLeaderType() is less than zero"); + ASSERT((eTrait >= 0), "eTrait is less than zero"); #if defined(MOD_TRAITS_OTHER_PREREQS) TeamTypes eTeam = m_pPlayer->getTeam(); PlayerTypes ePlayer = m_pPlayer->GetID(); @@ -5837,8 +5837,8 @@ bool CvPlayerTraits::WillGetUniqueLuxury(CvArea *pArea) const /// Instant great person progress when killing enemy units int CvPlayerTraits::GetGreatPersonProgressFromKills(GreatPersonTypes eIndex) const { - CvAssertMsg((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); - CvAssertMsg((int)eIndex > -1, "Index out of bounds"); + ASSERT((int)eIndex < GC.getNumGreatPersonInfos(), "Yield type out of bounds"); + ASSERT((int)eIndex > -1, "Index out of bounds"); std::map::const_iterator it = m_aiGreatPersonProgressFromKills.find((int)eIndex); if (it != m_aiGreatPersonProgressFromKills.end()) // find returns the iterator to map::end if the key eIndex is not present in the map @@ -5885,7 +5885,7 @@ std::pair CvPlayerTraits::GetRandomGreatPersonProgressFro /// Bonus movement for this combat class int CvPlayerTraits::GetMovesChangeUnitCombat(const int unitCombatID) const { - CvAssertMsg(unitCombatID < GC.getNumUnitCombatClassInfos(), "Invalid unitCombatID parameter in call to CvPlayerTraits::GetMovesChangeUnitCombat()"); + ASSERT(unitCombatID < GC.getNumUnitCombatClassInfos(), "Invalid unitCombatID parameter in call to CvPlayerTraits::GetMovesChangeUnitCombat()"); if(unitCombatID == NO_UNITCLASS) { @@ -5898,7 +5898,7 @@ int CvPlayerTraits::GetMovesChangeUnitCombat(const int unitCombatID) const /// Bonus movement for this unit class int CvPlayerTraits::GetMovesChangeUnitClass(const int unitClassID) const { - CvAssertMsg(unitClassID < GC.getNumUnitClassInfos(), "Invalid unitClassID parameter in call to CvPlayerTraits::GetMovesChangeUnitClass()"); + ASSERT(unitClassID < GC.getNumUnitClassInfos(), "Invalid unitClassID parameter in call to CvPlayerTraits::GetMovesChangeUnitClass()"); if(unitClassID == NO_UNITCLASS) { @@ -5912,7 +5912,7 @@ int CvPlayerTraits::GetMovesChangeUnitClass(const int unitClassID) const /// Maintenance modifier for this combat class int CvPlayerTraits::GetMaintenanceModifierUnitCombat(const int unitCombatID) const { - CvAssertMsg(unitCombatID < GC.getNumUnitCombatClassInfos(), "Invalid unitCombatID parameter in call to CvPlayerTraits::GetMaintenanceModifierUnitCombat()"); + ASSERT(unitCombatID < GC.getNumUnitCombatClassInfos(), "Invalid unitCombatID parameter in call to CvPlayerTraits::GetMaintenanceModifierUnitCombat()"); if(unitCombatID == NO_UNITCLASS) { @@ -5925,8 +5925,8 @@ int CvPlayerTraits::GetMaintenanceModifierUnitCombat(const int unitCombatID) con /// Extra yield from this improvement int CvPlayerTraits::GetImprovementYieldChange(ImprovementTypes eImprovement, YieldTypes eYield) const { - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetImprovementYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetImprovementYieldChange()"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetImprovementYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetImprovementYieldChange()"); if(eImprovement == NO_IMPROVEMENT) { @@ -5937,8 +5937,8 @@ int CvPlayerTraits::GetImprovementYieldChange(ImprovementTypes eImprovement, Yie } int CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType()"); if(eTerrain == NO_TERRAIN) { @@ -5949,8 +5949,8 @@ int CvPlayerTraits::GetYieldChangeFromTileEarnTerrainType(TerrainTypes eTerrain, #if defined(MOD_BALANCE_CORE) int CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType()"); if (eTerrain == NO_TERRAIN) { @@ -5960,8 +5960,8 @@ int CvPlayerTraits::GetYieldChangeFromTilePurchaseTerrainType(TerrainTypes eTerr } int CvPlayerTraits::GetYieldChangeFromTileConquest(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileConquest()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileConquest()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileConquest()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileConquest()"); if (eTerrain == NO_TERRAIN) { @@ -5971,8 +5971,8 @@ int CvPlayerTraits::GetYieldChangeFromTileConquest(TerrainTypes eTerrain, YieldT } int CvPlayerTraits::GetYieldChangeFromTileCultureBomb(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileCultureBomb()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileCultureBomb()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileCultureBomb()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileCultureBomb()"); if (eTerrain == NO_TERRAIN) { @@ -5982,8 +5982,8 @@ int CvPlayerTraits::GetYieldChangeFromTileCultureBomb(TerrainTypes eTerrain, Yie } int CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb()"); if (eTerrain == NO_TERRAIN) { @@ -5993,8 +5993,8 @@ int CvPlayerTraits::GetYieldChangeFromTileStealCultureBomb(TerrainTypes eTerrain } int CvPlayerTraits::GetYieldChangeFromTileSettle(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileSettle()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileSettle()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetYieldChangeFromTileSettle()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangeFromTileSettle()"); if (eTerrain == NO_TERRAIN) { @@ -6004,8 +6004,8 @@ int CvPlayerTraits::GetYieldChangeFromTileSettle(TerrainTypes eTerrain, YieldTyp } int CvPlayerTraits::GetYieldChangePerImprovementBuilt(ImprovementTypes eImprovement, YieldTypes eYield) const { - CvAssertMsg(eImprovement < GC.getNumImprovementInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetYieldChangePerImprovementBuilt()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangePerImprovementBuilt()"); + ASSERT(eImprovement < GC.getNumImprovementInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetYieldChangePerImprovementBuilt()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldChangePerImprovementBuilt()"); if (eImprovement == NO_IMPROVEMENT) { @@ -6039,7 +6039,7 @@ void CvPlayerTraits::UpdateYieldChangeImprovementTypes() int CvPlayerTraits::GetYieldFromBarbarianCampClear(YieldTypes eYield, bool bEraScaling) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldFromBarbarianCampClear()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetYieldFromBarbarianCampClear()"); std::map>::const_iterator itYield = m_pbiYieldFromBarbarianCampClear.find((int)eYield); if (itYield != m_pbiYieldFromBarbarianCampClear.end()) // find returns the iterator to map::end if the key eYield is not present in the map @@ -6059,8 +6059,8 @@ int CvPlayerTraits::GetYieldFromBarbarianCampClear(YieldTypes eYield, bool bEraS #if defined(MOD_BALANCE_CORE) && defined(MOD_TRAITS_YIELD_FROM_ROUTE_MOVEMENT_IN_FOREIGN_TERRITORY) int CvPlayerTraits::GetYieldFromRouteMovementInForeignTerritory(YieldTypes eIndex, bool bTradePartner) const { - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eIndex > -1, "Index out of bounds"); + ASSERT(eIndex < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eIndex > -1, "Index out of bounds"); std::map>::const_iterator itYield = m_pbiYieldFromRouteMovementInForeignTerritory.find((int)eIndex); if (itYield != m_pbiYieldFromRouteMovementInForeignTerritory.end()) // find returns the iterator to map::end if the key eYield is not present in the map @@ -6079,16 +6079,16 @@ int CvPlayerTraits::GetYieldFromRouteMovementInForeignTerritory(YieldTypes eInde /// Extra yield from this plot int CvPlayerTraits::GetPlotYieldChange(PlotTypes ePlot, YieldTypes eYield) const { - CvAssertMsg(ePlot < GC.getNumPlotInfos(), "Invalid ePlot parameter in call to CvPlayerTraits::GetPlotYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetPlotYieldChange()"); + ASSERT(ePlot < GC.getNumPlotInfos(), "Invalid ePlot parameter in call to CvPlayerTraits::GetPlotYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetPlotYieldChange()"); return m_ppiPlotYieldChange[(int)ePlot][(int)eYield]; } int CvPlayerTraits::GetBuildingClassYieldChange(BuildingClassTypes eBuildingClass, YieldTypes eYield) const { - CvAssertMsg(eBuildingClass < GC.getNumBuildingClassInfos(), "Invalid eBuildingClass parameter in call to CvPlayerTraits::GetBuildingClassYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetBuildingClassYieldChange()"); + ASSERT(eBuildingClass < GC.getNumBuildingClassInfos(), "Invalid eBuildingClass parameter in call to CvPlayerTraits::GetBuildingClassYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetBuildingClassYieldChange()"); if(eBuildingClass == NO_BUILDINGCLASS) { @@ -6100,61 +6100,61 @@ int CvPlayerTraits::GetBuildingClassYieldChange(BuildingClassTypes eBuildingClas int CvPlayerTraits::GetFeatureYieldChange(FeatureTypes eFeature, YieldTypes eYield) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Invalid eFeature parameter in call to CvPlayerTraits::GetFeatureYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetFeatureYieldChange()"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Invalid eFeature parameter in call to CvPlayerTraits::GetFeatureYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetFeatureYieldChange()"); return m_ppiFeatureYieldChange[(int)eFeature][(int)eYield]; } int CvPlayerTraits::GetResourceYieldChange(ResourceTypes eResource, YieldTypes eYield) const { - CvAssertMsg(eResource < GC.getNumResourceInfos(), "Invalid eResource parameter in call to CvPlayerTraits::GetResourceYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetResourceYieldChange()"); + ASSERT(eResource < GC.getNumResourceInfos(), "Invalid eResource parameter in call to CvPlayerTraits::GetResourceYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetResourceYieldChange()"); return m_ppiResourceYieldChange[(int)eResource][(int)eYield]; } int CvPlayerTraits::GetTerrainYieldChange(TerrainTypes eTerrain, YieldTypes eYield) const { - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetTerrainYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetTerrainYieldChange()"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "Invalid eTerrain parameter in call to CvPlayerTraits::GetTerrainYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetTerrainYieldChange()"); return m_ppiTerrainYieldChange[(int)eTerrain][(int)eYield]; } int CvPlayerTraits::GetYieldFromKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_iYieldFromKills[(int)eYield]; } int CvPlayerTraits::GetYieldFromBarbarianKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_iYieldFromBarbarianKills[(int)eYield]; } int CvPlayerTraits::GetYieldFromMinorDemand(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_iYieldFromMinorDemand[(int)eYield]; } int CvPlayerTraits::GetYieldFromLuxuryResourceGain(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_iYieldFromLuxuryResourceGain[(int)eYield]; } /// Extra yield from this specialist int CvPlayerTraits::GetTradeRouteYieldChange(DomainTypes eDomain, YieldTypes eYield) const { - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "Invalid eDomain parameter in call to CvPlayerTraits::GetDomainYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetDomainYieldChange()"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "Invalid eDomain parameter in call to CvPlayerTraits::GetDomainYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetDomainYieldChange()"); if(eDomain == NO_DOMAIN) { @@ -6167,8 +6167,8 @@ int CvPlayerTraits::GetTradeRouteYieldChange(DomainTypes eDomain, YieldTypes eYi /// Extra yield from this specialist int CvPlayerTraits::GetSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield) const { - CvAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "Invalid eSpecialist parameter in call to CvPlayerTraits::GetSpecialistYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetSpecialistYieldChange()"); + ASSERT(eSpecialist < GC.getNumSpecialistInfos(), "Invalid eSpecialist parameter in call to CvPlayerTraits::GetSpecialistYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetSpecialistYieldChange()"); if(eSpecialist == NO_SPECIALIST) { @@ -6202,8 +6202,8 @@ int CvPlayerTraits::GetSpecialistYieldChange(SpecialistTypes eSpecialist, YieldT int CvPlayerTraits::GetGreatPersonExpendedYield(GreatPersonTypes eGreatPerson, YieldTypes eYield) const { - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "Invalid eGreatPerson parameter in call to CvPlayerTraits::GetGreatPersonExpendedYield()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetGreatPersonExpendedYield()"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "Invalid eGreatPerson parameter in call to CvPlayerTraits::GetGreatPersonExpendedYield()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetGreatPersonExpendedYield()"); if(eGreatPerson == NO_GREATPERSON) { @@ -6214,8 +6214,8 @@ int CvPlayerTraits::GetGreatPersonExpendedYield(GreatPersonTypes eGreatPerson, Y } int CvPlayerTraits::GetGreatPersonBornYield(GreatPersonTypes eGreatPerson, YieldTypes eYield) const { - CvAssertMsg(eGreatPerson < GC.getNumGreatPersonInfos(), "Invalid eGreatPerson parameter in call to CvPlayerTraits::GetGreatPersonBornYield()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetGreatPersonBornYield()"); + ASSERT(eGreatPerson < GC.getNumGreatPersonInfos(), "Invalid eGreatPerson parameter in call to CvPlayerTraits::GetGreatPersonBornYield()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetGreatPersonBornYield()"); if(eGreatPerson == NO_GREATPERSON) { @@ -6227,8 +6227,8 @@ int CvPlayerTraits::GetGreatPersonBornYield(GreatPersonTypes eGreatPerson, Yield int CvPlayerTraits::GetCityYieldFromUnimprovedFeature(FeatureTypes eFeature, YieldTypes eYield) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetCityYieldFromUnimprovedFeature()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetCityYieldFromUnimprovedFeature()"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetCityYieldFromUnimprovedFeature()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetCityYieldFromUnimprovedFeature()"); if(eFeature == NO_FEATURE) { @@ -6241,8 +6241,8 @@ int CvPlayerTraits::GetCityYieldFromUnimprovedFeature(FeatureTypes eFeature, Yie /// Extra yield from a feature without improvement int CvPlayerTraits::GetUnimprovedFeatureYieldChange(FeatureTypes eFeature, YieldTypes eYield) const { - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetUnimprovedFeatureYieldChange()"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetUnimprovedFeatureYieldChange()"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "Invalid eImprovement parameter in call to CvPlayerTraits::GetUnimprovedFeatureYieldChange()"); + ASSERT(eYield < NUM_YIELD_TYPES, "Invalid eYield parameter in call to CvPlayerTraits::GetUnimprovedFeatureYieldChange()"); if(eFeature == NO_FEATURE) { @@ -6255,7 +6255,7 @@ int CvPlayerTraits::GetUnimprovedFeatureYieldChange(FeatureTypes eFeature, Yield /// Do all new units get a specific promotion? bool CvPlayerTraits::HasFreePromotionUnitCombat(const int promotionID, const int unitCombatID) const { - CvAssertMsg((promotionID >= 0), "promotionID is less than zero"); + ASSERT((promotionID >= 0), "promotionID is less than zero"); for(size_t iI = 0; iI < m_vPotentiallyActiveLeaderTraits.size(); iI++) { CvTraitEntry* pkTraitInfo = GC.getTraitInfo(m_vPotentiallyActiveLeaderTraits[iI]); @@ -6274,7 +6274,7 @@ bool CvPlayerTraits::HasFreePromotionUnitCombat(const int promotionID, const int /// Does this player have units that have a special upgrade path? bool CvPlayerTraits::HasSpecialUnitUpgrade(const int unitClassID, const int unitID) const { - CvAssertMsg((unitClassID >= 0), "unitClassID is less than zero"); + ASSERT((unitClassID >= 0), "unitClassID is less than zero"); for (size_t iI = 0; iI < m_vPotentiallyActiveLeaderTraits.size(); iI++) { CvTraitEntry* pkTraitInfo = GC.getTraitInfo(m_vPotentiallyActiveLeaderTraits[iI]); @@ -6292,7 +6292,7 @@ bool CvPlayerTraits::HasSpecialUnitUpgrade(const int unitClassID, const int unit /// Do all new units of a certain class get a specific promotion? bool CvPlayerTraits::HasFreePromotionUnitClass(const int promotionID, const int unitClassID) const { - CvAssertMsg((promotionID >= 0), "promotionID is less than zero"); + ASSERT((promotionID >= 0), "promotionID is less than zero"); for(size_t iI = 0; iI < m_vPotentiallyActiveLeaderTraits.size(); iI++) { CvTraitEntry* pkTraitInfo = GC.getTraitInfo(m_vPotentiallyActiveLeaderTraits[iI]); @@ -6310,7 +6310,7 @@ bool CvPlayerTraits::HasFreePromotionUnitClass(const int promotionID, const int /// Do all new units of a certain class get a specific promotion? bool CvPlayerTraits::HasUnitClassCanBuild(const int buildID, const int unitClassID) const { - CvAssertMsg((buildID >= 0), "buildID is less than zero"); + ASSERT((buildID >= 0), "buildID is less than zero"); for(size_t iI = 0; iI < m_vPotentiallyActiveLeaderTraits.size(); iI++) { CvTraitEntry* pkTraitInfo = GC.getTraitInfo(m_vPotentiallyActiveLeaderTraits[iI]); @@ -6328,8 +6328,8 @@ bool CvPlayerTraits::HasUnitClassCanBuild(const int buildID, const int unitClass /// What is the golden age modifier for the specific yield type? int CvPlayerTraits::GetGoldenAgeYieldModifier(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Index out of bounds"); - CvAssertMsg(eYield > -1, "Index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Index out of bounds"); + ASSERT(eYield > -1, "Index out of bounds"); std::map::const_iterator it = m_aiGoldenAgeYieldModifier.find((int)eYield); if (it != m_aiGoldenAgeYieldModifier.end()) // find returns the iterator to map::end if the key is not present @@ -6342,8 +6342,8 @@ int CvPlayerTraits::GetGoldenAgeYieldModifier(YieldTypes eYield) const /// What is the production cost modifier for the unit combat type? And does it only work during golden ages? std::pair CvPlayerTraits::GetUnitCombatProductionCostModifier(UnitCombatTypes eUnitCombat) const { - CvAssertMsg(eUnitCombat >= 0, "unitCombatID expected to be >= 0"); - CvAssertMsg(eUnitCombat < GC.getNumUnitCombatClassInfos(), "unitCombatID expected to be < GC.getNumUnitCombatInfos()"); + ASSERT(eUnitCombat >= 0, "unitCombatID expected to be >= 0"); + ASSERT(eUnitCombat < GC.getNumUnitCombatClassInfos(), "unitCombatID expected to be < GC.getNumUnitCombatInfos()"); std::map>::const_iterator it = m_aibUnitCombatProductionCostModifier.find((int)eUnitCombat); if (it != m_aibUnitCombatProductionCostModifier.end()) // find returns the iterator to map::end if the key is not present @@ -6356,8 +6356,8 @@ std::pair CvPlayerTraits::GetUnitCombatProductionCostModifier(UnitCom /// Is this build blocked for this civ? bool CvPlayerTraits::IsNoBuild(BuildTypes eBuild) const { - CvAssertMsg(eBuild >= 0, "buildID expected to be >= 0"); - CvAssertMsg(eBuild < GC.getNumBuildInfos(), "buildID expected to be < GC.getNumBuildInfos()"); + ASSERT(eBuild >= 0, "buildID expected to be >= 0"); + ASSERT(eBuild < GC.getNumBuildInfos(), "buildID expected to be < GC.getNumBuildInfos()"); std::vector::const_iterator it = find(m_aiNoBuilds.begin(), m_aiNoBuilds.end(), (int)eBuild); @@ -6366,8 +6366,8 @@ bool CvPlayerTraits::IsNoBuild(BuildTypes eBuild) const /// What is the production modifier for the domain type for each worked specialist? int CvPlayerTraits::GetDomainProductionModifiersPerSpecialist(DomainTypes eDomain) const { - CvAssertMsg(eDomain >= 0, "domainID expected to be >= 0"); - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "domainID expected to be < NUM_DOMAIN_TYPES"); + ASSERT(eDomain >= 0, "domainID expected to be >= 0"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "domainID expected to be < NUM_DOMAIN_TYPES"); std::map::const_iterator it = m_aiDomainProductionModifiersPerSpecialist.find((int)eDomain); if (it != m_aiDomainProductionModifiersPerSpecialist.end()) // find returns the iterator to map::end if the key is not present @@ -7792,7 +7792,7 @@ bool CvPlayerTraits::ConvertBarbarianCamp(CvUnit* pByUnit, CvPlot* pPlot) pPlot->SetPlayerThatClearedBarbCampHere(m_pPlayer->GetID()); // Convert the barbarian into our unit - FAssertMsg(m_eCampGuardType < GC.getNumUnitInfos(), "Illegal camp guard unit type"); + ASSERT(m_eCampGuardType < GC.getNumUnitInfos(), "Illegal camp guard unit type"); pGiftUnit = m_pPlayer->initUnit(m_eCampGuardType, pPlot->getX(), pPlot->getY(), NO_UNITAI, REASON_CONVERT, true /*bNoMove*/); if (!pGiftUnit->jumpToNearestValidPlot()) pGiftUnit->kill(false); @@ -7871,7 +7871,7 @@ bool CvPlayerTraits::ConvertBarbarianNavalUnit(CvUnit* pByUnit, CvUnit* pUnit) // Convert the barbarian into our unit pGiftUnit = m_pPlayer->initUnit(pUnit->getUnitType(), pUnit->getX(), pUnit->getY(), pUnit->AI_getUnitAIType(), REASON_CONVERT, true /*bNoMove*/, false); - CvAssertMsg(pGiftUnit, "GiftUnit is not assigned a valid value"); + ASSERT(pGiftUnit, "GiftUnit is not assigned a valid value"); pGiftUnit->convert(pUnit, false); pGiftUnit->setupGraphical(); pGiftUnit->finishMoves(); // No move first turn diff --git a/CvGameCoreDLL_Expansion2/CvTreasury.cpp b/CvGameCoreDLL_Expansion2/CvTreasury.cpp index dbd94e0de2..8cf0996897 100644 --- a/CvGameCoreDLL_Expansion2/CvTreasury.cpp +++ b/CvGameCoreDLL_Expansion2/CvTreasury.cpp @@ -154,7 +154,7 @@ void CvTreasury::SetGoldTimes100(int iNewValue) { if(iNewValue < 0) { - CvAssertMsg(false, "GAMEPLAY: Player is being set to a negative Gold value. Please send Jon this with your last 5 autosaves."); + ASSERT(false, "GAMEPLAY: Player is being set to a negative Gold value."); } m_iGold = max(0,iNewValue); @@ -733,7 +733,7 @@ void CvTreasury::ChangeBaseImprovementGoldMaintenance(int iChange) /// Average change in gold balance over N turns int CvTreasury::AverageIncome100(int iTurns) { - CvAssertMsg(iTurns > 0, "Invalid number of turns parameter"); + ASSERT(iTurns > 0, "Invalid number of turns parameter"); if(m_GoldChangeForTurnTimes100.size() > 0) { diff --git a/CvGameCoreDLL_Expansion2/CvTypes.cpp b/CvGameCoreDLL_Expansion2/CvTypes.cpp index 34fa3af637..2c94e2b90f 100644 --- a/CvGameCoreDLL_Expansion2/CvTypes.cpp +++ b/CvGameCoreDLL_Expansion2/CvTypes.cpp @@ -147,7 +147,7 @@ void CvTypes::AcquireTypes(Database::Connection& db) sprintf_s(msg, "ArtifactType - %s is used in the DLL but does not exist in the database.", it->first.c_str()); FILogFile* pLog = LOGFILEMGR.GetLog("Gamecore.log", FILogFile::kDontTimeStamp); pLog->WarningMsg(msg); - CvAssertMsg(false, msg); + ASSERT(false, msg); } } } @@ -276,7 +276,7 @@ void CvTypes::AcquireTypes(Database::Connection& db) sprintf_s(msg, "MissionType - %s is used in the DLL but does not exist in the database.", it->first.c_str()); FILogFile* pLog = LOGFILEMGR.GetLog("Gamecore.log", FILogFile::kDontTimeStamp); pLog->WarningMsg(msg); - CvAssertMsg(false, msg); + ASSERT(false, msg); } } } diff --git a/CvGameCoreDLL_Expansion2/CvUnit.cpp b/CvGameCoreDLL_Expansion2/CvUnit.cpp index f10c23e3ab..f445f6b2e8 100644 --- a/CvGameCoreDLL_Expansion2/CvUnit.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnit.cpp @@ -562,7 +562,7 @@ void CvUnit::initWithNameOffset(int iID, UnitTypes eUnit, int iNameOffset, UnitA int iUnitName = 0; int iI = 0; - CvAssert(NO_UNIT != eUnit); + ASSERT(NO_UNIT != eUnit); m_Promotions.Init(); m_Religion.Init(); @@ -1268,7 +1268,7 @@ void CvUnit::initWithNameOffset(int iID, UnitTypes eUnit, int iNameOffset, UnitA } } CvPlayer* pPlayer = &GET_PLAYER(getOwner()); - CvAssertMsg(pPlayer, "Owner of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pPlayer, "Owner of unit not expected to be NULL."); if (pPlayer) { int iGATurnsfromGPBirth = pPlayer->GetPlayerTraits()->GetGoldenAgeFromGreatPersonBirth(GetGreatPersonFromUnitClass(getUnitClassType())); // Get number of GA turns as defined in table Trait_GoldenAgeFromGreatPersonBirth for this GP type @@ -1794,7 +1794,7 @@ void CvUnit::reset(int iID, UnitTypes eUnit, PlayerTypes eOwner, bool bConstruct m_aiNumTimesAttackedThisTurn[iI] = 0; } - CvAssertMsg((0 < GC.getNumUnitCombatClassInfos()), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvUnit::reset"); + ASSERT((0 < GC.getNumUnitCombatClassInfos()), "GC.getNumUnitCombatClassInfos() is not greater than zero but an array is being allocated in CvUnit::reset"); m_extraUnitCombatModifier.clear(); m_extraUnitCombatModifier.resize(GC.getNumUnitCombatClassInfos()); #if defined(MOD_BALANCE_CORE) @@ -1939,7 +1939,7 @@ void CvUnit::uninitInfos() bool CvUnit::IsRetainablePromotion(PromotionTypes ePromotion) { CvPromotionEntry* pkPromotionInfo = GC.getPromotionInfo(ePromotion); - CvAssert(pkPromotionInfo); + ASSERT(pkPromotionInfo); if (pkPromotionInfo) { if (pkPromotionInfo->IsEmbarkedDeepWater()) @@ -2267,7 +2267,7 @@ void CvUnit::kill(bool bDelay, PlayerTypes ePlayer /*= NO_PLAYER*/) ClearMissionQueue(); pPlot = plot(); - CvAssertMsg(pPlot != NULL, "Plot is not assigned a valid value"); + ASSERT(pPlot != NULL, "Plot is not assigned a valid value"); if(pPlot) { @@ -2663,7 +2663,7 @@ void CvUnit::kill(bool bDelay, PlayerTypes ePlayer /*= NO_PLAYER*/) // Killing a unit while in combat is not something we really expect to happen. // It is *mostly* safe for it to happen, but combat systems must be able to gracefully handle the disapperance of a unit. - CvAssertMsg_Debug(!isInCombat(), "isCombat did not return false as expected"); + CvAssert_Debug(!isInCombat(), "isCombat did not return false as expected"); clearCombat(); // Disconnect from any combat @@ -2688,8 +2688,8 @@ void CvUnit::kill(bool bDelay, PlayerTypes ePlayer /*= NO_PLAYER*/) setReconPlot(NULL); - CvAssertMsg(getAttackPlot() == NULL, "The current unit instance's attack plot is expected to be NULL"); - CvAssertMsg(getCombatUnit() == NULL, "The current unit instance's combat unit is expected to be NULL"); + ASSERT(getAttackPlot() == NULL, "The current unit instance's attack plot is expected to be NULL"); + ASSERT(getCombatUnit() == NULL, "The current unit instance's combat unit is expected to be NULL"); GET_TEAM(getTeam()).changeUnitClassCount((UnitClassTypes)getUnitInfo().GetUnitClassType(), -1); GET_PLAYER(eUnitOwner).changeUnitClassCount((UnitClassTypes)getUnitInfo().GetUnitClassType(), -1); @@ -3199,7 +3199,7 @@ bool CvUnit::getCaptureDefinition(CvUnitCaptureDefinition* pkCaptureDef, PlayerT void CvUnit::doTurn() { VALIDATE_OBJECT - CvAssertMsg(!IsDead(), "isDead did not return false as expected"); + ASSERT(!IsDead(), "isDead did not return false as expected"); // Wake unit if skipped last turn ActivityTypes eActivityType = GetActivityType(); @@ -3385,8 +3385,8 @@ bool CvUnit::isActionRecommended(int iAction) if(GC.getActionInfo(iAction)->getMissionType() == CvTypes::getMISSION_BUILD()) { eBuild = ((BuildTypes)(GC.getActionInfo(iAction)->getMissionData())); - CvAssert(eBuild != NO_BUILD); - CvAssertMsg(eBuild < GC.getNumBuildInfos(), "Invalid Build"); + ASSERT(eBuild != NO_BUILD); + ASSERT(eBuild < GC.getNumBuildInfos(), "Invalid Build"); vector directives = GET_PLAYER(getOwner()).GetBuilderTaskingAI()->GetDirectives(); @@ -4619,7 +4619,7 @@ bool CvUnit::canDoCommand(CommandTypes eCommand, int iData1, int iData2, bool bT break; default: - CvAssert(false); + ASSERT(false); break; } @@ -4686,7 +4686,7 @@ void CvUnit::doCommand(CommandTypes eCommand, int iData1, int iData2) break; default: - CvAssert(false); + ASSERT(false); break; } } @@ -4901,7 +4901,7 @@ bool CvUnit::canEnterTerrain(const CvPlot& enterPlot, int iMoveFlags) const TeamTypes CvUnit::GetDeclareWarMove(const CvPlot& plot) const { VALIDATE_OBJECT - CvAssert(isHuman()); + ASSERT(isHuman()); if (getDomainType() != DOMAIN_AIR) { @@ -5003,7 +5003,7 @@ TeamTypes CvUnit::GetDeclareWarMove(const CvPlot& plot) const TeamTypes CvUnit::GetDeclareWarRangeStrike(const CvPlot& plot) const { VALIDATE_OBJECT - CvAssert(isHuman()); + ASSERT(isHuman()); if (plot.isActiveVisible()) { @@ -5203,7 +5203,7 @@ bool CvUnit::canMoveInto(const CvPlot& plot, int iMoveFlags) const while(pUnitNode != NULL) { pLoopUnit = ::GetPlayerUnit(*pUnitNode); - CvAssertMsg(pLoopUnit, "pUnitNode data should lead to a unit"); + ASSERT(pLoopUnit, "pUnitNode data should lead to a unit"); pUnitNode = plot.nextUnitNode(pUnitNode); @@ -5401,10 +5401,10 @@ int CvUnit::getCombatDamage(int iStrength, int iOpponentStrength, bool bIncludeR void CvUnit::move(CvPlot& targetPlot, bool bShow) { VALIDATE_OBJECT - CvAssert(canMoveOrAttackInto(targetPlot) || isOutOfAttacks()); + ASSERT(canMoveOrAttackInto(targetPlot) || isOutOfAttacks()); CvPlot* pOldPlot = plot(); - CvAssertMsg(pOldPlot, "pOldPlot needs to have a value"); + ASSERT(pOldPlot, "pOldPlot needs to have a value"); //will never be more than we have left! int iMoveCost = targetPlot.movementCost(this, plot(), getMoves()); @@ -5517,8 +5517,8 @@ bool CvUnit::EmergencyRebase() bool CvUnit::jumpToNearestValidPlot() { VALIDATE_OBJECT - CvAssertMsg(!isAttacking(), "isAttacking did not return false as expected"); - CvAssertMsg(!isFighting(), "isFighting did not return false as expected"); + ASSERT(!isAttacking(), "isAttacking did not return false as expected"); + ASSERT(!isFighting(), "isFighting did not return false as expected"); if (getDomainType() == DOMAIN_AIR) return EmergencyRebase(); @@ -5888,7 +5888,7 @@ bool CvUnit::CanAutomate(AutomateTypes eAutomate, bool bTestVisibility) const } else { - CvAssertMsg(false, "Invalid AutomateTypes index."); + ASSERT(false, "Invalid AutomateTypes index."); } return true; @@ -6160,10 +6160,10 @@ void CvUnit::gift(bool bTestTransport) } } - CvAssertMsg(plot()->getOwner() != NO_PLAYER, "plot()->getOwner() is not expected to be equal with NO_PLAYER"); + ASSERT(plot()->getOwner() != NO_PLAYER, "plot()->getOwner() is not expected to be equal with NO_PLAYER"); pGiftUnit = GET_PLAYER(plot()->getOwner()).initUnit(getUnitType(), getX(), getY(), AI_getUnitAIType(), REASON_GIFT, false, false); - CvAssertMsg(pGiftUnit != NULL, "GiftUnit is not assigned a valid value"); + ASSERT(pGiftUnit != NULL, "GiftUnit is not assigned a valid value"); if (pGiftUnit != NULL) { @@ -6575,7 +6575,7 @@ void CvUnit::unloadAll() } else { - CvAssert(isHuman()); + ASSERT(isHuman()); pLoopUnit->SetActivityType(ACTIVITY_AWAKE); } } @@ -7887,7 +7887,7 @@ int CvUnit::healRate(const CvPlot* pPlot) const { iBaseHeal = ((100 + iBaseHealMod) / 100) * iBaseHeal; } - CvAssertMsg(iBaseHeal >= 0, "Base healing rate not expected to be negative!"); + ASSERT(iBaseHeal >= 0, "Base healing rate not expected to be negative!"); int iTotalHeal = iBaseHeal + iExtraHeal; #if defined(MOD_BALANCE_CORE) @@ -8349,7 +8349,7 @@ bool CvUnit::airlift(int iX, int iY) } pTargetPlot = GC.getMap().plot(iX, iY); - CvAssert(pTargetPlot != NULL); + ASSERT(pTargetPlot != NULL); if (MOD_API_ACHIEVEMENTS) { @@ -9146,7 +9146,7 @@ bool CvUnit::plunderTradeRoute() std::vector aiTradeUnitsAtPlot; CvPlayerTrade* pTrade = GET_PLAYER(m_eOwner).GetTrade(); aiTradeUnitsAtPlot = pTrade->GetOpposingTradeUnitsAtPlot(pPlot, false); - CvAssertMsg(aiTradeUnitsAtPlot.size() > 0, "aiTradeUnitsAtPlot is empty. Earlier check should have verified that this can't be the case"); + ASSERT(aiTradeUnitsAtPlot.size() > 0, "aiTradeUnitsAtPlot is empty. Earlier check should have verified that this can't be the case"); if (aiTradeUnitsAtPlot.size() <= 0) { return false; @@ -9260,7 +9260,7 @@ bool CvUnit::createGreatWork() CvGameCulture *pCulture = GC.getGame().GetGameCulture(); if(pCulture == NULL) { - CvAssertMsg(pCulture != NULL, "This should never happen."); + ASSERT(pCulture != NULL, "This should never happen."); return false; } @@ -9565,7 +9565,7 @@ int CvUnit::getNumExoticGoods() const // -------------------------------------------------------------------------------- void CvUnit::setNumExoticGoods(int iValue) { - CvAssert(iValue >= 0); + ASSERT(iValue >= 0); m_iNumExoticGoods = iValue; } @@ -9996,7 +9996,7 @@ bool CvUnit::rebase(int iX, int iY, bool bForced) } CvPlot* pTargetPlot = GC.getMap().plot(iX, iY); - CvAssert(pTargetPlot != NULL); + ASSERT(pTargetPlot != NULL); if(pTargetPlot == NULL) return false; @@ -10849,7 +10849,7 @@ bool CvUnit::DoFoundReligion() if(kOwner.isHuman()) { - CvAssertMsg(pkCity != NULL, "No City??"); + ASSERT(pkCity != NULL, "No City??"); CvNotifications* pNotifications = kOwner.GetNotifications(); if(pNotifications) @@ -10916,7 +10916,7 @@ bool CvUnit::DoFoundReligion() } else { - CvAssertMsg(false, "No religions available to found."); + ASSERT(false, "No religions available to found."); } } } @@ -11007,7 +11007,7 @@ bool CvUnit::DoEnhanceReligion() if(kOwner.isHuman()) { - CvAssertMsg(pkCity != NULL, "No City??"); + ASSERT(pkCity != NULL, "No City??"); CvNotifications* pNotifications = kOwner.GetNotifications(); if(pNotifications) @@ -11042,7 +11042,7 @@ bool CvUnit::DoEnhanceReligion() } else { - CvAssertMsg(false, "No religions available to found."); + ASSERT(false, "No religions available to found."); } } } @@ -11512,10 +11512,10 @@ bool CvUnit::greatperson() VALIDATE_OBJECT CvPlot* pPlot = plot(); CvPlayer* pPlayer = &GET_PLAYER(getOwner()); - CvAssertMsg(pPlayer, "Owner of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pPlayer, "Owner of unit not expected to be NULL."); if (!pPlayer) return false; CvTeam* pTeam = &GET_TEAM(pPlayer->getTeam()); - CvAssertMsg(pTeam, "Owner team of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pTeam, "Owner team of unit not expected to be NULL."); if (!pTeam) return false; if(pPlot->isActiveVisible()) @@ -11590,7 +11590,7 @@ int CvUnit::getDiscoverAmount() { int iScience = 0; CvPlayer* pPlayer = &GET_PLAYER(getOwner()); - CvAssertMsg(pPlayer, "Owner of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pPlayer, "Owner of unit not expected to be NULL."); if (pPlayer) { // Beakers boost based on previous turns (no base value) @@ -11625,10 +11625,10 @@ bool CvUnit::discover() } CvPlayer* pPlayer = &GET_PLAYER(getOwner()); - CvAssertMsg(pPlayer, "Owner of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pPlayer, "Owner of unit not expected to be NULL."); if (!pPlayer) return false; CvTeam* pTeam = &GET_TEAM(pPlayer->getTeam()); - CvAssertMsg(pTeam, "Owner team of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pTeam, "Owner team of unit not expected to be NULL."); if (!pTeam) return false; // Beakers boost based on previous turns @@ -12809,7 +12809,7 @@ int CvUnit::getGAPBlast() { int iValue = 0; CvPlayer* pPlayer = &GET_PLAYER(getOwner()); - CvAssertMsg(pPlayer, "Owner of unit not expected to be NULL. Please send Anton your save file and version."); + ASSERT(pPlayer, "Owner of unit not expected to be NULL."); if (pPlayer) { // boost based on previous turns @@ -13331,7 +13331,7 @@ bool CvUnit::blastTourism() bool CvUnit::canBuild(const CvPlot* pPlot, BuildTypes eBuild, bool bTestVisible, bool bTestGold, bool bTestEra) const { VALIDATE_OBJECT - CvAssertMsg(eBuild < GC.getNumBuildInfos() && eBuild >= 0, "Index out of bounds"); + ASSERT(eBuild < GC.getNumBuildInfos() && eBuild >= 0, "Index out of bounds"); if (MOD_CIV6_WORKER && getBuilderStrength() <= 0) return false; @@ -13408,7 +13408,7 @@ bool CvUnit::build(BuildTypes eBuild) VALIDATE_OBJECT bool bFinished = false; - CvAssertMsg(eBuild < GC.getNumBuildInfos(), "Invalid Build"); + ASSERT(eBuild < GC.getNumBuildInfos(), "Invalid Build"); CvPlayer& kPlayer = GET_PLAYER(getOwner()); CvBuildInfo* pkBuildInfo = NULL; @@ -15679,7 +15679,7 @@ void CvUnit::changeRivalTerritoryCount(int iChange) { VALIDATE_OBJECT m_iRivalTerritoryCount = (m_iRivalTerritoryCount + iChange); - CvAssert(getRivalTerritoryCount() >= 0); + ASSERT(getRivalTerritoryCount() >= 0); } // -------------------------------------------------------------------------------- @@ -15810,7 +15810,7 @@ void CvUnit::changeIsSlowInEnemyLandCount(int iChange) { VALIDATE_OBJECT m_iIsSlowInEnemyLandCount = (m_iIsSlowInEnemyLandCount + iChange); - CvAssert(getIsSlowInEnemyLandCount() >= 0); + ASSERT(getIsSlowInEnemyLandCount() >= 0); } // -------------------------------------------------------------------------------- @@ -15832,7 +15832,7 @@ void CvUnit::changeRangedSupportFireCount(int iChange) { VALIDATE_OBJECT m_iRangedSupportFireCount = (m_iRangedSupportFireCount + iChange); - CvAssert(getRangedSupportFireCount() >= 0); + ASSERT(getRangedSupportFireCount() >= 0); } @@ -15942,10 +15942,10 @@ int CvUnit::GetStrategicResourceCombatPenalty() const int iUsed = kPlayer.getNumResourceUsed(eResource); int iMissing = iUsed - kPlayer.getNumResourceTotal(eResource); - CvAssertMsg(iUsed > 0, "Number of used resources is zero or negative, this is unexpected. Please send Anton your save file and version."); + ASSERT(iUsed > 0, "Number of used resources is zero or negative, this is unexpected."); if (iUsed <= 0) continue; - CvAssertMsg(iMissing > 0, "Number of missing resources is zero or negative, this is unexpected. Please send Anton your save file and version."); + ASSERT(iMissing > 0, "Number of missing resources is zero or negative, this is unexpected."); if (iMissing <= 0) continue; @@ -16282,7 +16282,7 @@ int CvUnit::GetGenericMeleeStrengthModifier(const CvUnit* pOtherUnit, const CvPl if(pOtherUnit != NULL) { - CvAssertMsg(pOtherUnit != this, "Compared combat strength against one's own pointer. This is weird and probably wrong."); + ASSERT(pOtherUnit != this, "Compared combat strength against one's own pointer. This is weird and probably wrong."); // Generic Unit Class Modifier iModifier += getUnitClassModifier(pOtherUnit->getUnitClassType()); @@ -16470,7 +16470,7 @@ int CvUnit::GetMaxAttackStrength(const CvPlot* pFromPlot, const CvPlot* pToPlot, if(pDefender != NULL) { - CvAssertMsg(pDefender != this, "Compared attack strength against one's own pointer. This is weird and probably wrong."); + ASSERT(pDefender != this, "Compared attack strength against one's own pointer. This is weird and probably wrong."); // Unit Class Attack Modifier iModifier += unitClassAttackModifier(pDefender->getUnitClassType()); @@ -17484,7 +17484,7 @@ int CvUnit::GetInterceptionDamage(const CvUnit* pInterceptedAttacker, bool bIncl break; default: - CvAssert(false); + ASSERT(false); break; } @@ -17504,7 +17504,7 @@ int CvUnit::GetInterceptionDamage(const CvUnit* pInterceptedAttacker, bool bIncl break; default: - CvAssert(false); + ASSERT(false); break; } @@ -17570,7 +17570,7 @@ int CvUnit::fortifyModifier() const if(iValue < 0) { - CvAssertMsg(false, "Calculated a negative combat mod for a fortified unit. Resetting to 0 instead."); + ASSERT(false, "Calculated a negative combat mod for a fortified unit. Resetting to 0 instead."); iValue = 0; } } @@ -18588,7 +18588,7 @@ void CvUnit::changeCanMoveAllTerrainCount(int iValue) { VALIDATE_OBJECT m_iCanMoveAllTerrainCount += iValue; - CvAssert(getCanMoveAllTerrainCount() >= 0); + ASSERT(getCanMoveAllTerrainCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18610,7 +18610,7 @@ void CvUnit::changeCanMoveAfterAttackingCount(int iValue) { VALIDATE_OBJECT m_iCanMoveAfterAttackingCount += iValue; - CvAssert(getCanMoveAfterAttackingCount() >= 0); + ASSERT(getCanMoveAfterAttackingCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18646,7 +18646,7 @@ void CvUnit::changeFreePillageMoveCount(int iValue) { VALIDATE_OBJECT m_iFreePillageMoveCount += iValue; - CvAssert(getFreePillageMoveCount() >= 0); + ASSERT(getFreePillageMoveCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18668,7 +18668,7 @@ void CvUnit::changeHealOnPillageCount(int iValue) { VALIDATE_OBJECT m_iHealOnPillageCount += iValue; - CvAssert(getHealOnPillageCount() >= 0); + ASSERT(getHealOnPillageCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18693,7 +18693,7 @@ void CvUnit::changeHPHealedIfDefeatEnemy(int iValue) { VALIDATE_OBJECT m_iHPHealedIfDefeatEnemy += iValue; - CvAssert(getHPHealedIfDefeatEnemy() >= 0); + ASSERT(getHPHealedIfDefeatEnemy() >= 0); } // -------------------------------------------------------------------------------- @@ -18732,7 +18732,7 @@ void CvUnit::ChangeGoldenAgeValueFromKills(int iValue) { VALIDATE_OBJECT m_iGoldenAgeValueFromKills += iValue; - CvAssert(GetGoldenAgeValueFromKills() >= 0); + ASSERT(GetGoldenAgeValueFromKills() >= 0); } // -------------------------------------------------------------------------------- @@ -18778,7 +18778,7 @@ void CvUnit::changeNoAttackInOceanCount(int iValue) { VALIDATE_OBJECT m_iNoAttackInOceanCount += iValue; - CvAssert(getNoAttackInOceanCount() >= 0); + ASSERT(getNoAttackInOceanCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18897,7 +18897,7 @@ void CvUnit::changeNukeImmuneCount(int iValue) { VALIDATE_OBJECT m_iNukeImmuneCount += iValue; - CvAssert(getNukeImmuneCount() >= 0); + ASSERT(getNukeImmuneCount() >= 0); } @@ -18920,7 +18920,7 @@ void CvUnit::changeHiddenNationalityCount(int iValue) { VALIDATE_OBJECT m_iHiddenNationalityCount += iValue; - CvAssert(getHiddenNationalityCount() >= 0); + ASSERT(getHiddenNationalityCount() >= 0); } @@ -18943,7 +18943,7 @@ void CvUnit::changeNoRevealMapCount(int iValue) { VALIDATE_OBJECT m_iNoRevealMapCount += iValue; - CvAssert(getNoRevealMapCount() >= 0); + ASSERT(getNoRevealMapCount() >= 0); } // -------------------------------------------------------------------------------- @@ -18999,7 +18999,7 @@ int CvUnit::GetNumFriendlyUnitsAdjacent(const CvUnit* pUnitToExclude) const /// Is a particular enemy city next to us? bool CvUnit::IsEnemyCityAdjacent(const CvCity* pSpecifyCity) const { - CvAssertMsg(pSpecifyCity, "City is NULL when checking if it is adjacent to a unit"); + ASSERT(pSpecifyCity, "City is NULL when checking if it is adjacent to a unit"); if (plot() != NULL) { return plot()->IsEnemyCityAdjacent(getTeam(), pSpecifyCity); @@ -19329,8 +19329,8 @@ int CvUnit::roughDefenseModifier() const int CvUnit::terrainAttackModifier(TerrainTypes eTerrain) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); return (getExtraTerrainAttackPercent(eTerrain)); } @@ -19339,8 +19339,8 @@ int CvUnit::terrainAttackModifier(TerrainTypes eTerrain) const int CvUnit::terrainDefenseModifier(TerrainTypes eTerrain) const { VALIDATE_OBJECT - CvAssertMsg(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eTerrain >= 0, "eTerrain is expected to be non-negative (invalid Index)"); + ASSERT(eTerrain < GC.getNumTerrainInfos(), "eTerrain is expected to be within maximum bounds (invalid Index)"); return (getExtraTerrainDefensePercent(eTerrain)); } @@ -19349,8 +19349,8 @@ int CvUnit::terrainDefenseModifier(TerrainTypes eTerrain) const int CvUnit::featureAttackModifier(FeatureTypes eFeature) const { VALIDATE_OBJECT - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); return (getExtraFeatureAttackPercent(eFeature)); } @@ -19358,8 +19358,8 @@ int CvUnit::featureAttackModifier(FeatureTypes eFeature) const int CvUnit::featureDefenseModifier(FeatureTypes eFeature) const { VALIDATE_OBJECT - CvAssertMsg(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); - CvAssertMsg(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); + ASSERT(eFeature >= 0, "eFeature is expected to be non-negative (invalid Index)"); + ASSERT(eFeature < GC.getNumFeatureInfos(), "eFeature is expected to be within maximum bounds (invalid Index)"); return (getExtraFeatureDefensePercent(eFeature)); } @@ -19367,8 +19367,8 @@ int CvUnit::featureDefenseModifier(FeatureTypes eFeature) const int CvUnit::unitClassAttackModifier(UnitClassTypes eUnitClass) const { VALIDATE_OBJECT - CvAssertMsg(eUnitClass >= 0, "eUnitClass is expected to be non-negative (invalid Index)"); - CvAssertMsg(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass is expected to be within maximum bounds (invalid Index)"); + ASSERT(eUnitClass >= 0, "eUnitClass is expected to be non-negative (invalid Index)"); + ASSERT(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass is expected to be within maximum bounds (invalid Index)"); return getUnitClassAttackMod(eUnitClass); } @@ -19377,8 +19377,8 @@ int CvUnit::unitClassAttackModifier(UnitClassTypes eUnitClass) const int CvUnit::unitClassDefenseModifier(UnitClassTypes eUnitClass) const { VALIDATE_OBJECT - CvAssertMsg(eUnitClass >= 0, "eUnitClass is expected to be non-negative (invalid Index)"); - CvAssertMsg(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass is expected to be within maximum bounds (invalid Index)"); + ASSERT(eUnitClass >= 0, "eUnitClass is expected to be non-negative (invalid Index)"); + ASSERT(eUnitClass < GC.getNumUnitClassInfos(), "eUnitClass is expected to be within maximum bounds (invalid Index)"); return getUnitClassDefenseMod(eUnitClass); } @@ -19387,8 +19387,8 @@ int CvUnit::unitClassDefenseModifier(UnitClassTypes eUnitClass) const int CvUnit::unitCombatModifier(UnitCombatTypes eUnitCombat) const { VALIDATE_OBJECT - CvAssertMsg(eUnitCombat >= 0, "eUnitCombat is expected to be non-negative (invalid Index)"); - CvAssertMsg(eUnitCombat < GC.getNumUnitCombatClassInfos(), "eUnitCombat is expected to be within maximum bounds (invalid Index)"); + ASSERT(eUnitCombat >= 0, "eUnitCombat is expected to be non-negative (invalid Index)"); + ASSERT(eUnitCombat < GC.getNumUnitCombatClassInfos(), "eUnitCombat is expected to be within maximum bounds (invalid Index)"); return (getExtraUnitCombatModifier(eUnitCombat)); } @@ -19397,8 +19397,8 @@ int CvUnit::unitCombatModifier(UnitCombatTypes eUnitCombat) const int CvUnit::domainModifier(DomainTypes eDomain) const { VALIDATE_OBJECT - CvAssertMsg(eDomain >= 0, "eDomain is expected to be non-negative (invalid Index)"); - CvAssertMsg(eDomain < NUM_DOMAIN_TYPES, "eDomain is expected to be within maximum bounds (invalid Index)"); + ASSERT(eDomain >= 0, "eDomain is expected to be non-negative (invalid Index)"); + ASSERT(eDomain < NUM_DOMAIN_TYPES, "eDomain is expected to be within maximum bounds (invalid Index)"); return (getExtraDomainModifier(eDomain)); } @@ -19406,64 +19406,64 @@ int CvUnit::domainModifier(DomainTypes eDomain) const int CvUnit::GetYieldModifier(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_YieldModifier[eYield]; } // -------------------------------------------------------------------------------- void CvUnit::SetYieldModifier(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); m_YieldModifier[eYield] = (m_YieldModifier[eYield] + iValue); } int CvUnit::GetYieldChange(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_YieldChange[eYield]; } // -------------------------------------------------------------------------------- void CvUnit::SetYieldChange(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); m_YieldChange[eYield] = (m_YieldChange[eYield] + iValue); } // Similar to above code but is only for combat units and scales per the units combat strength : yield is placed on the plot itself int CvUnit::GetGarrisonYieldChange(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_iGarrisonYieldChange[eYield]; } // -------------------------------------------------------------------------------- void CvUnit::SetGarrisonYieldChange(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); m_iGarrisonYieldChange[eYield] = (m_iGarrisonYieldChange[eYield] + iValue); } int CvUnit::GetFortificationYieldChange(YieldTypes eYield) const { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); return m_iFortificationYieldChange[eYield]; } // -------------------------------------------------------------------------------- void CvUnit::SetFortificationYieldChange(YieldTypes eYield, int iValue) { VALIDATE_OBJECT - CvAssertMsg(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); - CvAssertMsg(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); + ASSERT(eYield >= 0, "eYield is expected to be non-negative (invalid Index)"); + ASSERT(eYield < NUM_YIELD_TYPES, "eYield is expected to be within maximum bounds (invalid Index)"); m_iFortificationYieldChange[eYield] = (m_iFortificationYieldChange[eYield] + iValue); } @@ -19506,7 +19506,7 @@ void CvUnit::changeCargoSpace(int iChange) if(iChange != 0) { m_iCargoCapacity += iChange; - CvAssert(m_iCargoCapacity >= 0); + ASSERT(m_iCargoCapacity >= 0); setInfoBarDirty(true); } } @@ -19651,7 +19651,7 @@ void CvUnit::setHotKeyNumber(int iNewValue) CvUnit* pLoopUnit = NULL; int iLoop = 0; - CvAssert(getOwner() != NO_PLAYER); + ASSERT(getOwner() != NO_PLAYER); if(getHotKeyNumber() != iNewValue) { @@ -19696,9 +19696,9 @@ void CvUnit::setXY(int iX, int iY, bool bGroup, bool bUpdate, bool bShow, bool b if (at(iX, iY)) return; - CvAssert(!isFighting()); - CvAssert((iX == INVALID_PLOT_COORD) || (GC.getMap().plot(iX, iY)->getX() == iX)); - CvAssert((iY == INVALID_PLOT_COORD) || (GC.getMap().plot(iX, iY)->getY() == iY)); + ASSERT(!isFighting()); + ASSERT((iX == INVALID_PLOT_COORD) || (GC.getMap().plot(iX, iY)->getX() == iX)); + ASSERT((iY == INVALID_PLOT_COORD) || (GC.getMap().plot(iX, iY)->getY() == iY)); eOldActivityType = GetActivityType(); @@ -19925,7 +19925,7 @@ void CvUnit::setXY(int iX, int iY, bool bGroup, bool bUpdate, bool bShow, bool b m_iY = INVALID_PLOT_COORD; } - CvAssertMsg(plot() == pNewPlot, "plot is expected to equal pNewPlot"); + ASSERT(plot() == pNewPlot, "plot is expected to equal pNewPlot"); if(pNewPlot != NULL) { @@ -20589,7 +20589,7 @@ void CvUnit::setXY(int iX, int iY, bool bGroup, bool bUpdate, bool bShow, bool b createCaptureUnit(kCaptureUnitList[uiCaptureIndex]); } - CvAssert(pOldPlot != pNewPlot); + ASSERT(pOldPlot != pNewPlot); if(IsSelected()) gDLL->GameplayMinimapUnitSelect(iX, iY); @@ -20761,7 +20761,7 @@ void CvUnit::setLastMoveTurn(int iNewValue) { VALIDATE_OBJECT m_iLastMoveTurn = iNewValue; - CvAssert(getLastMoveTurn() >= 0); + ASSERT(getLastMoveTurn() >= 0); } // -------------------------------------------------------------------------------- @@ -20865,7 +20865,7 @@ void CvUnit::setGameTurnCreated(int iNewValue) { VALIDATE_OBJECT m_iGameTurnCreated = iNewValue; - CvAssert(getGameTurnCreated() >= 0); + ASSERT(getGameTurnCreated() >= 0); } @@ -20904,7 +20904,7 @@ int CvUnit::setDamage(int iNewValue, PlayerTypes ePlayer, float fAdditionalTextD m_iDamage = range(iNewValue, 0, GetMaxHitPoints()); int iDiff = m_iDamage - iOldValue; - CvAssertMsg(GetCurrHitPoints() >= 0, "currHitPoints() is expected to be non-negative (invalid Index)"); + ASSERT(GetCurrHitPoints() >= 0, "currHitPoints() is expected to be non-negative (invalid Index)"); if(iOldValue != getDamage()) { @@ -21174,7 +21174,7 @@ void CvUnit::setExperienceTimes100(int iNewValueTimes100, int iMax, bool bDontSh int iExperienceChange = (iNewValueTimes100 / 100) - (getExperienceTimes100() / 100); m_iExperienceTimes100 = std::min(iMaxTimes100, iNewValueTimes100); - CvAssert(getExperienceTimes100() >= 0); + ASSERT(getExperienceTimes100() >= 0); if(getOwner() == GC.getGame().getActivePlayer() && !bDontShow && iExperienceChange > 0) { @@ -21402,7 +21402,7 @@ void CvUnit::setLevel(int iNewValue) if(getLevel() != iNewValue) { m_iLevel = iNewValue; - CvAssert(getLevel() >= 0); + ASSERT(getLevel() >= 0); if(getLevel() > GET_PLAYER(getOwner()).getHighestUnitLevel()) { @@ -21438,7 +21438,7 @@ void CvUnit::changeCargo(int iChange) { VALIDATE_OBJECT m_iCargo += iChange; - CvAssert(getCargo() >= 0); + ASSERT(getCargo() >= 0); } @@ -21492,7 +21492,7 @@ void CvUnit::setCombatTimer(int iNewValue) { VALIDATE_OBJECT m_iCombatTimer = iNewValue; - CvAssert(getCombatTimer() >= 0); + ASSERT(getCombatTimer() >= 0); } @@ -21651,7 +21651,7 @@ void CvUnit::changeBlitzCount(int iChange) { VALIDATE_OBJECT m_iBlitzCount = (m_iBlitzCount + iChange); - CvAssert(getBlitzCount() >= 0); + ASSERT(getBlitzCount() >= 0); } @@ -21676,7 +21676,7 @@ void CvUnit::changeAmphibCount(int iChange) { VALIDATE_OBJECT m_iAmphibCount = (m_iAmphibCount + iChange); - CvAssert(getAmphibCount() >= 0); + ASSERT(getAmphibCount() >= 0); } @@ -21701,7 +21701,7 @@ void CvUnit::changeRiverCrossingNoPenaltyCount(int iChange) { VALIDATE_OBJECT m_iRiverCrossingNoPenaltyCount = (m_iRiverCrossingNoPenaltyCount + iChange); - CvAssert(getRiverCrossingNoPenaltyCount() >= 0); + ASSERT(getRiverCrossingNoPenaltyCount() >= 0); } @@ -21726,7 +21726,7 @@ void CvUnit::changeEnemyRouteCount(int iChange) { VALIDATE_OBJECT m_iEnemyRouteCount = (m_iEnemyRouteCount + iChange); - CvAssert(getEnemyRouteCount() >= 0); + ASSERT(getEnemyRouteCount() >= 0); } @@ -21751,7 +21751,7 @@ void CvUnit::changeAlwaysHealCount(int iChange) { VALIDATE_OBJECT m_iAlwaysHealCount = (m_iAlwaysHealCount + iChange); - CvAssert(getAlwaysHealCount() >= 0); + ASSERT(getAlwaysHealCount() >= 0); } @@ -21776,7 +21776,7 @@ void CvUnit::changeHealOutsideFriendlyCount(int iChange) { VALIDATE_OBJECT m_iHealOutsideFriendlyCount = (m_iHealOutsideFriendlyCount + iChange); - CvAssert(getHealOutsideFriendlyCount() >= 0); + ASSERT(getHealOutsideFriendlyCount() >= 0); } @@ -21801,7 +21801,7 @@ void CvUnit::changeHillsDoubleMoveCount(int iChange) { VALIDATE_OBJECT m_iHillsDoubleMoveCount = (m_iHillsDoubleMoveCount + iChange); - CvAssert(getHillsDoubleMoveCount() >= 0); + ASSERT(getHillsDoubleMoveCount() >= 0); } @@ -21826,7 +21826,7 @@ void CvUnit::changeRiverDoubleMoveCount(int iChange) { VALIDATE_OBJECT m_iRiverDoubleMoveCount = (m_iRiverDoubleMoveCount + iChange); - CvAssert(getRiverDoubleMoveCount() >= 0); + ASSERT(getRiverDoubleMoveCount() >= 0); } #if defined(MOD_BALANCE_CORE) // -------------------------------------------------------------------------------- @@ -21846,7 +21846,7 @@ void CvUnit::changeMountainsDoubleMoveCount(int iChange) { VALIDATE_OBJECT m_iMountainsDoubleMoveCount = (m_iMountainsDoubleMoveCount + iChange); - CvAssert(getMountainsDoubleMoveCount() >= 0); + ASSERT(getMountainsDoubleMoveCount() >= 0); } // -------------------------------------------------------------------------------- @@ -21866,7 +21866,7 @@ void CvUnit::changeEmbarkFlatCostCount(int iChange) { VALIDATE_OBJECT m_iEmbarkFlatCostCount = (m_iEmbarkFlatCostCount + iChange); - CvAssert(getEmbarkFlatCostCount() >= 0); + ASSERT(getEmbarkFlatCostCount() >= 0); } // -------------------------------------------------------------------------------- @@ -21886,7 +21886,7 @@ void CvUnit::changeDisembarkFlatCostCount(int iChange) { VALIDATE_OBJECT m_iDisembarkFlatCostCount = (m_iDisembarkFlatCostCount + iChange); - CvAssert(getDisembarkFlatCostCount() >= 0); + ASSERT(getDisembarkFlatCostCount() >= 0); } // -------------------------------------------------------------------------------- @@ -21900,7 +21900,7 @@ void CvUnit::changeAOEDamageOnKill(int iChange) { VALIDATE_OBJECT m_iAOEDamageOnKill = (m_iAOEDamageOnKill + iChange); - CvAssert(getAOEDamageOnKill() >= 0); + ASSERT(getAOEDamageOnKill() >= 0); } // -------------------------------------------------------------------------------- @@ -21914,7 +21914,7 @@ void CvUnit::changeAOEDamageOnPillage(int iChange) { VALIDATE_OBJECT m_iAOEDamageOnPillage = (m_iAOEDamageOnPillage + iChange); - CvAssert(getAOEDamageOnPillage() >= 0); + ASSERT(getAOEDamageOnPillage() >= 0); } // -------------------------------------------------------------------------------- @@ -21928,7 +21928,7 @@ void CvUnit::changeAoEDamageOnMove(int iChange) { VALIDATE_OBJECT m_iAoEDamageOnMove = (m_iAoEDamageOnMove + iChange); - CvAssert(getAoEDamageOnMove() >= 0); + ASSERT(getAoEDamageOnMove() >= 0); } // -------------------------------------------------------------------------------- @@ -21942,7 +21942,7 @@ void CvUnit::changePartialHealOnPillage(int iChange) { VALIDATE_OBJECT m_iPartialHealOnPillage = (m_iPartialHealOnPillage + iChange); - CvAssert(getPartialHealOnPillage() >= 0); + ASSERT(getPartialHealOnPillage() >= 0); } // -------------------------------------------------------------------------------- @@ -21956,7 +21956,7 @@ void CvUnit::changeSplashDamage(int iChange) { VALIDATE_OBJECT m_iSplashDamage = (m_iSplashDamage + iChange); - CvAssert(getSplashDamage() >= 0); + ASSERT(getSplashDamage() >= 0); } // -------------------------------------------------------------------------------- @@ -21970,7 +21970,7 @@ void CvUnit::changeMultiAttackBonus(int iChange) { VALIDATE_OBJECT m_iMultiAttackBonus = (m_iMultiAttackBonus + iChange); - CvAssert(getMultiAttackBonus() >= 0); + ASSERT(getMultiAttackBonus() >= 0); } // -------------------------------------------------------------------------------- int CvUnit::getLandAirDefenseValue() const @@ -21983,7 +21983,7 @@ void CvUnit::changeLandAirDefenseValue(int iChange) { VALIDATE_OBJECT m_iLandAirDefenseValue = (m_iLandAirDefenseValue + iChange); - CvAssert(getLandAirDefenseValue() >= 0); + ASSERT(getLandAirDefenseValue() >= 0); } @@ -22067,7 +22067,7 @@ void CvUnit::changeExtraNavalMoves(int iChange) { VALIDATE_OBJECT m_iExtraNavalMoves += iChange; - CvAssert(getExtraNavalMoves() >= 0); + ASSERT(getExtraNavalMoves() >= 0); } @@ -22085,7 +22085,7 @@ void CvUnit::changeExtraMoveDiscount(int iChange) { VALIDATE_OBJECT m_iExtraMoveDiscount = (m_iExtraMoveDiscount + iChange); - CvAssert(getExtraMoveDiscount() >= 0); + ASSERT(getExtraMoveDiscount() >= 0); } @@ -22150,7 +22150,7 @@ void CvUnit::changeExtraWithdrawal(int iChange) { VALIDATE_OBJECT m_iExtraWithdrawal = (m_iExtraWithdrawal + iChange); - CvAssert(getExtraWithdrawal() >= 0); + ASSERT(getExtraWithdrawal() >= 0); } // -------------------------------------------------------------------------------- @@ -22380,7 +22380,7 @@ void CvUnit::changeExtraFriendlyHeal(int iChange) { VALIDATE_OBJECT m_iExtraFriendlyHeal = (m_iExtraFriendlyHeal + iChange); - CvAssert(getExtraFriendlyHeal() >= 0); + ASSERT(getExtraFriendlyHeal() >= 0); } @@ -22397,7 +22397,7 @@ void CvUnit::changeSameTileHeal(int iChange) { VALIDATE_OBJECT m_iSameTileHeal = (m_iSameTileHeal + iChange); - CvAssert(getSameTileHeal() >= 0); + ASSERT(getSameTileHeal() >= 0); } @@ -22414,7 +22414,7 @@ void CvUnit::changeAdjacentTileHeal(int iChange) { VALIDATE_OBJECT m_iAdjacentTileHeal = (m_iAdjacentTileHeal + iChange); - CvAssert(getAdjacentTileHeal() >= 0); + ASSERT(getAdjacentTileHeal() >= 0); } @@ -22431,7 +22431,7 @@ void CvUnit::changeEnemyDamageChance(int iChange) { VALIDATE_OBJECT m_iEnemyDamageChance = (m_iEnemyDamageChance + iChange); - CvAssert(getEnemyDamageChance() >= 0); + ASSERT(getEnemyDamageChance() >= 0); } @@ -22448,7 +22448,7 @@ void CvUnit::changeNeutralDamageChance(int iChange) { VALIDATE_OBJECT m_iNeutralDamageChance = (m_iNeutralDamageChance + iChange); - CvAssert(getNeutralDamageChance() >= 0); + ASSERT(getNeutralDamageChance() >= 0); } // -------------------------------------------------------------------------------- @@ -22477,7 +22477,7 @@ void CvUnit::changeNeutralDamage(int iChange) { VALIDATE_OBJECT m_iNeutralDamage = (m_iNeutralDamage + iChange); - CvAssert(getNeutralDamage() >= 0); + ASSERT(getNeutralDamage() >= 0); } // -------------------------------------------------------------------------------- @@ -22509,7 +22509,7 @@ void CvUnit::changeNearbyEnemyCombatRange(int iChange) { VALIDATE_OBJECT m_iNearbyEnemyCombatRange = (m_iNearbyEnemyCombatRange + iChange); - CvAssert(getNearbyEnemyCombatRange() >= 0); + ASSERT(getNearbyEnemyCombatRange() >= 0); } @@ -25075,7 +25075,7 @@ void CvUnit::setCombatUnit(CvUnit* pCombatUnit, bool bAttacking) if(pCombatUnit != NULL) { - CvAssertMsg(getCombatUnit() == NULL && getCombatCity() == NULL, "Combat Unit or City is not expected to be assigned"); + ASSERT(getCombatUnit() == NULL && getCombatCity() == NULL, "Combat Unit or City is not expected to be assigned"); m_bCombatFocus = ( bAttacking && !(DLLUI->isFocusedWidget()) && @@ -25128,7 +25128,7 @@ void CvUnit::setCombatCity(CvCity* pCombatCity) if(pCombatCity != NULL) { - CvAssertMsg(getCombatUnit() == NULL && getCombatCity() == NULL, "Combat Unit or City is not expected to be assigned"); + ASSERT(getCombatUnit() == NULL && getCombatCity() == NULL, "Combat Unit or City is not expected to be assigned"); m_bCombatFocus = (!(DLLUI->isFocusedWidget()) && ((getOwner() == GC.getGame().getActivePlayer()) || ((pCombatCity->getOwner() == GC.getGame().getActivePlayer()) && !(GET_PLAYER(GC.getGame().getActivePlayer()).isSimultaneousTurns())))); m_combatCity = pCombatCity->GetIDInfo(); } @@ -25158,7 +25158,7 @@ void CvUnit::clearCombat() m_bCombatFocus = false; if(getCombatUnit() != NULL || getCombatCity() != NULL) { - CvAssertMsg(plot()->isUnitFighting(), "plot()->isUnitFighting is expected to be true"); + ASSERT(plot()->isUnitFighting(), "plot()->isUnitFighting is expected to be true"); m_combatCity.reset(); m_combatUnit.reset(); @@ -25216,7 +25216,7 @@ void CvUnit::setTransportUnit(CvUnit* pTransportUnit) if(pTransportUnit != NULL) { - CvAssertMsg(pTransportUnit->cargoSpaceAvailable(getSpecialUnitType(), getDomainType()) > 0, "Cargo space is expected to be available"); + ASSERT(pTransportUnit->cargoSpaceAvailable(getSpecialUnitType(), getDomainType()) > 0, "Cargo space is expected to be available"); m_transportUnit = pTransportUnit->GetIDInfo(); @@ -25246,8 +25246,8 @@ void CvUnit::setTransportUnit(CvUnit* pTransportUnit) int CvUnit::getExtraDomainModifier(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_extraDomainModifiers[eIndex]; } @@ -25256,8 +25256,8 @@ int CvUnit::getExtraDomainModifier(DomainTypes eIndex) const void CvUnit::changeExtraDomainModifier(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_extraDomainModifiers[eIndex] = (m_extraDomainModifiers[eIndex] + iChange); } @@ -25266,8 +25266,8 @@ void CvUnit::changeExtraDomainModifier(DomainTypes eIndex, int iChange) int CvUnit::getExtraDomainAttack(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_extraDomainAttacks[eIndex]; } @@ -25276,8 +25276,8 @@ int CvUnit::getExtraDomainAttack(DomainTypes eIndex) const void CvUnit::changeExtraDomainAttack(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_extraDomainAttacks[eIndex] = (m_extraDomainAttacks[eIndex] + iChange); } @@ -25286,8 +25286,8 @@ void CvUnit::changeExtraDomainAttack(DomainTypes eIndex, int iChange) int CvUnit::getExtraDomainDefense(DomainTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_extraDomainDefenses[eIndex]; } @@ -25296,8 +25296,8 @@ int CvUnit::getExtraDomainDefense(DomainTypes eIndex) const void CvUnit::changeExtraDomainDefense(DomainTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_DOMAIN_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); m_extraDomainDefenses[eIndex] = (m_extraDomainDefenses[eIndex] + iChange); } @@ -25984,15 +25984,15 @@ void CvUnit::changeFeatureDoubleHeal(FeatureTypes eIndex, int iChange) void CvUnit::ChangeNumTimesAttackedThisTurn(PlayerTypes ePlayer, int iValue) { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "ePlayer expected to be >= 0"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "ePlayer expected to be < NUM_DOMAIN_TYPES"); + ASSERT(ePlayer >= 0, "ePlayer expected to be >= 0"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "ePlayer expected to be < NUM_DOMAIN_TYPES"); m_aiNumTimesAttackedThisTurn[ePlayer] = m_aiNumTimesAttackedThisTurn[ePlayer] + iValue; } int CvUnit::GetNumTimesAttackedThisTurn(PlayerTypes ePlayer) const { VALIDATE_OBJECT - CvAssertMsg(ePlayer >= 0, "eIndex expected to be >= 0"); - CvAssertMsg(ePlayer < REALLY_MAX_PLAYERS, "eIndex expected to be < NUM_DOMAIN_TYPES"); + ASSERT(ePlayer >= 0, "eIndex expected to be >= 0"); + ASSERT(ePlayer < REALLY_MAX_PLAYERS, "eIndex expected to be < NUM_DOMAIN_TYPES"); return m_aiNumTimesAttackedThisTurn[ePlayer]; } #endif @@ -26301,8 +26301,8 @@ void CvUnit::changeUnitClassDefenseMod(UnitClassTypes eIndex, int iChange) int CvUnit::getCombatModPerAdjacentUnitCombatModifier(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_iCombatModPerAdjacentUnitCombatModifier[eIndex]; } @@ -26311,8 +26311,8 @@ int CvUnit::getCombatModPerAdjacentUnitCombatModifier(UnitCombatTypes eIndex) co void CvUnit::changeCombatModPerAdjacentUnitCombatModifier(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_iCombatModPerAdjacentUnitCombatModifier[eIndex] = m_iCombatModPerAdjacentUnitCombatModifier[eIndex] + iChange; } @@ -26320,8 +26320,8 @@ void CvUnit::changeCombatModPerAdjacentUnitCombatModifier(UnitCombatTypes eIndex int CvUnit::getCombatModPerAdjacentUnitCombatAttackMod(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_iCombatModPerAdjacentUnitCombatAttackMod[eIndex]; } @@ -26330,8 +26330,8 @@ int CvUnit::getCombatModPerAdjacentUnitCombatAttackMod(UnitCombatTypes eIndex) c void CvUnit::changeCombatModPerAdjacentUnitCombatAttackMod(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_iCombatModPerAdjacentUnitCombatAttackMod[eIndex] = m_iCombatModPerAdjacentUnitCombatAttackMod[eIndex] + iChange; } @@ -26339,8 +26339,8 @@ void CvUnit::changeCombatModPerAdjacentUnitCombatAttackMod(UnitCombatTypes eInde int CvUnit::getCombatModPerAdjacentUnitCombatDefenseMod(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_iCombatModPerAdjacentUnitCombatDefenseMod[eIndex]; } @@ -26349,8 +26349,8 @@ int CvUnit::getCombatModPerAdjacentUnitCombatDefenseMod(UnitCombatTypes eIndex) void CvUnit::changeCombatModPerAdjacentUnitCombatDefenseMod(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_iCombatModPerAdjacentUnitCombatDefenseMod[eIndex] = m_iCombatModPerAdjacentUnitCombatDefenseMod[eIndex] + iChange; } @@ -26358,8 +26358,8 @@ void CvUnit::changeCombatModPerAdjacentUnitCombatDefenseMod(UnitCombatTypes eInd int CvUnit::getYieldFromScouting(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_yieldFromScouting[eIndex]; } @@ -26368,8 +26368,8 @@ int CvUnit::getYieldFromScouting(YieldTypes eIndex) const void CvUnit::changeYieldFromScouting(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -26381,8 +26381,8 @@ void CvUnit::changeYieldFromScouting(YieldTypes eIndex, int iChange) int CvUnit::getYieldFromKills(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_yieldFromKills[eIndex]; } @@ -26391,8 +26391,8 @@ int CvUnit::getYieldFromKills(YieldTypes eIndex) const void CvUnit::changeYieldFromKills(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -26404,8 +26404,8 @@ void CvUnit::changeYieldFromKills(YieldTypes eIndex, int iChange) int CvUnit::getYieldFromBarbarianKills(YieldTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); return m_yieldFromBarbarianKills[eIndex]; } @@ -26414,8 +26414,8 @@ int CvUnit::getYieldFromBarbarianKills(YieldTypes eIndex) const void CvUnit::changeYieldFromBarbarianKills(YieldTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < NUM_YIELD_TYPES, "eIndex is expected to be within maximum bounds (invalid Index)"); if(iChange != 0) { @@ -26427,8 +26427,8 @@ void CvUnit::changeYieldFromBarbarianKills(YieldTypes eIndex, int iChange) int CvUnit::getExtraUnitCombatModifier(UnitCombatTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_extraUnitCombatModifier[eIndex]; } @@ -26437,8 +26437,8 @@ int CvUnit::getExtraUnitCombatModifier(UnitCombatTypes eIndex) const void CvUnit::changeExtraUnitCombatModifier(UnitCombatTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitCombatClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_extraUnitCombatModifier[eIndex] = m_extraUnitCombatModifier[eIndex] + iChange; } @@ -26447,8 +26447,8 @@ void CvUnit::changeExtraUnitCombatModifier(UnitCombatTypes eIndex, int iChange) int CvUnit::getUnitClassModifier(UnitClassTypes eIndex) const { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); return m_unitClassModifier[eIndex]; } @@ -26457,15 +26457,15 @@ int CvUnit::getUnitClassModifier(UnitClassTypes eIndex) const void CvUnit::changeUnitClassModifier(UnitClassTypes eIndex, int iChange) { VALIDATE_OBJECT - CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); - CvAssertMsg(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); + ASSERT(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)"); + ASSERT(eIndex < GC.getNumUnitClassInfos(), "eIndex is expected to be within maximum bounds (invalid Index)"); m_unitClassModifier[eIndex] = m_unitClassModifier[eIndex] + iChange; } // -------------------------------------------------------------------------------- std::pair CvUnit::getYieldFromPillage(YieldTypes eYield) const { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); - CvAssertMsg(eYield > NO_YIELD, "Yield index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); + ASSERT(eYield > NO_YIELD, "Yield index out of bounds"); const std::map>::const_iterator it = m_yieldFromPillage.find(static_cast(eYield)); if (it != m_yieldFromPillage.end()) @@ -26478,8 +26478,8 @@ std::pair CvUnit::getYieldFromPillage(YieldTypes eYield) const { // -------------------------------------------------------------------------------- void CvUnit::changeYieldFromPillage(YieldTypes eYield, std::pair change) { - CvAssertMsg(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); - CvAssertMsg(eYield > NO_YIELD, "Yield index out of bounds"); + ASSERT(eYield < NUM_YIELD_TYPES, "Yield index out of bounds"); + ASSERT(eYield > NO_YIELD, "Yield index out of bounds"); if ((change.first != 0 || change.second != 0) && eYield > NO_YIELD && eYield < NUM_YIELD_TYPES) { @@ -26506,8 +26506,8 @@ void CvUnit::changeYieldFromPillage(YieldTypes eYield, std::pair chang bool CvUnit::canAcquirePromotion(PromotionTypes ePromotion) const { VALIDATE_OBJECT - CvAssertMsg(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); - CvAssertMsg(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); + ASSERT(ePromotion >= 0, "ePromotion is expected to be non-negative (invalid Index)"); + ASSERT(ePromotion < GC.getNumPromotionInfos(), "ePromotion is expected to be within maximum bounds (invalid Index)"); CvPromotionEntry* pkPromotionInfo = GC.getPromotionInfo(ePromotion); if(pkPromotionInfo == NULL) @@ -28284,7 +28284,7 @@ bool CvUnit::canRangeStrikeAt(int iX, int iY, bool bNeedWar, bool bNoncombatAllo // If it is a City, only consider those we're at war with else { - CvAssert(pTargetPlot->getPlotCity() != NULL); + ASSERT(pTargetPlot->getPlotCity() != NULL); // If you're already at war don't need to check if(!atWar(getTeam(), pTargetPlot->getPlotCity()->getTeam())) @@ -28546,7 +28546,7 @@ void CvUnit::changeAlwaysHostileCount(int iValue) { VALIDATE_OBJECT m_iAlwaysHostileCount += iValue; - CvAssert(getAlwaysHostileCount() >= 0); + ASSERT(getAlwaysHostileCount() >= 0); } @@ -28775,7 +28775,7 @@ ActivityTypes CvUnit::GetActivityType() const void CvUnit::SetActivityType(ActivityTypes eNewValue) { VALIDATE_OBJECT - CvAssert(getOwner() != NO_PLAYER); + ASSERT(getOwner() != NO_PLAYER); ActivityTypes eOldActivity = GetActivityType(); if(eOldActivity != eNewValue) @@ -28814,7 +28814,7 @@ bool CvUnit::IsAutomated() const void CvUnit::SetAutomateType(AutomateTypes eNewValue) { VALIDATE_OBJECT - CvAssert(getOwner() != NO_PLAYER); + ASSERT(getOwner() != NO_PLAYER); if(GetAutomateType() != eNewValue) { @@ -29253,7 +29253,7 @@ CvUnit::MoveResult CvUnit::UnitAttackWithMove(int iX, int iY, int iFlags) CvMap& kMap = GC.getMap(); CvPlot* pDestPlot = kMap.plot(iX, iY); - CvAssertMsg(pDestPlot != NULL, "DestPlot is not assigned a valid value"); + ASSERT(pDestPlot != NULL, "DestPlot is not assigned a valid value"); if(!pDestPlot) return CvUnit::MOVE_RESULT_CANCEL; @@ -29625,8 +29625,8 @@ bool CvUnit::UnitBuild(BuildTypes eBuild) CvPlot* pPlot = plot(); bool bContinue = false; - CvAssert(getOwner() != NO_PLAYER); - CvAssertMsg(eBuild < GC.getNumBuildInfos(), "Invalid Build"); + ASSERT(getOwner() != NO_PLAYER); + ASSERT(eBuild < GC.getNumBuildInfos(), "Invalid Build"); CvBuildInfo* pkBuildInfo = GC.getBuildInfo(eBuild); if (pkBuildInfo) @@ -29651,7 +29651,7 @@ bool CvUnit::UnitBuild(BuildTypes eBuild) } } - CvAssertMsg(atPlot(*pPlot), "Unit is expected to be at pPlot"); + ASSERT(atPlot(*pPlot), "Unit is expected to be at pPlot"); // Don't check for Gold cost here (2nd false) because this function is called from continueMission... we spend the Gold then check to see if we can Build if(canBuild(pPlot, eBuild, false, false)) @@ -29671,7 +29671,7 @@ bool CvUnit::UnitBuild(BuildTypes eBuild) bool CvUnit::CanDoInterfaceMode(InterfaceModeTypes eInterfaceMode, bool bTestVisibility) { VALIDATE_OBJECT - CvAssertMsg(eInterfaceMode != NO_INTERFACEMODE, "InterfaceMode is not assigned a valid value"); + ASSERT(eInterfaceMode != NO_INTERFACEMODE, "InterfaceMode is not assigned a valid value"); if(IsBusy()) { @@ -30025,12 +30025,12 @@ int CvUnit::GetMissionTimer() const void CvUnit::SetMissionTimer(int iNewValue) { VALIDATE_OBJECT - CvAssert(getOwner() != NO_PLAYER); + ASSERT(getOwner() != NO_PLAYER); int iOldTimer = m_iMissionTimer; m_iMissionTimer = iNewValue; - CvAssert(GetMissionTimer() >= 0); + ASSERT(GetMissionTimer() >= 0); int iNewTimer = m_iMissionTimer; @@ -30062,7 +30062,7 @@ void CvUnit::ChangeMissionTimer(int iChange) void CvUnit::ClearMissionQueue(bool bKeepPathCache, int iUnitCycleTimer) { VALIDATE_OBJECT - CvAssert(getOwner() != NO_PLAYER); + ASSERT(getOwner() != NO_PLAYER); //make sure to show the latest status in the GUI PublishQueuedVisualizationMoves(); @@ -30440,9 +30440,9 @@ bool CvUnit::CachedPathIsSafeForCivilian() const bool CvUnit::canAdvance(const CvPlot& plot, int iThreshold) const { VALIDATE_OBJECT - CvAssert(IsCombatUnit()); - CvAssert(getDomainType() != DOMAIN_AIR); - CvAssert(getDomainType() != DOMAIN_IMMOBILE); + ASSERT(IsCombatUnit()); + ASSERT(getDomainType() != DOMAIN_AIR); + ASSERT(getDomainType() != DOMAIN_IMMOBILE); if(plot.getNumVisibleEnemyDefenders(this) > iThreshold) { @@ -30802,7 +30802,7 @@ UnitAITypes CvUnit::AI_getUnitAIType() const void CvUnit::AI_setUnitAIType(UnitAITypes eNewValue) { VALIDATE_OBJECT - CvAssertMsg(eNewValue != NO_UNITAI, "NewValue is not assigned a valid value"); + ASSERT(eNewValue != NO_UNITAI, "NewValue is not assigned a valid value"); if(AI_getUnitAIType() != eNewValue) { @@ -30948,7 +30948,7 @@ int CvUnit::AI_promotionValue(PromotionTypes ePromotion) if(pkPromotionInfo == NULL) { //This function really really really should not be called with an invalid promotion type. - CvAssert(pkPromotionInfo); + ASSERT(pkPromotionInfo); return 0; } @@ -32968,7 +32968,7 @@ void CvUnit::RemoveCargoPromotions(CvUnit& cargounit) void CvUnit::DoGreatPersonSpawnBonus(CvCity* pSpawnCity) { - CvAssert(pSpawnCity); + ASSERT(pSpawnCity); if (!IsGreatPerson()) return; @@ -33035,7 +33035,7 @@ void CvUnit::DoGreatPersonSpawnBonus(CvCity* pSpawnCity) if (isCultureBoost()) { // Can't possibly have no capital when there's a spawn city - CvAssert(kPlayer.getCapitalCity()); + ASSERT(kPlayer.getCapitalCity()); int iValue = kPlayer.GetTotalJONSCulturePerTurn() * 4; kPlayer.changeJONSCulture(iValue); diff --git a/CvGameCoreDLL_Expansion2/CvUnitClasses.cpp b/CvGameCoreDLL_Expansion2/CvUnitClasses.cpp index 909aa48b16..db3d88e2af 100644 --- a/CvGameCoreDLL_Expansion2/CvUnitClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnitClasses.cpp @@ -1454,128 +1454,128 @@ int CvUnitEntry::CargoCombat() const /// Prerequisite techs with AND int CvUnitEntry::GetPrereqAndTechs(int i) const { - CvAssertMsg(i < /*3*/ GD_INT_GET(NUM_UNIT_AND_TECH_PREREQS), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < /*3*/ GD_INT_GET(NUM_UNIT_AND_TECH_PREREQS), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piPrereqAndTechs ? m_piPrereqAndTechs[i] : -1; } /// Resources consumed to construct int CvUnitEntry::GetResourceQuantityRequirement(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityRequirements ? m_piResourceQuantityRequirements[i] : -1; } /// Resources consumed to construct int CvUnitEntry::GetResourceQuantityExpended(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piResourceQuantityExpended ? m_piResourceQuantityExpended[i] : -1; } /// Production boost for having a specific building in city int CvUnitEntry::GetBuildingProductionModifier(BuildingTypes eBuilding) const { - CvAssertMsg((int)eBuilding < GC.getNumBuildingInfos(), "Building type out of bounds"); - CvAssertMsg((int)eBuilding > -1, "Index out of bounds"); + ASSERT((int)eBuilding < GC.getNumBuildingInfos(), "Building type out of bounds"); + ASSERT((int)eBuilding > -1, "Index out of bounds"); return m_piProductionModifierBuildings[(int)eBuilding]; } /// Do we get one of our yields from defeating an enemy? int CvUnitEntry::GetYieldFromKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromKills[(int)eYield]; } /// Do we get one of our yields from defeating a barbarian? int CvUnitEntry::GetYieldFromBarbarianKills(YieldTypes eYield) const { - CvAssertMsg((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); - CvAssertMsg((int)eYield > -1, "Index out of bounds"); + ASSERT((int)eYield < NUM_YIELD_TYPES, "Yield type out of bounds"); + ASSERT((int)eYield > -1, "Index out of bounds"); return m_piYieldFromBarbarianKills[(int)eYield]; } /// Boost in production for leader with this trait int CvUnitEntry::GetProductionTraits(int i) const { - CvAssertMsg(i < GC.getNumTraitInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumTraitInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piProductionTraits ? m_piProductionTraits[i] : -1; } /// Find value of flavors associated with this building int CvUnitEntry::GetFlavorValue(int i) const { - CvAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumFlavorTypes(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piFlavorValue ? m_piFlavorValue[i] : 0; } /// What can this unit upgrade into? bool CvUnitEntry::GetUpgradeUnitClass(int i) const { - CvAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbUpgradeUnitClass ? m_pbUpgradeUnitClass[i] : false; } /// What AIs strategies can this unit adopt bool CvUnitEntry::GetUnitAIType(int i) const { - CvAssertMsg(i < NUM_UNITAI_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_UNITAI_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbUnitAIType ? m_pbUnitAIType[i] : false; } /// AI strategies this unit can NOT adopt bool CvUnitEntry::GetNotUnitAIType(int i) const { - CvAssertMsg(i < NUM_UNITAI_TYPES, "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < NUM_UNITAI_TYPES, "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbNotUnitAIType ? m_pbNotUnitAIType[i] : false; } /// What improvements can this unit build? bool CvUnitEntry::GetBuilds(int i) const { - CvAssertMsg(i < GC.getNumBuildInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuilds ? m_pbBuilds[i] : false; } /// Type(s) of great people represented by this unit bool CvUnitEntry::GetGreatPeoples(int i) const { - CvAssertMsg(i < GC.getNumSpecialistInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumSpecialistInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbGreatPeoples ? m_pbGreatPeoples[i] : false; } /// Is this unit required to construct a certain building? bool CvUnitEntry::GetBuildings(int i) const { - CvAssertMsg(i < GC.getNumBuildingInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildings ? m_pbBuildings[i] : false; } /// Does this Unit need a certain BuildingClass in this City to train? bool CvUnitEntry::GetBuildingClassRequireds(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildingClassRequireds ? m_pbBuildingClassRequireds[i] : false; } int CvUnitEntry::GetScalingFromOwnedImprovements(int i) const { - CvAssertMsg(i < GC.getNumImprovementInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumImprovementInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piScalingFromOwnedImprovements ? m_piScalingFromOwnedImprovements[i] : -1; } @@ -1583,32 +1583,32 @@ int CvUnitEntry::GetScalingFromOwnedImprovements(int i) const /// Does this Unit create something when it founds a city? bool CvUnitEntry::GetBuildOnFound(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildOnFound? m_pbBuildOnFound[i] : false; } /// Does this Unit need a certain BuildingClass in this City to purchase? bool CvUnitEntry::GetBuildingClassPurchaseRequireds(int i) const { - CvAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumBuildingClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbBuildingClassPurchaseRequireds ? m_pbBuildingClassPurchaseRequireds[i] : false; } /// Does this Unit get a new combat strength when reaching a new Era? int CvUnitEntry::GetEraCombatStrength(int i) const { - CvAssertMsg(i < GC.getNumEraInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_piEraCombatStrength ? m_piEraCombatStrength[i] : -1; } /// Accessor:: Does this Unit have a different CombatType in a new Era? int CvUnitEntry::GetUnitNewEraCombatType(int i, int j) const { - CvAssertMsg(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < GC.getNumEraInfos(), "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumUnitCombatClassInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiEraUnitCombatType ? m_ppiEraUnitCombatType[i][j] : 0; } int* CvUnitEntry::GetUnitNewEraCombatTypeChangesArray(int i) @@ -1618,10 +1618,10 @@ int* CvUnitEntry::GetUnitNewEraCombatTypeChangesArray(int i) /// Accessor:: Does this Unit get promotions in a new Era? int CvUnitEntry::GetUnitNewEraPromotions(int i, int j) const { - CvAssertMsg(i < GC.getNumPromotionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); - CvAssertMsg(j < GC.getNumEraInfos(), "Index out of bounds"); - CvAssertMsg(j > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPromotionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); + ASSERT(j < GC.getNumEraInfos(), "Index out of bounds"); + ASSERT(j > -1, "Index out of bounds"); return m_ppiEraUnitPromotions ? m_ppiEraUnitPromotions[i][j] : 0; } @@ -1634,8 +1634,8 @@ int* CvUnitEntry::GetUnitNewEraPromotionsChangesArray(int i) /// Player must have gross number of resources to build (does not consume) int CvUnitEntry::GetResourceQuantityTotal(int i) const { - CvAssertMsg(i < GC.getNumResourceInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumResourceInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); std::map::const_iterator itResource = m_piResourceQuantityTotals.find(i); if (itResource != m_piResourceQuantityTotals.end()) // find returns the iterator to map::end if the key iResource is not present in the map @@ -1649,8 +1649,8 @@ int CvUnitEntry::GetResourceQuantityTotal(int i) const /// Initial set of promotions for this unit bool CvUnitEntry::GetFreePromotions(int i) const { - CvAssertMsg(i < GC.getNumPromotionInfos(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GC.getNumPromotionInfos(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return m_pbFreePromotions ? m_pbFreePromotions[i] : false; } @@ -1701,16 +1701,16 @@ const bool CvUnitEntry::GetUnitArtInfoEraVariation() const /// Unique names for individual units (for great people) const char* CvUnitEntry::GetUnitNames(int i) const { - CvAssertMsg(i < GetNumUnitNames(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumUnitNames(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return (m_paszUnitNames) ? m_paszUnitNames[i] : NULL; } /// Unique great works created by individual units. GreatWorkType CvUnitEntry::GetGreatWorks(int i) const { - CvAssertMsg(i < GetNumUnitNames(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumUnitNames(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return (m_paeGreatWorks) ? m_paeGreatWorks[i] : NO_GREAT_WORK; } @@ -1727,8 +1727,8 @@ bool CvUnitEntry::IsGreatWorkUnit() const /// Unique era for individual units. EraTypes CvUnitEntry::GetGreatPersonEra(int i) const { - CvAssertMsg(i < GetNumUnitNames(), "Index out of bounds"); - CvAssertMsg(i > -1, "Index out of bounds"); + ASSERT(i < GetNumUnitNames(), "Index out of bounds"); + ASSERT(i > -1, "Index out of bounds"); return (m_paeGreatPersonEra) ? m_paeGreatPersonEra[i] : NO_ERA; } /// Resource required for this unit diff --git a/CvGameCoreDLL_Expansion2/CvUnitCombat.cpp b/CvGameCoreDLL_Expansion2/CvUnitCombat.cpp index 840488f789..06c56b5663 100644 --- a/CvGameCoreDLL_Expansion2/CvUnitCombat.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnitCombat.cpp @@ -723,7 +723,7 @@ void CvUnitCombat::GenerateRangedCombatInfo(CvUnit& kAttacker, CvUnit* pkDefende PlayerTypes eDefenderOwner; if(!plot.isCity()) { - CvAssert(pkDefender != NULL); + ASSERT(pkDefender != NULL); eDefenderOwner = pkDefender->getOwner(); @@ -732,7 +732,7 @@ void CvUnitCombat::GenerateRangedCombatInfo(CvUnit& kAttacker, CvUnit* pkDefende bBarbarian = true; iMaxXP = pkDefender->maxXPValue(); - //CvAssert(pkDefender->IsCanDefend()); + //ASSERT(pkDefender->IsCanDefend()); iDamage = kAttacker.GetRangeCombatDamage(pkDefender, /*pCity*/ NULL, /*bIncludeRand*/ bIncludeRand); #if defined(MOD_BALANCE_CORE) @@ -762,7 +762,7 @@ void CvUnitCombat::GenerateRangedCombatInfo(CvUnit& kAttacker, CvUnit* pkDefende if (kAttacker.isRangedSupportFire()) return; // can't attack cities with this CvCity* pCity = plot.getPlotCity(); - CvAssert(pCity != NULL); + ASSERT(pCity != NULL); if(!pCity) return; BATTLE_JOINED(pCity, BATTLE_UNIT_DEFENDER, true); @@ -912,14 +912,14 @@ void CvUnitCombat::GenerateRangedCombatInfo(CvCity& kAttacker, CvUnit* pkDefende PlayerTypes eDefenderOwner = NO_PLAYER; if(!plot.isCity()) { - CvAssert(pkDefender != NULL); + ASSERT(pkDefender != NULL); eDefenderOwner = pkDefender->getOwner(); if(pkDefender->isBarbarian()) bBarbarian = true; - //CvAssert(pkDefender->IsCanDefend()); + //ASSERT(pkDefender->IsCanDefend()); iDamage = kAttacker.rangeCombatDamage(pkDefender,bIncludeRand); #if defined(MOD_BALANCE_CORE) @@ -943,7 +943,7 @@ void CvUnitCombat::GenerateRangedCombatInfo(CvCity& kAttacker, CvUnit* pkDefende } else { - FAssertMsg(false, "City vs. City not supported."); // Don't even think about it Jon.... + ASSERT(false, "City vs. City not supported."); // Don't even think about it Jon.... } ////////////////////////////////////////////////////////////////////// @@ -1343,7 +1343,7 @@ void CvUnitCombat::ResolveRangedCityVsUnitCombat(const CvCombatInfo& kCombatInfo } else { - CvAssert(false); // Left as an exercise for the reader + ASSERT(false); // Left as an exercise for the reader bTargetDied = true; } } @@ -1627,7 +1627,7 @@ void CvUnitCombat::GenerateAirCombatInfo(CvUnit& kAttacker, CvUnit* pkDefender, // Special: Missiles always attack the unit, even when it's in a city if(!plot.isCity() || kAttacker.AI_getUnitAIType() == UNITAI_MISSILE_AIR ) { - CvAssert(pkDefender != NULL); + ASSERT(pkDefender != NULL); if(!pkDefender) return; @@ -1687,7 +1687,7 @@ void CvUnitCombat::GenerateAirCombatInfo(CvUnit& kAttacker, CvUnit* pkDefender, else { CvCity* pCity = plot.getPlotCity(); - CvAssert(pCity != NULL); + ASSERT(pCity != NULL); if(!pCity) return; BATTLE_JOINED(pCity, BATTLE_UNIT_DEFENDER, true); @@ -3118,7 +3118,7 @@ void CvUnitCombat::GenerateNuclearExplosionDamage(CvPlot* pkTargetPlot, int iDam } else { - CvAssertMsg(*piDamageMembers < iMaxDamageMembers, "Ran out of entries for the nuclear damage array"); + ASSERT(*piDamageMembers < iMaxDamageMembers, "Ran out of entries for the nuclear damage array"); } } } @@ -3180,7 +3180,7 @@ void CvUnitCombat::GenerateNuclearExplosionDamage(CvPlot* pkTargetPlot, int iDam } else { - CvAssertMsg(*piDamageMembers < iMaxDamageMembers, "Ran out of entries for the nuclear damage array"); + ASSERT(*piDamageMembers < iMaxDamageMembers, "Ran out of entries for the nuclear damage array"); } } } @@ -3245,7 +3245,7 @@ void CvUnitCombat::ResolveNuclearCombat(const CvCombatInfo& kCombatInfo, uint ui } else { - CvAssertMsg(pkAttacker->isSuicide(), "A nuke unit that is not a one time use?"); + ASSERT(pkAttacker->isSuicide(), "A nuke unit that is not a one time use?"); // Clean up some stuff pkAttacker->setCombatUnit(NULL); @@ -3269,8 +3269,8 @@ void CvUnitCombat::ResolveNuclearCombat(const CvCombatInfo& kCombatInfo, uint ui #if defined(MOD_GLOBAL_PARATROOPS_AA_DAMAGE) // --------------------------------------------------------------------------- bool CvUnitCombat::ParadropIntercept(CvUnit& paraUnit, CvPlot& dropPlot) { - CvAssertMsg(!paraUnit.isDelayedDeath(), "Trying to paradrop and the unit is already dead!"); - CvAssert(paraUnit.getCombatTimer() == 0); + ASSERT(!paraUnit.isDelayedDeath(), "Trying to paradrop and the unit is already dead!"); + ASSERT(paraUnit.getCombatTimer() == 0); // Any interception to be done? CvUnit* pInterceptor = dropPlot.GetBestInterceptor(paraUnit.getOwner(), ¶Unit); @@ -3747,14 +3747,14 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::Attack(CvUnit& kAttacker, CvPlot& targ CvString strBuffer; //VALIDATE_OBJECT - CvAssert(kAttacker.canMoveInto(targetPlot, CvUnit::MOVEFLAG_ATTACK )); - CvAssert(kAttacker.getCombatTimer() == 0); + ASSERT(kAttacker.canMoveInto(targetPlot, CvUnit::MOVEFLAG_ATTACK )); + ASSERT(kAttacker.getCombatTimer() == 0); CvUnitCombat::ATTACK_RESULT eResult = CvUnitCombat::ATTACK_ABORTED; - CvAssert(kAttacker.getCombatTimer() == 0); - // CvAssert(pDefender != NULL); - CvAssert(!kAttacker.isFighting()); + ASSERT(kAttacker.getCombatTimer() == 0); + // ASSERT(pDefender != NULL); + ASSERT(!kAttacker.isFighting()); CvUnit* pDefender = targetPlot.getBestDefender(NO_PLAYER, kAttacker.getOwner(), &kAttacker, true); if(!pDefender) @@ -3795,7 +3795,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::Attack(CvUnit& kAttacker, CvPlot& targ CvCombatInfo kCombatInfo; GenerateMeleeCombatInfo(kAttacker, pDefender, targetPlot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); + ASSERT(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); if (pDefender->CheckWithdrawal(kAttacker) && pDefender->DoFallBack(kAttacker, true)) { @@ -3855,7 +3855,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::Attack(CvUnit& kAttacker, CvPlot& targ CvMissionInfo* pkSurrenderMission = GC.getMissionInfo(CvTypes::getMISSION_SURRENDER()); if(pkSurrenderMission == NULL) { - CvAssert(false); + ASSERT(false); } else { @@ -3919,7 +3919,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::Attack(CvUnit& kAttacker, CvPlot& targ CvUnit* pFireSupportUnit = GetFireSupportUnit(pDefender->getOwner(), pDefender->getX(), pDefender->getY(), kAttacker.getX(), kAttacker.getY()); if(pFireSupportUnit != NULL) { - CvAssertMsg(!pFireSupportUnit->isDelayedDeath(), "Supporting battle unit is already dead!"); + ASSERT(!pFireSupportUnit->isDelayedDeath(), "Supporting battle unit is already dead!"); eSupportResult = AttackRanged(*pFireSupportUnit, kAttacker.getX(), kAttacker.getY(), CvUnitCombat::ATTACK_OPTION_NO_DEFENSIVE_SUPPORT); } @@ -3979,7 +3979,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackRanged(CvUnit& kAttacker, int iX CvPlot* pPlot = GC.getMap().plot(iX, iY); ATTACK_RESULT eResult = ATTACK_ABORTED; - CvAssertMsg(kAttacker.getDomainType() != DOMAIN_AIR, "Air units should not use AttackRanged, they should just MoveTo the target"); + ASSERT(kAttacker.getDomainType() != DOMAIN_AIR, "Air units should not use AttackRanged, they should just MoveTo the target"); if(NULL == pPlot) { @@ -4024,7 +4024,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackRanged(CvUnit& kAttacker, int iX CvCombatInfo kCombatInfo; CvUnitCombat::GenerateRangedCombatInfo(kAttacker, pDefender, *pPlot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); + ASSERT(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); if (!kAttacker.isRangedSupportFire()) { @@ -4062,7 +4062,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackRanged(CvUnit& kAttacker, int iX { CvCombatInfo kCombatInfo; GenerateRangedCombatInfo(kAttacker, NULL, *pPlot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); + ASSERT(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); kAttacker.setMadeAttack(true); kAttacker.changeMoves(-GD_INT_GET(MOVE_DENOMINATOR)); @@ -4107,7 +4107,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackRanged(CvUnit& kAttacker, int iX CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAir(CvUnit& kAttacker, CvPlot& targetPlot, ATTACK_OPTION /* eOption */) { //VALIDATE_OBJECT - CvAssert(kAttacker.getCombatTimer() == 0); + ASSERT(kAttacker.getCombatTimer() == 0); CvUnitCombat::ATTACK_RESULT eResult = CvUnitCombat::ATTACK_ABORTED; @@ -4147,7 +4147,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAir(CvUnit& kAttacker, CvPlot& t CvCombatInfo kCombatInfo; CvUnitCombat::GenerateAirCombatInfo(kAttacker, pDefender, targetPlot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); + ASSERT(!kAttacker.isDelayedDeath() && !pDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); kAttacker.setMadeAttack(true); uint uiParentEventID = 0; @@ -4184,7 +4184,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAir(CvUnit& kAttacker, CvPlot& t { CvCombatInfo kCombatInfo; CvUnitCombat::GenerateAirCombatInfo(kAttacker, NULL, targetPlot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); + ASSERT(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); kAttacker.setMadeAttack(true); uint uiParentEventID = 0; @@ -4224,7 +4224,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAir(CvUnit& kAttacker, CvPlot& t CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAirSweep(CvUnit& kAttacker, CvPlot& targetPlot, ATTACK_OPTION /* eOption */) { //VALIDATE_OBJECT - CvAssert(kAttacker.getCombatTimer() == 0); + ASSERT(kAttacker.getCombatTimer() == 0); CvUnitCombat::ATTACK_RESULT eResult = CvUnitCombat::ATTACK_ABORTED; @@ -4247,7 +4247,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackAirSweep(CvUnit& kAttacker, CvPl CvUnit* pkDefender = kCombatInfo.getUnit(BATTLE_UNIT_DEFENDER); pkDefender->SetAutomateType(NO_AUTOMATE); - CvAssertMsg(!kAttacker.isDelayedDeath() && !pkDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); + ASSERT(!kAttacker.isDelayedDeath() && !pkDefender->isDelayedDeath(), "Trying to battle and one of the units is already dead!"); uint uiParentEventID = 0; bool bDoImmediate = CvPreGame::quickCombat(); @@ -4328,7 +4328,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackCity(CvUnit& kAttacker, CvPlot& ATTACK_RESULT eResult = ATTACK_ABORTED; CvCity* pCity = plot.getPlotCity(); - CvAssertMsg(pCity != NULL, "If this unit is attacking a NULL city then something funky is goin' down"); + ASSERT(pCity != NULL, "If this unit is attacking a NULL city then something funky is goin' down"); if(!pCity) return eResult; kAttacker.SetAutomateType(NO_AUTOMATE); @@ -4357,7 +4357,7 @@ CvUnitCombat::ATTACK_RESULT CvUnitCombat::AttackCity(CvUnit& kAttacker, CvPlot& // We are doing a non-ranged attack on a city CvCombatInfo kCombatInfo; GenerateMeleeCombatInfo(kAttacker, NULL, plot, &kCombatInfo); - CvAssertMsg(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); + ASSERT(!kAttacker.isDelayedDeath(), "Trying to battle and the attacker is already dead!"); kAttacker.setMadeAttack(true); // Send the combat message if the target plot is visible. diff --git a/CvGameCoreDLL_Expansion2/CvUnitCycler.cpp b/CvGameCoreDLL_Expansion2/CvUnitCycler.cpp index 5bc47301ed..dcad660dea 100644 --- a/CvGameCoreDLL_Expansion2/CvUnitCycler.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnitCycler.cpp @@ -100,7 +100,7 @@ void CvUnitCycler::Rebuild(CvUnit* pkStartUnit /* = NULL */) } } - CvAssertMsg(pBestUnit, "Didn't find a unit to add to cycle list."); + ASSERT(pBestUnit, "Didn't find a unit to add to cycle list."); if (pBestUnit) { @@ -199,7 +199,7 @@ CvUnit* CvUnitCycler::Cycle(CvUnit* pUnit, bool bForward, bool bWorkers, bool* p while (true) { CvUnit* pLoopUnit = m_pkPlayer->getUnit(pUnitNode->m_data); - CvAssertMsg(pLoopUnit, "LoopUnit is not assigned a valid value"); + ASSERT(pLoopUnit, "LoopUnit is not assigned a valid value"); if (pLoopUnit && pLoopUnit->ReadyToSelect()) { diff --git a/CvGameCoreDLL_Expansion2/CvUnitMission.cpp b/CvGameCoreDLL_Expansion2/CvUnitMission.cpp index 9816371f26..43f0c92d6d 100644 --- a/CvGameCoreDLL_Expansion2/CvUnitMission.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnitMission.cpp @@ -59,7 +59,7 @@ /// Perform automated mission void CvUnitMission::AutoMission(CvUnit* hUnit) { - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); const MissionData* pkMissionNode = HeadMissionData(hUnit->m_missionQueue); if(pkMissionNode != NULL) @@ -102,14 +102,14 @@ void CvUnitMission::PushMission(CvUnit* hUnit, MissionTypes eMission, int iData1 { if(CvPreGame::isHuman(hUnit->getOwner())) { - CvAssertMsg(CvUnit::dispatchingNetMessage(), "Multiplayer Error! CvUnit::PushMission invoked for a human player outside of a network message!"); + ASSERT(CvUnit::dispatchingNetMessage(), "Multiplayer Error! CvUnit::PushMission invoked for a human player outside of a network message!"); if(!CvUnit::dispatchingNetMessage()) gDLL->netMessageDebugLog("*** PROTOCOL ERROR *** : PushMission invoked for a human controlled player outside of a network message!"); } MissionData mission; - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); if (!bAppend) { @@ -228,7 +228,7 @@ void CvUnitMission::PushMission(CvUnit* hUnit, MissionTypes eMission, int iData1 /// Retrieve next mission void CvUnitMission::PopMission(CvUnit* hUnit) { - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); // Update Resource info if(hUnit->getBuildType() != NO_BUILD) @@ -297,12 +297,12 @@ void CvUnitMission::WaitFor(CvUnit* hUnit, CvUnit* hWaitForUnit) { if(CvPreGame::isHuman(hUnit->getOwner())) { - CvAssertMsg(CvUnit::dispatchingNetMessage(), "Multiplayer Error! CvUnit::PushMission invoked for a human player outside of a network message!"); + ASSERT(CvUnit::dispatchingNetMessage(), "Multiplayer Error! CvUnit::PushMission invoked for a human player outside of a network message!"); if(!CvUnit::dispatchingNetMessage()) gDLL->netMessageDebugLog("*** PROTOCOL ERROR *** : PushMission invoked for a human controlled player outside of a network message!"); } - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); MissionData mission; mission.eMissionType = CvTypes::getMISSION_WAIT_FOR(); @@ -316,7 +316,7 @@ void CvUnitMission::WaitFor(CvUnit* hUnit, CvUnit* hWaitForUnit) // Insert head of mission list kQueue.insertAtBeginning(&mission); - CvAssert(kQueue.getLength() < 10); + ASSERT(kQueue.getLength() < 10); if((hUnit->getOwner() == GC.getGame().getActivePlayer()) && hUnit->IsSelected()) { @@ -369,10 +369,10 @@ void CvUnitMission::ContinueMission(CvUnit* hUnit, int iSteps) bool bDone = false; // are we done with mission? bool bAction = false; // are we taking an action this turn? - CvAssert(!hUnit->isInCombat()); - CvAssert(hUnit->HeadMissionData() != NULL); - CvAssert(hUnit->getOwner() != NO_PLAYER); - CvAssert(hUnit->GetActivityType() == ACTIVITY_MISSION); + ASSERT(!hUnit->isInCombat()); + ASSERT(hUnit->HeadMissionData() != NULL); + ASSERT(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->GetActivityType() == ACTIVITY_MISSION); if(HeadMissionData(hUnit->m_missionQueue) == NULL) { @@ -381,7 +381,7 @@ void CvUnitMission::ContinueMission(CvUnit* hUnit, int iSteps) return; } - CvAssert(iSteps < 100); + ASSERT(iSteps < 100); if(iSteps >= 100) { OutputDebugString("warning: endless loop in ContinueMission\n"); @@ -1049,8 +1049,8 @@ bool CvUnitMission::CanStartMission(CvUnit* hUnit, int iMission, int iData1, int } else if(iMission == CvTypes::getMISSION_MOVE_TO_UNIT()) { - CvAssertMsg(iData1 != NO_PLAYER, "iData1 should be a valid Player"); - CvAssertMsg(iData2 != NO_UNIT, "iData2 should be a valid Unit ID"); + ASSERT(iData1 != NO_PLAYER, "iData1 should be a valid Player"); + ASSERT(iData2 != NO_UNIT, "iData2 should be a valid Unit ID"); if (iData1 != NO_PLAYER && iData2 != NO_UNIT) { pTargetUnit = GET_PLAYER((PlayerTypes)iData1).getUnit(iData2); @@ -1280,7 +1280,7 @@ bool CvUnitMission::CanStartMission(CvUnit* hUnit, int iMission, int iData1, int } else if(iMission == CvTypes::getMISSION_BUILD()) { - CvAssertMsg(((BuildTypes)iData1) < GC.getNumBuildInfos(), "Invalid Build"); + ASSERT(((BuildTypes)iData1) < GC.getNumBuildInfos(), "Invalid Build"); if(hUnit->canBuild(pPlot, ((BuildTypes)iData1), bTestVisible)) { return true; @@ -1392,11 +1392,11 @@ void CvUnitMission::StartMission(CvUnit* hUnit) static int stackDepth = 0; ++stackDepth; // JAR debugging - CvAssert(stackDepth < 100); + ASSERT(stackDepth < 100); - CvAssert(!hUnit->IsBusy()); - CvAssert(hUnit->getOwner() != NO_PLAYER); - CvAssert(hUnit->HeadMissionData() != NULL); + ASSERT(!hUnit->IsBusy()); + ASSERT(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->HeadMissionData() != NULL); CvPlayerAI& kUnitOwner = GET_PLAYER(hUnit->getOwner()); @@ -1437,7 +1437,7 @@ void CvUnitMission::StartMission(CvUnit* hUnit) } else { - CvAssertMsg(kUnitOwner.isTurnActive() || kUnitOwner.isHuman(), "It's expected that either the turn is active for this player or the player is human"); + ASSERT(kUnitOwner.isTurnActive() || kUnitOwner.isHuman(), "It's expected that either the turn is active for this player or the player is human"); if(pkQueueData->eMissionType == CvTypes::getMISSION_SKIP()) { @@ -1500,7 +1500,7 @@ void CvUnitMission::StartMission(CvUnit* hUnit) if(bNotify) { // The entity should not futz with the missions, but... - CvAssert(GetHeadMissionData(hUnit) == pkQueueData); + ASSERT(GetHeadMissionData(hUnit) == pkQueueData); pkQueueData = GetHeadMissionData(hUnit); } @@ -1751,7 +1751,7 @@ void CvUnitMission::StartMission(CvUnit* hUnit) else if (pkQueueData->eMissionType == CvTypes::getMISSION_ESTABLISH_TRADE_ROUTE()) { CvPlot* pPlot = GC.getMap().plotByIndex(pkQueueData->iData1); - CvAssertMsg(pPlot, "pPlot is null! OH NOES, JOEY!"); + ASSERT(pPlot, "pPlot is null! OH NOES, JOEY!"); if (pPlot) { if (GC.getGame().isNetworkMultiPlayer()) @@ -1830,7 +1830,7 @@ void CvUnitMission::StartMission(CvUnit* hUnit) if(eImprovement != NO_IMPROVEMENT) { CvImprovementEntry* pkImprovementInfo = GC.getImprovementInfo(eImprovement); - CvAssert(pkImprovementInfo); + ASSERT(pkImprovementInfo); if(pkImprovementInfo) { iNumResource += pkImprovementInfo->GetResourceQuantityRequirement(iResourceLoop); @@ -1839,7 +1839,7 @@ void CvUnitMission::StartMission(CvUnit* hUnit) else if(eRoute != NO_ROUTE) { CvRouteInfo* pkRouteInfo = GC.getRouteInfo(eRoute); - CvAssert(pkRouteInfo); + ASSERT(pkRouteInfo); if(pkRouteInfo) { iNumResource += pkRouteInfo->getResourceQuantityRequirement(iResourceLoop); @@ -2127,12 +2127,12 @@ const MissionData* CvUnitMission::GetMissionData(CvUnit* hUnit, int iNode) /// Push onto back end of mission queue void CvUnitMission::InsertAtEndMissionQueue(CvUnit* hUnit, MissionData mission, bool bStart) { - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); MissionQueue& kQueue = hUnit->m_missionQueue; kQueue.insertAtEnd(&mission); - CvAssert(kQueue.getLength() < 10); + ASSERT(kQueue.getLength() < 10); if((GetLengthMissionQueue(kQueue) == 1) && bStart) { @@ -2154,8 +2154,8 @@ MissionData* CvUnitMission::DeleteMissionData(CvUnit* hUnit, MissionData* pNode) { MissionData* pNextMissionNode = NULL; - CvAssertMsg(pNode != NULL, "Node is not assigned a valid value"); - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(pNode != NULL, "Node is not assigned a valid value"); + ASSERT(hUnit->getOwner() != NO_PLAYER); MissionQueue& kQueue = hUnit->m_missionQueue; if(pNode == HeadMissionData(kQueue)) @@ -2184,7 +2184,7 @@ MissionData* CvUnitMission::DeleteMissionData(CvUnit* hUnit, MissionData* pNode) void CvUnitMission::ClearMissionQueue(CvUnit* hUnit, bool bKeepPathCache, int iUnitCycleTimerOverride) { //VALIDATE_OBJECT - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); DeactivateHeadMission(hUnit, iUnitCycleTimerOverride); @@ -2211,7 +2211,7 @@ void CvUnitMission::ClearMissionQueue(CvUnit* hUnit, bool bKeepPathCache, int iU void CvUnitMission::ActivateHeadMission(CvUnit* hUnit) { VALIDATE_OBJECT - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); if(hUnit->GetLengthMissionQueue() != 0) { if(!hUnit->IsBusy()) @@ -2226,7 +2226,7 @@ void CvUnitMission::ActivateHeadMission(CvUnit* hUnit) void CvUnitMission::DeactivateHeadMission(CvUnit* hUnit, int iUnitCycleTimer) { VALIDATE_OBJECT - CvAssert(hUnit->getOwner() != NO_PLAYER); + ASSERT(hUnit->getOwner() != NO_PLAYER); if(hUnit->GetLengthMissionQueue() != 0) { @@ -2309,7 +2309,7 @@ int CvUnitMission::GetLengthMissionQueue(const MissionQueue& kQueue) // --------------------------------------------------------------------------- const MissionData* CvUnitMission::GetHeadMissionData(CvUnit* hUnit) { - CvAssert(hUnit != NULL); + ASSERT(hUnit != NULL); if(hUnit->m_missionQueue.getLength()) return (hUnit->m_missionQueue.head()); return NULL; @@ -2318,7 +2318,7 @@ const MissionData* CvUnitMission::GetHeadMissionData(CvUnit* hUnit) // --------------------------------------------------------------------------- const MissionData* CvUnitMission::IsHeadMission(CvUnit* hUnit, int iMission) { - CvAssert(hUnit != NULL); + ASSERT(hUnit != NULL); if(hUnit->m_missionQueue.getLength()) { const MissionData& kMissionData = *hUnit->m_missionQueue.head(); diff --git a/CvGameCoreDLL_Expansion2/CvUnitProductionAI.cpp b/CvGameCoreDLL_Expansion2/CvUnitProductionAI.cpp index 68cff5ebc0..69c324e2a4 100644 --- a/CvGameCoreDLL_Expansion2/CvUnitProductionAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvUnitProductionAI.cpp @@ -35,7 +35,7 @@ CvUnitProductionAI::~CvUnitProductionAI(void) /// Clear out AI local variables void CvUnitProductionAI::Reset() { - CvAssertMsg(m_pUnits != NULL, "Unit Production AI init failure: unit entries are NULL"); + ASSERT(m_pUnits != NULL, "Unit Production AI init failure: unit entries are NULL"); m_UnitAIWeights.clear(); diff --git a/CvGameCoreDLL_Expansion2/CvVotingClasses.cpp b/CvGameCoreDLL_Expansion2/CvVotingClasses.cpp index afeca23a45..529ee5a1b0 100644 --- a/CvGameCoreDLL_Expansion2/CvVotingClasses.cpp +++ b/CvGameCoreDLL_Expansion2/CvVotingClasses.cpp @@ -32,7 +32,7 @@ CvString LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes eDecision, int case RESOLUTION_DECISION_YES_OR_NO: case RESOLUTION_DECISION_REPEAL: { - CvAssertMsg(iChoice == CHOICE_NO || iChoice == CHOICE_YES, "Unexpected choice when handling a Yes/No decision. Please send Anton your save file and version."); + ASSERT(iChoice == CHOICE_NO || iChoice == CHOICE_YES, "Unexpected choice when handling a Yes/No decision."); if (iChoice == CHOICE_NO) { s = Localization::Lookup("TXT_KEY_RESOLUTION_CHOICE_NO").toUTF8(); @@ -47,7 +47,7 @@ CvString LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes eDecision, int case RESOLUTION_DECISION_MAJOR_CIV_MEMBER: case RESOLUTION_DECISION_OTHER_MAJOR_CIV_MEMBER: { - CvAssertMsg(iChoice >= 0 && iChoice < MAX_CIV_PLAYERS, "Unexpected choice when handling a decision on a player. Please send Anton your save file and version."); + ASSERT(iChoice >= 0 && iChoice < MAX_CIV_PLAYERS, "Unexpected choice when handling a decision on a player."); if (iChoice >= 0 && iChoice < MAX_CIV_PLAYERS) { Localization::String sTemp = Localization::Lookup("TXT_KEY_RESOLUTION_CHOICE_PLAYER"); @@ -64,7 +64,7 @@ CvString LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes eDecision, int case RESOLUTION_DECISION_ANY_LUXURY_RESOURCE: { CvResourceInfo* pInfo = GC.getResourceInfo((ResourceTypes)iChoice); - CvAssertMsg(pInfo != NULL, "Unexpected choice when handling a decision on a resource. Please send Anton your save file and version."); + ASSERT(pInfo != NULL, "Unexpected choice when handling a decision on a resource."); if (pInfo != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_RESOLUTION_CHOICE_RESOURCE"); @@ -76,9 +76,9 @@ CvString LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes eDecision, int case RESOLUTION_DECISION_RELIGION: { CvReligionEntry* pInfo = GC.getReligionInfo((ReligionTypes)iChoice); - CvAssertMsg(pInfo != NULL, "Unexpected choice when handling a decision on a religion. Please send Anton your save file and version."); + ASSERT(pInfo != NULL, "Unexpected choice when handling a decision on a religion."); const CvReligion* pReligion = GC.getGame().GetGameReligions()->GetReligion((ReligionTypes)iChoice, NO_PLAYER); - CvAssert(pReligion != NULL); + ASSERT(pReligion != NULL); if (pInfo != NULL && pReligion != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_RESOLUTION_CHOICE_RELIGION"); @@ -90,7 +90,7 @@ CvString LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes eDecision, int case RESOLUTION_DECISION_IDEOLOGY: { CvPolicyBranchEntry* pInfo = GC.getPolicyBranchInfo((PolicyBranchTypes)iChoice); - CvAssertMsg(pInfo != NULL, "Unexpected choice when handling a decision on an ideology. Please send Anton your save file and version."); + ASSERT(pInfo != NULL, "Unexpected choice when handling a decision on an ideology."); if (pInfo != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_RESOLUTION_CHOICE_IDEOLOGY"); @@ -146,7 +146,7 @@ EraTypes LeagueHelpers::GetGameEraForTrigger() if (GET_PLAYER((PlayerTypes)i).isAlive()) { EraTypes e = GET_PLAYER((PlayerTypes)i).GetCurrentEra(); - CvAssert(e <= eMostAdvancedEra); + ASSERT(e <= eMostAdvancedEra); if (e == eMostAdvancedEra) { iInMostAdvancedEra++; @@ -267,7 +267,7 @@ CvResolutionEffects::CvResolutionEffects(void) bool CvResolutionEffects::SetType(ResolutionTypes eType) { CvResolutionEntry* pInfo = GC.getResolutionInfo(eType); - CvAssertMsg(pInfo, "Resolution info is null when instantiating ResolutionEffects. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info is null when instantiating ResolutionEffects."); if (pInfo) { bDiplomaticVictory = pInfo->IsDiplomaticVictory(); @@ -701,7 +701,7 @@ int CvVoterDecision::GetDecision() int iWeightAtTop = vChoices.GetWeight(0); for (int i = 0; i < vChoices.size(); i++) { - CvAssert(vChoices.GetWeight(i) <= iWeightAtTop); + ASSERT(vChoices.GetWeight(i) <= iWeightAtTop); if (vChoices.GetWeight(i) < iWeightAtTop) { break; @@ -822,7 +822,7 @@ int CvVoterDecision::GetVotesMarginOfTopChoice() { iDelta = GetVotesCastForChoice(vTopChoices[0]); } - CvAssert(iDelta >= 0); + ASSERT(iDelta >= 0); return iDelta; } @@ -1091,7 +1091,7 @@ CvString CvResolution::GetName() CvString s = ""; CvResolutionEntry* pInfo = GC.getResolutionInfo(GetType()); - CvAssert(pInfo); + ASSERT(pInfo); if (pInfo) { s += Localization::Lookup(pInfo->GetDescriptionKey()).toUTF8(); @@ -1189,7 +1189,7 @@ CvEnactProposal::CvEnactProposal(void) CvEnactProposal::CvEnactProposal(int iID, ResolutionTypes eType, LeagueTypes eLeague, PlayerTypes eProposalPlayer, int iChoice) : CvProposal(iID, eType, eLeague, eProposalPlayer) { CvResolutionEntry* pInfo = GC.getResolutionInfo(eType); - CvAssertMsg(pInfo, "Resolution info is null. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info is null."); if (pInfo) { m_VoterDecision = CvVoterDecision(pInfo->GetVoterDecision()); @@ -1208,7 +1208,7 @@ void CvEnactProposal::Init() bool CvEnactProposal::IsPassed(int iTotalSessionVotes) { CvResolutionEntry* pInfo = GC.getResolutionInfo(GetType()); - CvAssert(pInfo); + ASSERT(pInfo); if (!pInfo) { return false; @@ -1248,7 +1248,7 @@ bool CvEnactProposal::IsPassed(int iTotalSessionVotes) return (iDecision == LeagueHelpers::CHOICE_YES); } - CvAssertMsg(false, "Unexpected case when determining whether an enact proposal has passed. Please send Anton your save file and version."); + ASSERT(false, "Unexpected case when determining whether an enact proposal has passed."); return false; } @@ -1318,11 +1318,11 @@ void CvActiveResolution::Init() void CvActiveResolution::DoEffects(PlayerTypes ePlayer) { CvPlayer* pPlayer = &GET_PLAYER(ePlayer); - CvAssertMsg(pPlayer != NULL, "Player is null when doing effects of an active resolution. Please send Anton your save file and version."); + ASSERT(pPlayer != NULL, "Player is null when doing effects of an active resolution."); if (pPlayer == NULL) return; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(GetLeague()); - CvAssertMsg(pLeague != NULL, "League is null when doing effects of an active resolution. Please send Anton your save file and version."); + ASSERT(pLeague != NULL, "League is null when doing effects of an active resolution."); if (pLeague == NULL) return; // == Proposer Choices == @@ -1373,8 +1373,8 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) // == One Time Effects == if (GetEffects()->bDiplomaticVictory) { - CvAssertMsg(eTargetPlayer != NO_PLAYER || eVotedPlayer != NO_PLAYER, "Diplomatic Victory voted for NO_PLAYER. Please send Anton your save file and version."); - CvAssertMsg(eTargetPlayer == NO_PLAYER || eVotedPlayer == NO_PLAYER, "Ambiguous target when setting Diplomatic Victory. Please send Anton your save file and version"); + ASSERT(eTargetPlayer != NO_PLAYER || eVotedPlayer != NO_PLAYER, "Diplomatic Victory voted for NO_PLAYER."); + ASSERT(eTargetPlayer == NO_PLAYER || eVotedPlayer == NO_PLAYER, "Ambiguous target when setting Diplomatic Victory."); if (ePlayer == eVotedPlayer || ePlayer == eTargetPlayer) { GC.getGame().GetGameLeagues()->SetDiplomaticVictor(ePlayer); @@ -1382,8 +1382,8 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) } if (GetEffects()->bChangeLeagueHost) { - CvAssertMsg(eTargetPlayer != NO_PLAYER || eVotedPlayer != NO_PLAYER, "Changing host to NO_PLAYER. Please send Anton your save file and version."); - CvAssertMsg(eTargetPlayer == NO_PLAYER || eVotedPlayer == NO_PLAYER, "Ambiguous target when changing host. Please send Anton your save file and version"); + ASSERT(eTargetPlayer != NO_PLAYER || eVotedPlayer != NO_PLAYER, "Changing host to NO_PLAYER."); + ASSERT(eTargetPlayer == NO_PLAYER || eVotedPlayer == NO_PLAYER, "Ambiguous target when changing host."); if (ePlayer == eVotedPlayer || ePlayer == eTargetPlayer) { pLeague->SetHostMember(ePlayer); @@ -1538,7 +1538,7 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) } if (GetEffects()->iResourceQuantity != 0) { - CvAssertMsg(eTargetLuxury != NO_RESOURCE, "Adding NO_RESOURCE for a player. Please send Anton your save file and version."); + ASSERT(eTargetLuxury != NO_RESOURCE, "Adding NO_RESOURCE for a player."); pPlayer->changeNumResourceTotal(eTargetLuxury, GetEffects()->iResourceQuantity); } if (GetEffects()->bEmbargoCityStates) @@ -1558,7 +1558,7 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) } if (GetEffects()->bEmbargoPlayer) { - CvAssertMsg(eTargetPlayer != NO_PLAYER, "Making an embargo on NO_PLAYER. Please send Anton your save file and version."); + ASSERT(eTargetPlayer != NO_PLAYER, "Making an embargo on NO_PLAYER."); // Refresh trade routes GC.getGame().GetGameTrade()->ClearAllCivTradeRoutes(eTargetPlayer, true); GET_PLAYER(eTargetPlayer).GetCorporations()->ClearCorporationFromForeignCities(false, true, true); @@ -1587,7 +1587,7 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) } if (GetEffects()->bNoResourceHappiness) { - CvAssertMsg(eTargetLuxury != NO_RESOURCE, "Banning Happiness for NO_RESOURCE. Please send Anton your save file and version."); + ASSERT(eTargetLuxury != NO_RESOURCE, "Banning Happiness for NO_RESOURCE."); // Refresh happiness if (MOD_BALANCE_CORE_RESOURCE_MONOPOLIES) { @@ -1638,24 +1638,24 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) } if (GetEffects()->iVotesForFollowingReligion != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "No target religion when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "No target religion when one was expected."); } if (GetEffects()->iHolyCityTourism != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "No target religion when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "No target religion when one was expected."); } if (GetEffects()->iReligionSpreadStrengthMod != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "No target religion when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "No target religion when one was expected."); // Updated on CvGameReligions::DoTurn } if (GetEffects()->iVotesForFollowingIdeology != 0) { - CvAssertMsg(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected."); } if (GetEffects()->iOtherIdeologyRebellionMod != 0) { - CvAssertMsg(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected."); /* if (eTargetIdeology != NO_POLICY_BRANCH_TYPE) { @@ -1749,11 +1749,11 @@ void CvActiveResolution::DoEffects(PlayerTypes ePlayer) void CvActiveResolution::RemoveEffects(PlayerTypes ePlayer) { CvPlayer* pPlayer = &GET_PLAYER(ePlayer); - CvAssertMsg(pPlayer != NULL, "Player is null when doing effects of an active resolution. Please send Anton your save file and version."); + ASSERT(pPlayer != NULL, "Player is null when doing effects of an active resolution."); if (pPlayer == NULL) return; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(GetLeague()); - CvAssertMsg(pLeague != NULL, "League is null when doing effects of an active resolution. Please send Anton your save file and version."); + ASSERT(pLeague != NULL, "League is null when doing effects of an active resolution."); if (pLeague == NULL) return; // == Proposer Choices == @@ -1799,7 +1799,7 @@ void CvActiveResolution::RemoveEffects(PlayerTypes ePlayer) } if (GetEffects()->iResourceQuantity != 0) { - CvAssertMsg(eTargetLuxury != NO_RESOURCE, "Subtracting NO_RESOURCE for a player. Please send Anton your save file and version."); + ASSERT(eTargetLuxury != NO_RESOURCE, "Subtracting NO_RESOURCE for a player."); pPlayer->changeNumResourceTotal(eTargetLuxury, -1 * GetEffects()->iResourceQuantity); } if (GetEffects()->bEmbargoCityStates) @@ -1808,12 +1808,12 @@ void CvActiveResolution::RemoveEffects(PlayerTypes ePlayer) } if (GetEffects()->bEmbargoPlayer) { - CvAssertMsg(eTargetPlayer != NO_PLAYER, "Repealing an embargo on NO_PLAYER. Please send Anton your save file and version."); + ASSERT(eTargetPlayer != NO_PLAYER, "Repealing an embargo on NO_PLAYER."); // Refresh trade routes } if (GetEffects()->bNoResourceHappiness) { - CvAssertMsg(eTargetLuxury != NO_RESOURCE, "Repealing a band on Happiness for NO_RESOURCE. Please send Anton your save file and version."); + ASSERT(eTargetLuxury != NO_RESOURCE, "Repealing a band on Happiness for NO_RESOURCE."); // Refresh happiness if (MOD_BALANCE_CORE_RESOURCE_MONOPOLIES) { @@ -1860,11 +1860,11 @@ void CvActiveResolution::RemoveEffects(PlayerTypes ePlayer) } if (GetEffects()->iHolyCityTourism != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "No target religion when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "No target religion when one was expected."); } if (GetEffects()->iReligionSpreadStrengthMod != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "No target religion when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "No target religion when one was expected."); // Updated on CvGameReligions::DoTurn } if (GetEffects()->iVotesForFollowingIdeology != 0) @@ -1872,7 +1872,7 @@ void CvActiveResolution::RemoveEffects(PlayerTypes ePlayer) } if (GetEffects()->iOtherIdeologyRebellionMod != 0) { - CvAssertMsg(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected. Please send Anton your save file and version."); + ASSERT(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "No target ideology when one was expected."); /* if (eTargetIdeology != NO_POLICY_BRANCH_TYPE) { @@ -2022,7 +2022,7 @@ void CvRepealProposal::Init() bool CvRepealProposal::IsPassed(int iTotalSessionVotes) { CvResolutionEntry* pInfo = GC.getResolutionInfo(GetType()); - CvAssert(pInfo); + ASSERT(pInfo); if (!pInfo) { return false; @@ -2042,7 +2042,7 @@ bool CvRepealProposal::IsPassed(int iTotalSessionVotes) return false; } - CvAssertMsg(GetRepealDecision()->GetType() == RESOLUTION_DECISION_REPEAL, "Unexpected decision type for repeal proposal. Please send Anton your save file and version."); + ASSERT(GetRepealDecision()->GetType() == RESOLUTION_DECISION_REPEAL, "Unexpected decision type for repeal proposal."); if (GetRepealDecision()->GetType() == RESOLUTION_DECISION_REPEAL) { return (iDecision == LeagueHelpers::CHOICE_YES); @@ -2199,8 +2199,8 @@ CvLeague::Project::~Project(void) void CvLeague::Init(LeagueSpecialSessionTypes eGoverningSpecialSession) { - CvAssertMsg(m_eID != NO_LEAGUE, "Initializing a CvLeague without a proper ID. Please send Anton your save file and verison."); - CvAssert(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); + ASSERT(m_eID != NO_LEAGUE, "Initializing a CvLeague without a proper ID."); + ASSERT(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); m_eLastSpecialSession = eGoverningSpecialSession; // Fake the last special session so we have data to inform the World Congress's status AssignProposalPrivileges(); ResetTurnsUntilSession(); @@ -2208,7 +2208,7 @@ void CvLeague::Init(LeagueSpecialSessionTypes eGoverningSpecialSession) void CvLeague::DoTurn(LeagueSpecialSessionTypes eTriggeredSpecialSession) { - CvAssert(eTriggeredSpecialSession == NO_LEAGUE_SPECIAL_SESSION || CanStartSpecialSession(eTriggeredSpecialSession)); + ASSERT(eTriggeredSpecialSession == NO_LEAGUE_SPECIAL_SESSION || CanStartSpecialSession(eTriggeredSpecialSession)); // Special Session this turn, put everything else on hold if (eTriggeredSpecialSession != NO_LEAGUE_SPECIAL_SESSION && CanStartSpecialSession(eTriggeredSpecialSession)) @@ -2218,7 +2218,7 @@ void CvLeague::DoTurn(LeagueSpecialSessionTypes eTriggeredSpecialSession) else if (!IsInSession()) { ChangeTurnsUntilSession(-1); - CvAssertMsg(GetTurnsUntilSession() >= 0, "Turns left until League session is negative. Please send Anton your save file and version."); + ASSERT(GetTurnsUntilSession() >= 0, "Turns left until League session is negative."); if (GetTurnsUntilSession() <= 0) { CheckStartSession(); @@ -2298,10 +2298,10 @@ bool CvLeague::CanChangeCustomName(PlayerTypes ePlayer) void CvLeague::DoChangeCustomName(PlayerTypes ePlayer, const char* szCustomName) { - CvAssertMsg(CanChangeCustomName(ePlayer), "Player is not allowed to edit league name."); + ASSERT(CanChangeCustomName(ePlayer), "Player is not allowed to edit league name."); if (CanChangeCustomName(ePlayer)) { - CvAssertMsg(strlen(szCustomName) <= sizeof(m_szCustomName), "Custom name for league is too long."); + ASSERT(strlen(szCustomName) <= sizeof(m_szCustomName), "Custom name for league is too long."); if(szCustomName != NULL && strlen(szCustomName) <= sizeof(m_szCustomName)) { strcpy_s(m_szCustomName, szCustomName); @@ -2316,7 +2316,7 @@ int CvLeague::GetSessionTurnInterval() if (GetCurrentSpecialSession() != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(GetCurrentSpecialSession()); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { iInterval = pInfo->GetTurnsBetweenSessions(); @@ -2325,7 +2325,7 @@ int CvLeague::GetSessionTurnInterval() else if (GetLastSpecialSession() != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(GetLastSpecialSession()); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { iInterval = pInfo->GetTurnsBetweenSessions(); @@ -2381,7 +2381,7 @@ void CvLeague::SetInSession(bool bInSession) void CvLeague::SetInSession(LeagueSpecialSessionTypes eSpecialSession) { - CvAssertMsg(eSpecialSession != NO_LEAGUE_SPECIAL_SESSION, "Attempting to set the league in session with an invalid special session type. Please send Anton your save file and version."); + ASSERT(eSpecialSession != NO_LEAGUE_SPECIAL_SESSION, "Attempting to set the league in session with an invalid special session type."); if (eSpecialSession != NO_LEAGUE_SPECIAL_SESSION) { SetInSession(true); @@ -2396,7 +2396,7 @@ int CvLeague::GetTurnsUntilSession() const void CvLeague::SetTurnsUntilSession(int iTurns) { - CvAssertMsg(iTurns >= 0, "Cannot have negative turns until next League session. Please send Anton your save file and version."); + ASSERT(iTurns >= 0, "Cannot have negative turns until next League session."); if (iTurns >= 0) { @@ -2454,13 +2454,13 @@ int CvLeague::GetTurnsUntilVictorySession() { eGoverningSpecialSession = GetLastSpecialSession(); } - CvAssert(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); + ASSERT(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); bool bRecurringVictoryProposal = false; if (eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eGoverningSpecialSession); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { ResolutionTypes e = pInfo->GetRecurringProposal(); @@ -2558,13 +2558,13 @@ void CvLeague::DoVoteEnact(int iID, PlayerTypes eVoter, int iNumVotes, int iChoi { it->GetVoterDecision()->ProcessVote(eVoter, iNumVotes, iChoice); GetMember(eVoter)->iVotes -= iNumVotes; - CvAssertMsg(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining. Please send Anton your save file and version."); + ASSERT(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining."); bProcessed = true; break; } } } - CvAssertMsg(bProcessed, "Attempt to vote on an enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(bProcessed, "Attempt to vote on an enact resolution when not allowed to."); GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true); } @@ -2581,14 +2581,14 @@ void CvLeague::DoVoteRepeal(int iResolutionID, PlayerTypes eVoter, int iNumVotes { it->GetRepealDecision()->ProcessVote(eVoter, iNumVotes, iChoice); GetMember(eVoter)->iVotes -= iNumVotes; - CvAssertMsg(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining. Please send Anton your save file and version."); + ASSERT(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining."); bProcessed = true; break; } } } } - CvAssertMsg(bProcessed, "Attempt to vote on a repeal resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(bProcessed, "Attempt to vote on a repeal resolution when not allowed to."); GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true); } @@ -2599,10 +2599,10 @@ void CvLeague::DoVoteAbstain(PlayerTypes eVoter, int iNumVotes) { GetMember(eVoter)->iVotes -= iNumVotes; GetMember(eVoter)->iAbstainedVotes += iNumVotes; - CvAssertMsg(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining. Please send Anton your save file and version."); + ASSERT(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining."); bProcessed = true; } - CvAssertMsg(bProcessed, "Attempt to abstain votes but not allowed to. Please send Anton your save file and version."); + ASSERT(bProcessed, "Attempt to abstain votes but not allowed to."); GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true); } @@ -2610,7 +2610,7 @@ void CvLeague::DoProposeEnact(ResolutionTypes eResolution, PlayerTypes eProposer { if (!CanProposeEnact(eResolution, eProposer, iChoice)) { - CvAssertMsg(false, "Attempt to propose enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(false, "Attempt to propose enact resolution when not allowed to."); return; } @@ -2620,7 +2620,7 @@ void CvLeague::DoProposeEnact(ResolutionTypes eResolution, PlayerTypes eProposer if (IsMember(eProposer)) { GetMember(eProposer)->iProposals = GetMember(eProposer)->iProposals - 1; - CvAssertMsg(GetMember(eProposer)->iProposals >= 0, "Attempt to propose enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(GetMember(eProposer)->iProposals >= 0, "Attempt to propose enact resolution when not allowed to."); if (eProposer == m_eHost && GetMember(eProposer)->iProposals <= 0) { SetHostProposing(false); @@ -2628,7 +2628,7 @@ void CvLeague::DoProposeEnact(ResolutionTypes eResolution, PlayerTypes eProposer } else { - CvAssertMsg(false, "Attempt to propose enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(false, "Attempt to propose enact resolution when not allowed to."); } // Proposals made by players could affect Diplomacy AI @@ -2644,7 +2644,7 @@ void CvLeague::DoProposeRepeal(int iResolutionID, PlayerTypes eProposer) { if (!CanProposeRepeal(iResolutionID, eProposer)) { - CvAssertMsg(false, "Attempt to propose repeal resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(false, "Attempt to propose repeal resolution when not allowed to."); return; } @@ -2659,7 +2659,7 @@ void CvLeague::DoProposeRepeal(int iResolutionID, PlayerTypes eProposer) if (IsMember(eProposer)) { GetMember(eProposer)->iProposals = GetMember(eProposer)->iProposals - 1; - CvAssertMsg(GetMember(eProposer)->iProposals >= 0, "Attempt to propose enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(GetMember(eProposer)->iProposals >= 0, "Attempt to propose enact resolution when not allowed to."); if (eProposer == m_eHost && GetMember(eProposer)->iProposals <= 0) { SetHostProposing(false); @@ -2667,7 +2667,7 @@ void CvLeague::DoProposeRepeal(int iResolutionID, PlayerTypes eProposer) } else { - CvAssertMsg(false, "Attempt to propose enact resolution when not allowed to. Please send Anton your save file and version."); + ASSERT(false, "Attempt to propose enact resolution when not allowed to."); } // Proposals made by players could affect Diplomacy AI @@ -2693,17 +2693,17 @@ void CvLeague::DoProposeRepeal(int iResolutionID, PlayerTypes eProposer) } } - CvAssertMsg(iFound == 1, "Unexpected number of active resolutions with this ID. Please send Anton your save file and version."); + ASSERT(iFound == 1, "Unexpected number of active resolutions with this ID."); GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true); } bool CvLeague::CanProposeEnactAnyChoice(ResolutionTypes eResolution, PlayerTypes eProposer) { - CvAssertMsg(eResolution >= 0, "Invalid resolution type. Please send Anton your save file and version."); - CvAssertMsg(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds. Please send Anton your save file and version."); + ASSERT(eResolution >= 0, "Invalid resolution type."); + ASSERT(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds."); CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution); - CvAssertMsg(pInfo, "Resolution info is null. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info is null."); if (!pInfo) return false; std::vector vValidChoices = GetChoicesForDecision(pInfo->GetProposerDecision(), eProposer); @@ -2733,11 +2733,11 @@ bool CvLeague::CanProposeEnactAnyChoice(ResolutionTypes eResolution, PlayerTypes bool CvLeague::CanProposeEnact(ResolutionTypes eResolution, PlayerTypes eProposer, int iChoice, CvString* sTooltipSink) { - CvAssertMsg(eResolution >= 0, "Invalid resolution type. Please send Anton your save file and version."); - CvAssertMsg(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds. Please send Anton your save file and version."); + ASSERT(eResolution >= 0, "Invalid resolution type."); + ASSERT(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds."); CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution); - CvAssertMsg(pInfo, "Resolution info is null. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info is null."); if (!pInfo) return false; bool bValid = true; @@ -3184,7 +3184,7 @@ bool CvLeague::CanProposeRepeal(int iResolutionID, PlayerTypes eProposer, CvStri if (!CanPropose(eProposer)) bValid = false; } - CvAssertMsg(eProposer != NO_PLAYER, "Checking to see if a NO_PLAYER can propose a repeal. Please send Anton your save file and version."); + ASSERT(eProposer != NO_PLAYER, "Checking to see if a NO_PLAYER can propose a repeal."); // Must not already be proposed if (IsRepealProposed(iResolutionID)) @@ -3225,7 +3225,7 @@ bool CvLeague::CanProposeRepeal(int iResolutionID, PlayerTypes eProposer, CvStri return bValid; } } - CvAssertMsg(false, "Resolution ID does not exist as an Active Resolution. Please send Anton your save file and version."); + ASSERT(false, "Resolution ID does not exist as an Active Resolution."); return false; } @@ -3307,7 +3307,7 @@ bool CvLeague::IsResolutionEffectsValid(ResolutionTypes eResolution, int iPropos if (pInfo->IsEmbargoPlayer()) { PlayerTypes eTargetPlayer = (PlayerTypes) iProposerChoice; - CvAssert(eTargetPlayer >= 0 && eTargetPlayer < MAX_MAJOR_CIVS); + ASSERT(eTargetPlayer >= 0 && eTargetPlayer < MAX_MAJOR_CIVS); if (eTargetPlayer >= 0 && eTargetPlayer < MAX_MAJOR_CIVS) { // Player is dead @@ -3477,8 +3477,8 @@ bool CvLeague::IsAnythingProposed() //antonjs: todo: refactor: bool CvLeague::IsActiveResolution(ResolutionTypes eResolution, int iProposerChoice) { - CvAssertMsg(eResolution >= 0, "Invalid resolution type. Please send Anton your save file and version."); - CvAssertMsg(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds. Please send Anton your save file and version."); + ASSERT(eResolution >= 0, "Invalid resolution type."); + ASSERT(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds."); for (uint i = 0; i < m_vActiveResolutions.size(); i++) { @@ -3557,8 +3557,8 @@ bool CvLeague::IsProposed(int iResolutionID, bool bRepeal, bool bCheckOnHold) //antonjs: todo: refactor: bool CvLeague::IsEnactProposed(ResolutionTypes eResolution, int iProposerChoice) { - CvAssertMsg(eResolution >= 0, "Invalid resolution type. Please send Anton your save file and version."); - CvAssertMsg(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds. Please send Anton your save file and version."); + ASSERT(eResolution >= 0, "Invalid resolution type."); + ASSERT(eResolution < GC.getNumResolutionInfos(), "Resolution index out of bounds."); for (uint i = 0; i < m_vEnactProposals.size(); i++) { @@ -3790,12 +3790,12 @@ void CvLeague::AddMember(PlayerTypes ePlayer) { if (ePlayer < 0 || ePlayer >= MAX_CIV_PLAYERS) { - CvAssertMsg(false, "Trying to add a player to a League who has an invalid Player ID. Please send Anton your save file and version."); + ASSERT(false, "Trying to add a player to a League who has an invalid Player ID. "); return; } if (IsMember(ePlayer)) { - CvAssertMsg(false, "Trying to add a player to a League that they are already a member of. Please send Anton your save file and verison."); + ASSERT(false, "Trying to add a player to a League that they are already a member of."); return; } @@ -3845,7 +3845,7 @@ void CvLeague::RemoveMember(PlayerTypes ePlayer) { if (!IsMember(ePlayer)) { - CvAssertMsg(false, "Trying to remove a player from a League that they are not a member of. Please send Anton your save file and version."); + ASSERT(false, "Trying to remove a player from a League that they are not a member of. "); return; } @@ -3904,8 +3904,8 @@ bool CvLeague::CanVote(PlayerTypes ePlayer) bool CvLeague::CanEverVote(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index). Please send Anton your save file and version."); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index). Please send Anton your save file and version."); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)."); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)."); if (IsMember(ePlayer)) { @@ -3946,7 +3946,7 @@ int CvLeague::GetSpentVotesForMember(PlayerTypes ePlayer) if (iVotes > 0) { - CvAssert(CanEverVote(ePlayer)); + ASSERT(CanEverVote(ePlayer)); } return iVotes; @@ -4040,13 +4040,13 @@ int CvLeague::GetCoreVotesForMember(PlayerTypes ePlayer) eGoverningSpecialSession = GetLastSpecialSession(); } - CvAssert(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); + ASSERT(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); if (eGoverningSpecialSession == NO_LEAGUE_SPECIAL_SESSION) return /*1*/ GD_INT_GET(LEAGUE_MEMBER_VOTES_BASE); CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eGoverningSpecialSession); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo == NULL) return /*1*/ GD_INT_GET(LEAGUE_MEMBER_VOTES_BASE); Member* pMember = GetMember(ePlayer); - CvAssert(pMember != NULL); + ASSERT(pMember != NULL); if (pMember == NULL) return /*1*/ GD_INT_GET(LEAGUE_MEMBER_VOTES_BASE); iVotes += pInfo->GetCivDelegates(); @@ -4413,8 +4413,8 @@ bool CvLeague::CanPropose(PlayerTypes ePlayer) bool CvLeague::CanEverPropose(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index). Please send Anton your save file and version."); - CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index). Please send Anton your save file and version."); + ASSERT(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)."); + ASSERT(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)."); if (IsMember(ePlayer)) { @@ -4661,7 +4661,7 @@ PlayerTypes CvLeague::GetHostMember() const void CvLeague::SetHostMember(PlayerTypes ePlayer) { - CvAssertMsg(ePlayer >= 0 && ePlayer < MAX_CIV_PLAYERS, "ePlayer is out of bounds (invalid Index)"); + ASSERT(ePlayer >= 0 && ePlayer < MAX_CIV_PLAYERS, "ePlayer is out of bounds (invalid Index)"); bool bFound = false; if (ePlayer >= 0 && ePlayer < MAX_CIV_PLAYERS) { @@ -4683,7 +4683,7 @@ void CvLeague::SetHostMember(PlayerTypes ePlayer) } } } - CvAssertMsg(bFound, "Could not find the correct player to set as the World Congress host. Please send Anton your save file and version."); + ASSERT(bFound, "Could not find the correct player to set as the World Congress host."); } int CvLeague::GetConsecutiveHostedSessions() const @@ -4756,7 +4756,7 @@ bool CvLeague::IsProjectComplete(LeagueProjectTypes eLeagueProject) const int CvLeague::GetProjectCostPerPlayer(LeagueProjectTypes eLeagueProject) const { CvLeagueProjectEntry* pProjectInfo = GC.getLeagueProjectInfo(eLeagueProject); - CvAssertMsg(pProjectInfo != NULL, "Looking up project cost for a project that does not exist. Please send Anton your save file and version."); + ASSERT(pProjectInfo != NULL, "Looking up project cost for a project that does not exist."); int iCost = 0; if (pProjectInfo) { @@ -4826,7 +4826,7 @@ int CvLeague::GetProjectBuildingCostPerPlayer(BuildingTypes eRewardBuilding) con int CvLeague::GetProjectCost(LeagueProjectTypes eLeagueProject) const { CvLeagueProjectEntry* pProjectInfo = GC.getLeagueProjectInfo(eLeagueProject); - CvAssertMsg(pProjectInfo != NULL, "Looking up project cost for a project that does not exist. Please send Anton your save file and version."); + ASSERT(pProjectInfo != NULL, "Looking up project cost for a project that does not exist."); int iCost = 0; if (pProjectInfo) { @@ -4838,14 +4838,14 @@ int CvLeague::GetProjectCost(LeagueProjectTypes eLeagueProject) const int CvLeague::GetProjectProgress(LeagueProjectTypes eProject) { CvLeagueProjectEntry* pProjectInfo = GC.getLeagueProjectInfo(eProject); - CvAssertMsg(pProjectInfo != NULL, "Looking up project progress for a project that does not exist. Please send Anton your save file and version."); + ASSERT(pProjectInfo != NULL, "Looking up project progress for a project that does not exist."); int iProgress = 0; if (pProjectInfo) { if (IsProjectActive(eProject) || IsProjectComplete(eProject)) { Project* pProject = GetProject(eProject); - CvAssert(pProject != NULL) + ASSERT(pProject != NULL) if (pProject) { for (uint i = 0; i < pProject->vProductionList.size(); i++) @@ -4980,7 +4980,7 @@ void CvLeague::SetMemberContribution(PlayerTypes ePlayer, LeagueProjectTypes eLe it->vProductionList[ePlayer] = std::max(iValue, 0); } } - CvAssertMsg(iMatches == 1, "Unexpected case when contributing to a League Project. Please send Anton your save file and version."); + ASSERT(iMatches == 1, "Unexpected case when contributing to a League Project."); } void CvLeague::ChangeMemberContribution(PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, int iChange) @@ -5012,7 +5012,7 @@ float CvLeague::GetContributionTierThreshold(ContributionTier eTier, LeagueProje { float fThreshold = 0.0f; Project* pProject = GetProject(eLeagueProject); - CvAssertMsg(pProject, "Could not find league project. Please send Anton your save file and version."); + ASSERT(pProject, "Could not find league project."); if (!pProject) return 0.0f; switch (eTier) @@ -5049,9 +5049,9 @@ float CvLeague::GetContributionTierThreshold(ContributionTier eTier, LeagueProje bool CvLeague::IsTradeEmbargoed(PlayerTypes eTrader, PlayerTypes eRecipient) { - CvAssertMsg(eTrader >= 0 && eTrader < MAX_CIV_PLAYERS, "Invalid index for eTrader. Please send Anton your save file and version."); + ASSERT(eTrader >= 0 && eTrader < MAX_CIV_PLAYERS, "Invalid index for eTrader."); if (eTrader < 0 || eTrader >= MAX_CIV_PLAYERS) return false; - CvAssertMsg(eRecipient >= 0 && eRecipient < MAX_CIV_PLAYERS, "Invalid index for eRecipient. Please send Anton your save file and version."); + ASSERT(eRecipient >= 0 && eRecipient < MAX_CIV_PLAYERS, "Invalid index for eRecipient."); if (eRecipient < 0 || eRecipient >= MAX_CIV_PLAYERS) return false; for (ActiveResolutionList::iterator it = m_vActiveResolutions.begin(); it != m_vActiveResolutions.end(); ++it) { @@ -5069,7 +5069,7 @@ bool CvLeague::IsTradeEmbargoed(PlayerTypes eTrader, PlayerTypes eRecipient) if (it->GetEffects()->bEmbargoPlayer) { PlayerTypes eEmbargoedMajor = (PlayerTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eEmbargoedMajor != NO_PLAYER); + ASSERT(eEmbargoedMajor != NO_PLAYER); if (eEmbargoedMajor == eTrader || eEmbargoedMajor == eRecipient) { //does not affect teammates @@ -5151,7 +5151,7 @@ int CvLeague::GetResearchMod(TechTypes eTech) int CvLeague::GetFeatureYieldChange(FeatureTypes eFeature, YieldTypes eYield) { - CvAssertMsg(eFeature != NO_FEATURE, "Looking for yield changes to NO_FEATURE. Please send Anton your save file and version."); + ASSERT(eFeature != NO_FEATURE, "Looking for yield changes to NO_FEATURE."); int iValue = 0; CvFeatureInfo* pInfo = GC.getFeatureInfo(eFeature); @@ -5271,7 +5271,7 @@ int CvLeague::GetExtraVotesForFollowingReligion(PlayerTypes ePlayer) if (it->GetEffects()->iVotesForFollowingReligion != 0) { ReligionTypes eReligion = (ReligionTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eReligion != NO_RELIGION); + ASSERT(eReligion != NO_RELIGION); if (GET_PLAYER(ePlayer).GetReligions()->HasReligionInMostCities(eReligion) || (GET_PLAYER(ePlayer).GetReligions()->GetOwnedReligion() == eReligion)) { @@ -5329,7 +5329,7 @@ int CvLeague::GetCityTourismModifier(const CvCity* pCity) if (it->GetEffects()->iHolyCityTourism != 0) { ReligionTypes eReligion = (ReligionTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eReligion != NO_RELIGION); + ASSERT(eReligion != NO_RELIGION); if (pCity->GetCityReligions()->IsHolyCityForReligion(eReligion)) { iMod += it->GetEffects()->iHolyCityTourism; @@ -5347,7 +5347,7 @@ int CvLeague::GetReligionSpreadStrengthModifier(ReligionTypes eReligion) if (it->GetEffects()->iReligionSpreadStrengthMod != 0) { ReligionTypes e = (ReligionTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(e != NO_RELIGION); + ASSERT(e != NO_RELIGION); if (e != NO_RELIGION && e == eReligion) { iMod += it->GetEffects()->iReligionSpreadStrengthMod; @@ -5365,7 +5365,7 @@ int CvLeague::GetExtraVotesForFollowingIdeology(PlayerTypes ePlayer) if (it->GetEffects()->iVotesForFollowingIdeology != 0) { PolicyBranchTypes eIdeology = (PolicyBranchTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eIdeology != NO_POLICY_BRANCH_TYPE); + ASSERT(eIdeology != NO_POLICY_BRANCH_TYPE); PolicyBranchTypes ePlayerIdeology = GET_PLAYER(ePlayer).GetPlayerPolicies()->GetLateGamePolicyTree(); if (ePlayerIdeology != NO_POLICY_BRANCH_TYPE && eIdeology != NO_POLICY_BRANCH_TYPE && ePlayerIdeology == eIdeology) { @@ -5400,7 +5400,7 @@ int CvLeague::GetPressureForIdeology(PolicyBranchTypes eIdeology) if (it->GetEffects()->iOtherIdeologyRebellionMod != 0) { PolicyBranchTypes e = (PolicyBranchTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(e != NO_POLICY_BRANCH_TYPE); + ASSERT(e != NO_POLICY_BRANCH_TYPE); if (e != NO_POLICY_BRANCH_TYPE && eIdeology != NO_POLICY_BRANCH_TYPE && e == eIdeology) { iPressure += it->GetEffects()->iOtherIdeologyRebellionMod; @@ -5509,7 +5509,7 @@ bool CvLeague::IsIdeologyEmbargoed() } bool CvLeague::IsIdeologyEmbargoed(PlayerTypes eTrader, PlayerTypes eRecipient) { - CvAssertMsg(eTrader >= 0 && eTrader < MAX_CIV_PLAYERS, "Invalid index for eTrader. Please send Anton your save file and version."); + ASSERT(eTrader >= 0 && eTrader < MAX_CIV_PLAYERS, "Invalid index for eTrader."); if (eTrader < 0 || eTrader >= MAX_CIV_PLAYERS) return false; for (ActiveResolutionList::iterator it = m_vActiveResolutions.begin(); it != m_vActiveResolutions.end(); ++it) @@ -5609,10 +5609,10 @@ CvString CvLeague::GetResolutionName(ResolutionTypes eResolution, int iResolutio CvString s = ""; CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution); - CvAssertMsg(pInfo, "Resolution info not found when assembling name text. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info not found when assembling name text."); if (!pInfo) { - CvAssert(false); + ASSERT(false); return ""; } @@ -5720,10 +5720,10 @@ CvString CvLeague::GetResolutionDetails(ResolutionTypes eResolution, PlayerTypes CvString s = ""; CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution); - CvAssertMsg(pInfo, "Resolution info not found when assembling details text. Please send Anton your save file and version."); + ASSERT(pInfo, "Resolution info not found when assembling details text."); if (!pInfo) { - CvAssert(false); + ASSERT(false); return ""; } @@ -5851,7 +5851,7 @@ CvString CvLeague::GetResolutionVoteOpinionDetails(ResolutionTypes eResolution, iNumCivsCommitted++; iNumDelegatesCommitted += iCommitted; iMemberDelegates -= iCommitted; - CvAssert(iMemberDelegates >= 0); + ASSERT(iMemberDelegates >= 0); } // Known leaning @@ -5934,7 +5934,7 @@ CvString CvLeague::GetResolutionVoteOpinionDetails(ResolutionTypes eResolution, if (iCommitted > 0) { iMemberDelegates -= iCommitted; - CvAssert(iMemberDelegates >= 0); + ASSERT(iMemberDelegates >= 0); } } @@ -6305,7 +6305,7 @@ CvString CvLeague::GetMemberDetails(PlayerTypes eMember, PlayerTypes eObserver) { if (!IsMember(eMember) || (!IsMember(eObserver) && !GET_PLAYER(eObserver).isObserver())) { - CvAssertMsg(false, "Attempting to get detail string for a player that is not a league member. Please send Anton your save file and version."); + ASSERT(false, "Attempting to get detail string for a player that is not a league member."); return ""; } CvString s = ""; @@ -6324,13 +6324,13 @@ CvString CvLeague::GetMemberDelegationDetails(PlayerTypes eMember, PlayerTypes e { if (!IsMember(eMember) || (!IsMember(eObserver) && !GET_PLAYER(eObserver).isObserver())) { - CvAssertMsg(false, "Attempting to get detail string for a player that is not a league member. Please send Anton your save file and version."); + ASSERT(false, "Attempting to get detail string for a player that is not a league member."); return ""; } Member* pMember = GetMember(eMember); if (pMember == NULL) { - CvAssertMsg(false, "Attempting to get detail string for a player that is has no member data. Please send Anton your save file and version."); + ASSERT(false, "Attempting to get detail string for a player that is has no member data."); return ""; } @@ -6356,7 +6356,7 @@ CvString CvLeague::GetMemberKnowledgeDetails(PlayerTypes eMember, PlayerTypes eO { if (!IsMember(eMember) || (!IsMember(eObserver) && !GET_PLAYER(eObserver).isObserver())) { - CvAssertMsg(false, "Attempting to get detail string for a player that is not a league member. Please send Anton your save file and version."); + ASSERT(false, "Attempting to get detail string for a player that is not a league member."); return ""; } @@ -6374,7 +6374,7 @@ CvString CvLeague::GetMemberVoteOpinionDetails(PlayerTypes eMember, PlayerTypes { if (!IsMember(eMember) || !IsMember(eObserver)) { - CvAssertMsg(false, "Attempting to get detail string for a player that is not a league member. Please send Anton your save file and version."); + ASSERT(false, "Attempting to get detail string for a player that is not a league member."); return ""; } @@ -6567,7 +6567,7 @@ CvString CvLeague::GetProjectRewardTierDetails(int iTier, LeagueProjectTypes ePr sContribution = sTemp.toUTF8(); } - CvAssert(pRewardInfo); + ASSERT(pRewardInfo); if (pRewardInfo != NULL) { Localization::String sResult = Localization::Lookup("TXT_KEY_LEAGUE_PROJECT_REWARD_DESC"); @@ -6641,51 +6641,51 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver if (it->GetEffects()->bEmbargoPlayer) { PlayerTypes eEmbargoedPlayer = (PlayerTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eEmbargoedPlayer != NO_PLAYER); + ASSERT(eEmbargoedPlayer != NO_PLAYER); veEmbargoedPlayers.push_back(eEmbargoedPlayer); } if (it->GetEffects()->bNoResourceHappiness) { ResourceTypes eBannedResource = (ResourceTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eBannedResource != NO_RESOURCE); + ASSERT(eBannedResource != NO_RESOURCE); veBannedResources.push_back(eBannedResource); } if (it->GetEffects()->iVotesForFollowingReligion != 0) { ReligionTypes eReligion = (ReligionTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eReligion != NO_RELIGION); - CvAssert(eWorldReligion == NO_RELIGION); + ASSERT(eReligion != NO_RELIGION); + ASSERT(eWorldReligion == NO_RELIGION); eWorldReligion = eReligion; } if (it->GetEffects()->iVotesForFollowingIdeology != 0) { PolicyBranchTypes eIdeology = (PolicyBranchTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eIdeology != NO_POLICY_BRANCH_TYPE); - CvAssert(eWorldIdeology == NO_POLICY_BRANCH_TYPE); + ASSERT(eIdeology != NO_POLICY_BRANCH_TYPE); + ASSERT(eWorldIdeology == NO_POLICY_BRANCH_TYPE); eWorldIdeology = eIdeology; } if (it->GetEffects()->bOpenDoor) { PlayerTypes eOpenMinor = (PlayerTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eOpenMinor != NO_PLAYER); + ASSERT(eOpenMinor != NO_PLAYER); veOpenMinors.push_back(eOpenMinor); } if (it->GetEffects()->bSphereOfInfluence) { PlayerTypes eSphereMinor = (PlayerTypes) it->GetProposerDecision()->GetDecision(); - CvAssert(eSphereMinor != NO_PLAYER); + ASSERT(eSphereMinor != NO_PLAYER); vePermanentMinors.push_back(eSphereMinor); } } if (eWorldReligion != NO_RELIGION) { CvReligionEntry* pInfo = GC.getReligionInfo(eWorldReligion); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); const CvReligion* pReligion = GC.getGame().GetGameReligions()->GetReligion(eWorldReligion, NO_PLAYER); - CvAssert(pReligion != NULL); + ASSERT(pReligion != NULL); if (pInfo != NULL && pReligion != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_WORLD_RELIGION"); @@ -6696,7 +6696,7 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver if (eWorldIdeology != NO_POLICY_BRANCH_TYPE) { CvPolicyBranchEntry* pInfo = GC.getPolicyBranchInfo(eWorldIdeology); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_WORLD_IDEOLOGY"); @@ -6721,13 +6721,13 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver } if (effects.bEmbargoPlayer) { - CvAssert(!veEmbargoedPlayers.empty()); + ASSERT(!veEmbargoedPlayers.empty()); Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_EMBARGO_PLAYERS"); CvString sEntries = ""; for (uint i = 0; i < veEmbargoedPlayers.size(); i++) { Localization::String sTempEntry = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_EMBARGO_PLAYERS_ENTRY"); - CvAssert(veEmbargoedPlayers[i] != NO_PLAYER); + ASSERT(veEmbargoedPlayers[i] != NO_PLAYER); if (veEmbargoedPlayers[i] != NO_PLAYER) { if (i != 0) @@ -6743,14 +6743,14 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver } if (effects.bNoResourceHappiness) { - CvAssert(!veBannedResources.empty()); + ASSERT(!veBannedResources.empty()); Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_NO_RESOURCE_HAPPINESS"); CvString sEntries = ""; for (uint i = 0; i < veBannedResources.size(); i++) { Localization::String sTempEntry = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_NO_RESOURCE_HAPPINESS_ENTRY"); CvResourceInfo* pInfo = GC.getResourceInfo(veBannedResources[i]); - CvAssert(pInfo); + ASSERT(pInfo); if (pInfo) { if (i != 0) @@ -6767,13 +6767,13 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver } if (effects.bOpenDoor) { - CvAssert(!veOpenMinors.empty()); + ASSERT(!veOpenMinors.empty()); Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_OPEN_DOOR"); CvString sEntries = ""; for (uint i = 0; i < veOpenMinors.size(); i++) { Localization::String sTempEntry = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_OPEN_DOOR_ENTRY"); - CvAssert(veOpenMinors[i] != NO_PLAYER); + ASSERT(veOpenMinors[i] != NO_PLAYER); if (veOpenMinors[i] != NO_PLAYER) { if (i != 0) @@ -6789,13 +6789,13 @@ std::vector CvLeague::GetCurrentEffectsSummary(PlayerTypes /*eObserver } if (effects.bSphereOfInfluence) { - CvAssert(!vePermanentMinors.empty()); + ASSERT(!vePermanentMinors.empty()); Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_SOI"); CvString sEntries = ""; for (uint i = 0; i < vePermanentMinors.size(); i++) { Localization::String sTempEntry = Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_EFFECT_SUMMARY_SOI_ENTRY"); - CvAssert(vePermanentMinors[i] != NO_PLAYER); + ASSERT(vePermanentMinors[i] != NO_PLAYER); if (vePermanentMinors[i] != NO_PLAYER) { PlayerTypes eAlly = GET_PLAYER(vePermanentMinors[i]).GetMinorCivAI()->GetPermanentAlly(); @@ -7008,7 +7008,7 @@ CvString CvLeague::GetLeagueSplashDescription(LeagueSpecialSessionTypes eGoverni { EraTypes eEra = pInfo->GetEraTrigger(); CvEraInfo* pEraInfo = GC.getEraInfo(eEra); - CvAssert(pEraInfo != NULL); + ASSERT(pEraInfo != NULL); if (pEraInfo != NULL) { Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_SPLASH_MESSAGE_GAME_ERA"); @@ -7022,7 +7022,7 @@ CvString CvLeague::GetLeagueSplashDescription(LeagueSpecialSessionTypes eGoverni else { Localization::String sTemp = Localization::Lookup("TXT_KEY_LEAGUE_SPLASH_MESSAGE_FOUNDED"); - CvAssert(HasHostMember()); + ASSERT(HasHostMember()); if (!HasHostMember()) { sTemp << "Nobody"; @@ -7160,7 +7160,7 @@ CvString CvLeague::GetGreatPersonRateModifierDetails(UnitClassTypes /*eGreatPers it->GetEffects()->iScienceyGreatPersonRateMod != 0) { CvResolutionEntry* pInfo = GC.getResolutionInfo(it->GetType()); - CvAssert(pInfo); + ASSERT(pInfo); if (pInfo) { s += "[NEWLINE]"; @@ -7265,7 +7265,7 @@ void CvLeague::CheckStartSpecialSession(LeagueSpecialSessionTypes eSpecialSessio if (CanStartSpecialSession(eSpecialSession)) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eSpecialSession); - CvAssert(pInfo); + ASSERT(pInfo); if (pInfo != NULL) { CvGame& kGame = GC.getGame(); @@ -7282,14 +7282,14 @@ void CvLeague::CheckStartSpecialSession(LeagueSpecialSessionTypes eSpecialSessio GetLocalizedText(pInfo->GetDescriptionKey()).GetCString()); // Becomes United Nations? - CvAssert(!(!pInfo->IsUnitedNations() && IsUnitedNations())); // UN shouldn't be reversible + ASSERT(!(!pInfo->IsUnitedNations() && IsUnitedNations())); // UN shouldn't be reversible if (pInfo->IsUnitedNations()) { SetUnitedNations(true); } // Only actually hold a session if there is a proposal to be decided - CvAssertMsg(pInfo->GetImmediateProposal() != NO_RESOLUTION, "Cannot hold special session because there is no proposal to decide on. Please send Anton your save file and version."); + ASSERT(pInfo->GetImmediateProposal() != NO_RESOLUTION, "Cannot hold special session because there is no proposal to decide on."); if (pInfo->GetImmediateProposal() != NO_RESOLUTION) { StartSpecialSession(eSpecialSession); @@ -7304,11 +7304,11 @@ void CvLeague::StartSpecialSession(LeagueSpecialSessionTypes eSpecialSession) // Immediate Proposal CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eSpecialSession); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { ResolutionTypes eProposal = pInfo->GetImmediateProposal(); - CvAssert(eProposal != NO_RESOLUTION) + ASSERT(eProposal != NO_RESOLUTION) if (eProposal != NO_RESOLUTION) { // Put other proposals on hold @@ -7356,7 +7356,7 @@ void CvLeague::FinishSession() if (GetLastSpecialSession() != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(GetLastSpecialSession()); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { eRecurringProposal = pInfo->GetRecurringProposal(); @@ -8090,20 +8090,20 @@ void CvLeague::FinishSession() // Since it failed, it may provide members with extra votes CvResolutionEntry* pInfo = GC.getResolutionInfo(it->GetType()); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { if (pInfo->GetLeadersVoteBonusOnFail() > 0) { bool bChoicesArePlayers = (pInfo->GetVoterDecision() == RESOLUTION_DECISION_MAJOR_CIV_MEMBER || pInfo->GetVoterDecision() == RESOLUTION_DECISION_OTHER_MAJOR_CIV_MEMBER); - CvAssertMsg(bChoicesArePlayers, "Trying to give bonus delegates since a resolution failed, but voter decision is unexpected type. Please send Anton your save file and version."); + ASSERT(bChoicesArePlayers, "Trying to give bonus delegates since a resolution failed, but voter decision is unexpected type."); if (bChoicesArePlayers) { std::vector vBonusVotePlayers = it->GetVoterDecision()->GetTopVotedChoices(/*2 in CP, 1 in CSD*/ GD_INT_GET(LEAGUE_NUM_LEADERS_FOR_EXTRA_VOTES)); for (uint i = 0; i < vBonusVotePlayers.size(); i++) { Member* pMember = GetMember((PlayerTypes)vBonusVotePlayers[i]); - CvAssert(pMember != NULL); + ASSERT(pMember != NULL); if (pMember != NULL) { pMember->iExtraVotes = pMember->iExtraVotes + pInfo->GetLeadersVoteBonusOnFail(); @@ -8147,7 +8147,7 @@ void CvLeague::FinishSession() else { // Players get to make the proposals for next session - CvAssertMsg(!IsAnythingProposed(), "Assigning proposal privileges to players when something is already proposed. Please send Anton your save file and version."); + ASSERT(!IsAnythingProposed(), "Assigning proposal privileges to players when something is already proposed."); AssignProposalPrivileges(); } @@ -8202,8 +8202,8 @@ void CvLeague::AssignProposalPrivileges() } else { - CvAssertMsg(!it->bMayPropose, "Found a member with proposal rights that should not have them. Please send Anton your save file and version."); - CvAssertMsg(it->iProposals == 0, "Found a member with remaining proposals that should not have them. Please send Anton your save file and version."); + ASSERT(!it->bMayPropose, "Found a member with proposal rights that should not have them."); + ASSERT(it->iProposals == 0, "Found a member with remaining proposals that should not have them."); } } vpPossibleProposers.StableSortItems(); @@ -8237,7 +8237,7 @@ void CvLeague::AssignProposalPrivileges() } } - CvAssert(iPrivileges == 0); + ASSERT(iPrivileges == 0); } void CvLeague::CheckProposalsValid() @@ -8299,13 +8299,13 @@ void CvLeague::AssignNewHost() iHighestVotes = iVotes; } } - CvAssert(eNewHost != NO_PLAYER); + ASSERT(eNewHost != NO_PLAYER); SetHostMember(eNewHost); } void CvLeague::DoEnactResolution(CvEnactProposal* pProposal) { - CvAssertMsg(pProposal->IsPassed(GetVotesSpentThisSession()), "Doing a proposal that has not been passed. Please send Anton your save file and version."); + ASSERT(pProposal->IsPassed(GetVotesSpentThisSession()), "Doing a proposal that has not been passed."); CvActiveResolution resolution(pProposal); for (uint i = 0; i < m_vMembers.size(); i++) @@ -8329,7 +8329,7 @@ void CvLeague::DoEnactResolution(CvEnactProposal* pProposal) LeagueProjectTypes eProject = resolution.GetEffects()->eLeagueProjectEnabled; if (eProject != NO_LEAGUE_PROJECT) { - CvAssertMsg(!IsProjectActive(eProject), "Trying to start a League Project that is already active. Please send Anton your save file and version."); + ASSERT(!IsProjectActive(eProject), "Trying to start a League Project that is already active."); StartProject(eProject); } @@ -8338,7 +8338,7 @@ void CvLeague::DoEnactResolution(CvEnactProposal* pProposal) void CvLeague::DoRepealResolution(CvRepealProposal* pProposal) { - CvAssertMsg(pProposal->IsPassed(GetVotesSpentThisSession()), "Doing a proposal that has not been passed. Please send Anton your save file and version."); + ASSERT(pProposal->IsPassed(GetVotesSpentThisSession()), "Doing a proposal that has not been passed."); int iFound = 0; for (ActiveResolutionList::iterator it = m_vActiveResolutions.begin(); it != m_vActiveResolutions.end(); ) @@ -8364,7 +8364,7 @@ void CvLeague::DoRepealResolution(CvRepealProposal* pProposal) else ++it; } - CvAssertMsg(iFound == 1, "Unexpected number of active resolutions with this ID. Please send Anton your save file and version."); + ASSERT(iFound == 1, "Unexpected number of active resolutions with this ID."); } void CvLeague::DoClearProposals() @@ -8394,7 +8394,7 @@ void CvLeague::DoClearProposals() void CvLeague::DoPutProposalsOnHold() { // Should not already have proposals on hold! - CvAssertMsg(!HasProposalsOnHold(), "Attempting to put proposals on hold (for a special session), but proposals are already on hold. Please send Anton your save file and version."); + ASSERT(!HasProposalsOnHold(), "Attempting to put proposals on hold (for a special session), but proposals are already on hold."); m_vEnactProposalsOnHold.clear(); m_vRepealProposalsOnHold.clear(); @@ -8436,7 +8436,7 @@ void CvLeague::NotifySessionDone() void CvLeague::NotifyProposalResult(CvEnactProposal* pProposal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal == NULL) return; #if defined(MOD_EVENTS_RESOLUTIONS) @@ -8451,7 +8451,7 @@ void CvLeague::NotifyProposalResult(CvEnactProposal* pProposal) if (pProposal->IsPassed(GetVotesSpentThisSession())) { PlayerTypes eWinner = (PlayerTypes) pProposal->GetVoterDecision()->GetDecision(); - CvAssert(eWinner != NO_PLAYER); + ASSERT(eWinner != NO_PLAYER); if (eWinner != NO_PLAYER) { Localization::String sTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_WORLD_LEADER_PASS"); @@ -8482,14 +8482,14 @@ void CvLeague::NotifyProposalResult(CvEnactProposal* pProposal) // Change Host results are handled a little differently PlayerTypes eOldHost = GetHostMember(); PlayerTypes eNewHost = eOldHost; - CvAssert(pProposal->IsPassed(GetVotesSpentThisSession())); + ASSERT(pProposal->IsPassed(GetVotesSpentThisSession())); if (pProposal->IsPassed(GetVotesSpentThisSession())) { eNewHost = (PlayerTypes) pProposal->GetVoterDecision()->GetDecision(); } CvString sHostKey = "Nobody"; - CvAssertMsg(eNewHost != NO_PLAYER, "Could not determine the new host. Please send Anton your save file and version."); + ASSERT(eNewHost != NO_PLAYER, "Could not determine the new host."); if (eNewHost != NO_PLAYER) { sHostKey = GET_PLAYER(eNewHost).getCivilizationShortDescriptionKey(); @@ -8561,7 +8561,7 @@ void CvLeague::NotifyProposalResult(CvEnactProposal* pProposal) void CvLeague::NotifyProposalResult(CvRepealProposal* pProposal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal == NULL) return; Localization::String sSummaryTemp = Localization::Lookup("TXT_KEY_NOTIFICATION_LEAGUE_VOTING_RESULT_FAIL_SUMMARY"); @@ -8636,7 +8636,7 @@ void CvLeague::NotifySessionSoon(int iTurnsLeft) void CvLeague::NotifyProjectComplete(LeagueProjectTypes eProject) { CvLeagueProjectEntry* pInfo = GC.getLeagueProjectInfo(eProject); - CvAssertMsg(pInfo, "Could not find League Project info when sending out a progress update. Please send Anton your save file and version."); + ASSERT(pInfo, "Could not find League Project info when sending out a progress update."); if (pInfo) { for (int iPlayerLoop = 0; iPlayerLoop < MAX_PLAYERS; iPlayerLoop++) @@ -8664,7 +8664,7 @@ void CvLeague::NotifyProjectComplete(LeagueProjectTypes eProject) void CvLeague::NotifyProjectProgress(LeagueProjectTypes eProject) { CvLeagueProjectEntry* pInfo = GC.getLeagueProjectInfo(eProject); - CvAssertMsg(pInfo, "Could not find League Project info when sending out a progress update. Please send Anton your save file and version."); + ASSERT(pInfo, "Could not find League Project info when sending out a progress update."); if (pInfo) { for (MemberList::iterator it = m_vMembers.begin(); it != m_vMembers.end(); ++it) @@ -8697,7 +8697,7 @@ void CvLeague::NotifyProjectProgress(LeagueProjectTypes eProject) void CvLeague::StartProject(LeagueProjectTypes eLeagueProject) { - CvAssertMsg(!IsProjectActive(eLeagueProject), "Attempting to start a League Project which is already underway. Please send Anton your save file and version."); + ASSERT(!IsProjectActive(eLeagueProject), "Attempting to start a League Project which is already underway."); if (!IsProjectActive(eLeagueProject)) { Project project; @@ -8739,7 +8739,7 @@ void CvLeague::CheckProjectsProgress() // How much do we need? int iNeeded = GetProjectCost(it->eType); - CvAssertMsg(iNeeded != 0, "Invalid cost for League Project. Please send Anton your save file and version."); + ASSERT(iNeeded != 0, "Invalid cost for League Project."); // How much do we have? int iTotal = GetProjectProgress(it->eType); @@ -8747,7 +8747,7 @@ void CvLeague::CheckProjectsProgress() // Is it finished? if (iTotal >= iNeeded) { - CvAssert(!it->bComplete); + ASSERT(!it->bComplete); if (!it->bComplete) { DoProjectRewards(it->eType); @@ -8785,7 +8785,7 @@ void CvLeague::CheckProjectsProgress() void CvLeague::DoProjectRewards(LeagueProjectTypes eLeagueProject) { CvLeagueProjectEntry* pProjectInfo = GC.getLeagueProjectInfo(eLeagueProject); - CvAssert(pProjectInfo); + ASSERT(pProjectInfo); if (!pProjectInfo) return; int iTopTierRecipients = 0; @@ -8817,7 +8817,7 @@ void CvLeague::DoProjectRewards(LeagueProjectTypes eLeagueProject) void CvLeague::DoProjectReward(PlayerTypes ePlayer, LeagueProjectTypes eLeagueProject, ContributionTier eTier) { CvLeagueProjectEntry* pProjectInfo = GC.getLeagueProjectInfo(eLeagueProject); - CvAssert(pProjectInfo); + ASSERT(pProjectInfo); CvPlayer& kPlayer = GET_PLAYER(ePlayer); CvTeam& kTeam = GET_TEAM(kPlayer.getTeam()); @@ -8848,14 +8848,14 @@ void CvLeague::DoProjectReward(PlayerTypes ePlayer, LeagueProjectTypes eLeaguePr for (vector::iterator it = veRewards.begin(); it != veRewards.end(); ++it) { CvLeagueProjectRewardEntry* pRewardInfo = GC.getLeagueProjectRewardInfo(*it); - CvAssert(pRewardInfo); + ASSERT(pRewardInfo); // Free Building in Capital BuildingTypes eBuilding = pRewardInfo->GetBuilding(); if (eBuilding != NO_BUILDING) { CvCity* pCapital = kPlayer.getCapitalCity(); - CvAssertMsg(pCapital, "Player does not have a capital city. Please send Anton your save file and version."); + ASSERT(pCapital, "Player does not have a capital city."); if (pCapital) { CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); @@ -8988,7 +8988,7 @@ void CvLeague::UpdateName() // Must be called while the Congress is still in session, before the proposal is deleted void CvLeague::LogProposalResolved(CvEnactProposal* pProposal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -9003,7 +9003,7 @@ void CvLeague::LogProposalResolved(CvEnactProposal* pProposal) sMessage += ",Proposal Failed"; } - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL && pProposal->GetVoterDecision() != NULL) { sMessage += ","; @@ -9031,7 +9031,7 @@ void CvLeague::LogProposalResolved(CvEnactProposal* pProposal) // Must be called while the Congress is still in session, before the proposal is deleted void CvLeague::LogProposalResolved(CvRepealProposal* pProposal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -9046,7 +9046,7 @@ void CvLeague::LogProposalResolved(CvRepealProposal* pProposal) sMessage += ",Proposal Failed"; } - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL && pProposal->GetRepealDecision() != NULL) { sMessage += ","; @@ -9254,7 +9254,7 @@ void CvGameLeagues::DoTurn() { CvLeague* pLeague = GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); EraTypes eGameEra = LeagueHelpers::GetGameEraForTrigger(); LeagueSpecialSessionTypes eSpecialSession = NO_LEAGUE_SPECIAL_SESSION; @@ -9301,7 +9301,7 @@ void CvGameLeagues::DoTurn() // Flag this era as the last era we did a special session CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eSpecialSession); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { SetLastEraTrigger(pInfo->GetEraTrigger()); @@ -9328,7 +9328,7 @@ void CvGameLeagues::DoTurn() VictoryTypes eDiploVictory = (VictoryTypes) GC.getInfoTypeForString("VICTORY_DIPLOMATIC", true); if (eDiploVictory != NO_VICTORY) { - CvAssertMsg(!GC.getGame().isVictoryValid(eDiploVictory), "Diplomacy victory is valid, but leagues are disabled. Please send Anton your save file and version."); + ASSERT(!GC.getGame().isVictoryValid(eDiploVictory), "Diplomacy victory is valid, but leagues are disabled. "); } } } @@ -9443,7 +9443,7 @@ void CvGameLeagues::FoundLeague(PlayerTypes eFounder) { if (!GC.getGame().isOption(GAMEOPTION_NO_LEAGUES)) { - CvAssertMsg(GetNumActiveLeagues() == 0, "Trying to found a second league when one is already active. Please send Anton your save file and version."); + ASSERT(GetNumActiveLeagues() == 0, "Trying to found a second league when one is already active."); if (GetNumActiveLeagues() == 0) { CvLeague league((LeagueTypes)m_iNumLeaguesEverFounded++); @@ -9513,8 +9513,8 @@ void CvGameLeagues::FoundLeague(PlayerTypes eFounder) } } } - CvAssertMsg(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION, "Trying to found a league but could not determine a correct governing special session. Do the World Congress prerequisite tech and the special session era triggers in the database match? Please send Anton your save file and version."); - CvAssertMsg(eGoverningEraTrigger != NO_ERA, "Trying to found a league but could not determine a correct governing era trigger. Do the World Congress prerequisite tech and the special session era triggers in the database match? Please send Anton your save file and version."); + ASSERT(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION, "Trying to found a league but could not determine a correct governing special session. Do the World Congress prerequisite tech and the special session era triggers in the database match?"); + ASSERT(eGoverningEraTrigger != NO_ERA, "Trying to found a league but could not determine a correct governing era trigger. Do the World Congress prerequisite tech and the special session era triggers in the database match?"); league.Init(eGoverningSpecialSession); SetLastEraTrigger(eGoverningEraTrigger); @@ -9632,7 +9632,7 @@ void CvGameLeagues::DoLeagueProjectContribution(PlayerTypes ePlayer, LeagueProje it->ChangeMemberContribution(ePlayer, eLeagueProject, iValue); } } - CvAssertMsg(iMatches == 1, "Unexpected case when contributing to a League Project. Please send Anton your save file and version."); + ASSERT(iMatches == 1, "Unexpected case when contributing to a League Project."); } PlayerTypes CvGameLeagues::GetDiplomaticVictor() const @@ -9643,7 +9643,7 @@ PlayerTypes CvGameLeagues::GetDiplomaticVictor() const void CvGameLeagues::SetDiplomaticVictor(PlayerTypes ePlayer) { // There can be only one - CvAssertMsg(m_eDiplomaticVictor == NO_PLAYER, "Player voted Diplomatic Victor when there already was one. Please send Anton your save file and version."); + ASSERT(m_eDiplomaticVictor == NO_PLAYER, "Player voted Diplomatic Victor when there already was one."); if (m_eDiplomaticVictor == NO_PLAYER) { m_eDiplomaticVictor = ePlayer; @@ -9994,11 +9994,11 @@ void CvGameLeagues::LogSpecialSession(LeagueSpecialSessionTypes eSpecialSession) sMessage += ",Congress"; sMessage += ",- - -"; sMessage += ",Special Session"; - CvAssert(eSpecialSession != NO_LEAGUE_SPECIAL_SESSION); + ASSERT(eSpecialSession != NO_LEAGUE_SPECIAL_SESSION); if (eSpecialSession != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pSpecialSessionInfo = GC.getLeagueSpecialSessionInfo(eSpecialSession); - CvAssert(pSpecialSessionInfo); + ASSERT(pSpecialSessionInfo); if (pSpecialSessionInfo) { CvEraInfo* pEraInfo = GC.getEraInfo(pSpecialSessionInfo->GetEraTrigger()); @@ -10156,7 +10156,7 @@ void CvLeagueAI::DoVotes(CvLeague* pLeague) iAttempts++; if (iAttempts > 100) { - CvAssertMsg(false, "AI unable to finish doing votes. Please send Anton your save file and version."); + ASSERT(false, "AI unable to finish doing votes."); DoAbstainAllVotes(pLeague); break; } @@ -10177,7 +10177,7 @@ void CvLeagueAI::DoProposals(CvLeague* pLeague) iAttempts++; if (iAttempts > 100) { - CvAssertMsg(false, "AI unable to finish doing proposals. Please send Anton your save file and version."); + ASSERT(false, "AI unable to finish doing proposals."); break; } } @@ -10232,7 +10232,7 @@ CvLeagueAI::VoteCommitmentList CvLeagueAI::GetDesiredVoteCommitments(PlayerTypes } else { - CvAssertMsg(false, "Unexpected case when evaluating a possible Delegate trade with a human player. Please send Anton your save file and version."); + ASSERT(false, "Unexpected case when evaluating a possible Delegate trade with a human player."); } if (iDesiredChoice != LeagueHelpers::CHOICE_NONE) @@ -10271,7 +10271,7 @@ CvLeagueAI::VoteCommitmentList CvLeagueAI::GetDesiredVoteCommitments(PlayerTypes } else { - CvAssertMsg(false, "Unexpected case when evaluating a possible Delegate trade with a human player. Please send Anton your save file and version."); + ASSERT(false, "Unexpected case when evaluating a possible Delegate trade with a human player."); } if (iDesiredChoice != LeagueHelpers::CHOICE_NONE) @@ -10385,8 +10385,8 @@ int CvLeagueAI::GetVoteCommitment(PlayerTypes eToPlayer, int iResolutionID, int // Can someone secure our vote on a certain matter through a deal? bool CvLeagueAI::CanCommitVote(PlayerTypes eToPlayer, CvString* sTooltipSink) { - CvAssertMsg(eToPlayer >= 0, "eToPlayer is expected to be non-negative (invalid Index). Please send Anton your save file and version."); - CvAssertMsg(eToPlayer < MAX_MAJOR_CIVS, "eToPlayer is expected to be within maximum bounds (invalid Index). Please send Anton your save file and version."); + ASSERT(eToPlayer >= 0, "eToPlayer is expected to be non-negative (invalid Index)."); + ASSERT(eToPlayer < MAX_MAJOR_CIVS, "eToPlayer is expected to be within maximum bounds (invalid Index)."); if (eToPlayer < 0 || eToPlayer >= MAX_MAJOR_CIVS) return false; bool bCanCommit = true; @@ -10496,8 +10496,8 @@ void CvLeagueAI::DoVoteCommitments(CvLeague* pLeague) { for (VoteCommitmentList::iterator it = m_vVoteCommitmentList.begin(); it != m_vVoteCommitmentList.end(); ) { - CvAssertMsg(pLeague->CanVote(GetPlayer()->GetID()), "Trying to honor vote commitments but not able to vote. Please send Anton your save file and version."); - CvAssertMsg(pLeague->GetRemainingVotesForMember(GetPlayer()->GetID()) >= it->iNumVotes, "Trying to honor vote commitments but not enough votes. Please send Anton your save file and version."); + ASSERT(pLeague->CanVote(GetPlayer()->GetID()), "Trying to honor vote commitments but not able to vote."); + ASSERT(pLeague->GetRemainingVotesForMember(GetPlayer()->GetID()) >= it->iNumVotes, "Trying to honor vote commitments but not enough votes."); bool bProcessed = false; int iSetVotes = pLeague->GetRemainingVotesForMember(GetPlayer()->GetID()); @@ -10578,10 +10578,10 @@ CvLeagueAI::DesireLevels CvLeagueAI::EvaluateVoteForTrade(int iResolutionID, int if (GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0) { CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (pLeague != NULL) { - CvAssert(iNumVotes == pLeague->GetCoreVotesForMember(GetPlayer()->GetID())); + ASSERT(iNumVotes == pLeague->GetCoreVotesForMember(GetPlayer()->GetID())); if (pLeague->IsProposed(iResolutionID, bRepeal)) { // Vote to repeal @@ -10620,7 +10620,7 @@ CvLeagueAI::DesireLevels CvLeagueAI::EvaluateVoteForTrade(int iResolutionID, int // How much do we like an enact proposal, so that we can give a hint to the player making proposals? CvLeagueAI::DesireLevels CvLeagueAI::EvaluateProposalForProposer(CvLeague* pLeague, PlayerTypes /*eProposer*/, ResolutionTypes eResolution, int iProposerChoice) { - CvAssert(pLeague); + ASSERT(pLeague); if (!pLeague) { return DESIRE_NEUTRAL; @@ -10633,7 +10633,7 @@ CvLeagueAI::DesireLevels CvLeagueAI::EvaluateProposalForProposer(CvLeague* pLeag // How much do we like a repeal proposal, so that we can give a hint to the player making proposals? CvLeagueAI::DesireLevels CvLeagueAI::EvaluateProposalForProposer(CvLeague* pLeague, PlayerTypes /*eProposer*/, int iTargetResolutionID) { - CvAssert(pLeague); + ASSERT(pLeague); if (!pLeague) { return DESIRE_NEUTRAL; @@ -10651,7 +10651,7 @@ CvLeagueAI::DesireLevels CvLeagueAI::EvaluateProposalForProposer(CvLeague* pLeag break; } } - CvAssert(bFound); + ASSERT(bFound); return eDesire; } @@ -11174,8 +11174,8 @@ CvLeagueAI::KnowledgeLevels CvLeagueAI::GetKnowledgeGivenToOtherPlayer(PlayerTyp int CvLeagueAI::EvaluateVoteForOtherPlayerKnowledge(CvLeague* pLeague, PlayerTypes eToPlayer, CvEnactProposal* pProposal, CvString* sTooltipSink) { - CvAssert(pLeague); - CvAssert(pProposal); + ASSERT(pLeague); + ASSERT(pProposal); if (!pLeague || !pProposal) { return LeagueHelpers::CHOICE_NONE; @@ -11212,7 +11212,7 @@ int CvLeagueAI::EvaluateVoteForOtherPlayerKnowledge(CvLeague* pLeague, PlayerTyp iTopChoiceScore = iChoiceScore; } } - CvAssert(iTopChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iTopChoice != LeagueHelpers::CHOICE_NONE); iRevealedChoice = iTopChoice; if (sTooltipSink != NULL) { @@ -11239,7 +11239,7 @@ int CvLeagueAI::EvaluateVoteForOtherPlayerKnowledge(CvLeague* pLeague, PlayerTyp iTopChoiceScore = iChoiceScore; } } - CvAssert(iTopChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iTopChoice != LeagueHelpers::CHOICE_NONE); iRevealedChoice = iTopChoice; if (sTooltipSink != NULL) { @@ -11258,8 +11258,8 @@ int CvLeagueAI::EvaluateVoteForOtherPlayerKnowledge(CvLeague* pLeague, PlayerTyp int CvLeagueAI::EvaluateVoteForOtherPlayerKnowledge(CvLeague* pLeague, PlayerTypes eToPlayer, CvRepealProposal* pProposal, CvString* sTooltipSink) { - CvAssert(pLeague); - CvAssert(pProposal); + ASSERT(pLeague); + ASSERT(pProposal); if (!pLeague || !pProposal) { return LeagueHelpers::CHOICE_NONE; @@ -11410,11 +11410,11 @@ int CvLeagueAI::GetExtraVotesPerCityStateAlly() eGoverningSpecialSession = pLeague->GetLastSpecialSession(); } - CvAssert(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); + ASSERT(eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION); if (eGoverningSpecialSession != NO_LEAGUE_SPECIAL_SESSION) { CvLeagueSpecialSessionEntry* pInfo = GC.getLeagueSpecialSessionInfo(eGoverningSpecialSession); - CvAssert(pInfo != NULL); + ASSERT(pInfo != NULL); if (pInfo != NULL) { iVotes += pInfo->GetCityStateDelegates(); @@ -11579,7 +11579,7 @@ CvLeagueAI::DesireLevels CvLeagueAI::EvaluateDesireForVoteOutcome(CvProposal* pP // Find the most preferred use of our votes in the session of pLeague, and allocate them with some randomness void CvLeagueAI::AllocateVotes(CvLeague* pLeague) { - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (pLeague == NULL) return; @@ -11717,7 +11717,7 @@ void CvLeagueAI::AllocateVotes(CvLeague* pLeague) if (vVotesAllocated.GetElement(i).bEnact) { CvEnactProposal* pProposal = pLeague->GetEnactProposal(vVotesAllocated.GetElement(i).iID); - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { LogVoteChoiceCommitted(pProposal, vVotesAllocated.GetElement(i).iChoice, vVotesAllocated.GetWeight(i)); @@ -11726,7 +11726,7 @@ void CvLeagueAI::AllocateVotes(CvLeague* pLeague) else { CvRepealProposal* pProposal = pLeague->GetRepealProposal(vVotesAllocated.GetElement(i).iID); - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { LogVoteChoiceCommitted(pProposal, vVotesAllocated.GetElement(i).iChoice, vVotesAllocated.GetWeight(i)); @@ -11742,10 +11742,10 @@ void CvLeagueAI::FindBestVoteChoices(CvEnactProposal* pProposal, VoteConsiderati VoteConsiderationList vScoredChoices; int iMaxChoicesToConsider = 1; - CvAssert(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); + ASSERT(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); if (GC.getGame().GetGameLeagues()->GetNumActiveLeagues() <= 0) return; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (pLeague == NULL) return; switch (pProposal->GetVoterDecision()->GetType()) @@ -11764,7 +11764,7 @@ void CvLeagueAI::FindBestVoteChoices(CvEnactProposal* pProposal, VoteConsiderati } default: { - CvAssertMsg(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); + ASSERT(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); break; } } @@ -11796,10 +11796,10 @@ void CvLeagueAI::FindBestVoteChoices(CvRepealProposal* pProposal, VoteConsiderat VoteConsiderationList vScoredChoices; int iMaxChoicesToConsider = 1; - CvAssert(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); + ASSERT(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); if (!(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0)) return; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (!(pLeague != NULL)) return; switch (pProposal->GetRepealDecision()->GetType()) @@ -11811,7 +11811,7 @@ void CvLeagueAI::FindBestVoteChoices(CvRepealProposal* pProposal, VoteConsiderat } default: { - CvAssertMsg(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); + ASSERT(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); break; } } @@ -11840,12 +11840,12 @@ void CvLeagueAI::FindBestVoteChoices(CvRepealProposal* pProposal, VoteConsiderat // Score a particular choice on a particular proposal int CvLeagueAI::ScoreVoteChoice(CvEnactProposal* pProposal, int iChoice, bool bConsiderGlobal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return 0; - CvAssert(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); + ASSERT(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); if (!(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0)) return 0; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (!(pLeague != NULL)) return 0; int iScore = 0; @@ -11866,7 +11866,7 @@ int CvLeagueAI::ScoreVoteChoice(CvEnactProposal* pProposal, int iChoice, bool bC } default: { - CvAssertMsg(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); + ASSERT(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); break; } } @@ -11877,12 +11877,12 @@ int CvLeagueAI::ScoreVoteChoice(CvEnactProposal* pProposal, int iChoice, bool bC // Score a particular choice on a particular proposal int CvLeagueAI::ScoreVoteChoice(CvRepealProposal* pProposal, int iChoice, bool bConsiderGlobal) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return 0; - CvAssert(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); + ASSERT(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0); if (!(GC.getGame().GetGameLeagues()->GetNumActiveLeagues() > 0)) return 0; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (!(pLeague != NULL)) return 0; int iScore = 0; @@ -11896,7 +11896,7 @@ int CvLeagueAI::ScoreVoteChoice(CvRepealProposal* pProposal, int iChoice, bool b } default: { - CvAssertMsg(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); + ASSERT(false, "Unexpected decision type when evaluating choices for AI on a proposed resolution."); break; } } @@ -12344,7 +12344,7 @@ int CvLeagueAI::ScoreVoteChoiceYesNo(CvProposal* pProposal, int iChoice, bool bE // Embargo if (pProposal->GetEffects()->bEmbargoPlayer) { - CvAssertMsg(eTargetPlayer != NO_PLAYER, "Evaluating an embargo on NO_PLAYER. Please send Anton your save file and version."); + ASSERT(eTargetPlayer != NO_PLAYER, "Evaluating an embargo on NO_PLAYER."); iExtra = 0; int iTradeDealValue = 0; // Major Civ relations @@ -12408,7 +12408,7 @@ int CvLeagueAI::ScoreVoteChoiceYesNo(CvProposal* pProposal, int iChoice, bool bE // Ban Luxury if (pProposal->GetEffects()->bNoResourceHappiness) { - CvAssertMsg(eTargetLuxury != NO_RESOURCE, "Evaluating banning Happiness for NO_RESOURCE. Please send Anton your save file and version."); + ASSERT(eTargetLuxury != NO_RESOURCE, "Evaluating banning Happiness for NO_RESOURCE."); iExtra = 0; // What other major civs have this resource? @@ -12809,7 +12809,7 @@ int CvLeagueAI::ScoreVoteChoiceYesNo(CvProposal* pProposal, int iChoice, bool bE pProposal->GetEffects()->iHolyCityTourism != 0 || pProposal->GetEffects()->iReligionSpreadStrengthMod != 0) { - CvAssertMsg(eTargetReligion != NO_RELIGION, "Evaluating World Religion for NO_RELIGION. Please send Anton your save file and version."); + ASSERT(eTargetReligion != NO_RELIGION, "Evaluating World Religion for NO_RELIGION."); iExtra = 0; ReligionTypes eFoundedReligion = GetPlayer()->GetReligions()->GetOwnedReligion(); @@ -12897,7 +12897,7 @@ int CvLeagueAI::ScoreVoteChoiceYesNo(CvProposal* pProposal, int iChoice, bool bE if (pProposal->GetEffects()->iVotesForFollowingIdeology != 0 || pProposal->GetEffects()->iOtherIdeologyRebellionMod != 0) { - CvAssertMsg(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "Evaluating World Ideology for NO_POLICY_BRANCH_TYPE. Please send Anton your save file and version."); + ASSERT(eTargetIdeology != NO_POLICY_BRANCH_TYPE, "Evaluating World Ideology for NO_POLICY_BRANCH_TYPE."); iExtra = 0; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); if (pLeague) @@ -13672,15 +13672,15 @@ int CvLeagueAI::ScoreVoteChoiceYesNo(CvProposal* pProposal, int iChoice, bool bE // Score a particular choice on a particular proposal which is a decision between players (ex. Choose Host, World Leader) int CvLeagueAI::ScoreVoteChoicePlayer(CvProposal* pProposal, int iChoice, bool bEnact) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return 0; - CvAssertMsg(bEnact, "Unexpected case when evaluating vote choices for AI. Please send Anton your save file and version."); + ASSERT(bEnact, "Unexpected case when evaluating vote choices for AI."); if (!bEnact) return 0; PlayerTypes eChoicePlayer = (PlayerTypes) iChoice; - CvAssert(eChoicePlayer != NO_PLAYER); + ASSERT(eChoicePlayer != NO_PLAYER); if (!(eChoicePlayer != NO_PLAYER)) return 0; CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetActiveLeague(); - CvAssert(pLeague != NULL); + ASSERT(pLeague != NULL); if (!(pLeague != NULL)) return 0; PlayerTypes ePlayer = GetPlayer()->GetID(); @@ -13972,7 +13972,7 @@ int CvLeagueAI::ScoreProposal(CvLeague* pLeague, ResolutionTypes eResolution, in if (eVoteDecision == RESOLUTION_DECISION_YES_OR_NO) { std::vector vVoteChoices = pLeague->GetChoicesForDecision(fakeProposal.GetVoterDecision()->GetType(), GetPlayer()->GetID()); - CvAssert(!vVoteChoices.empty()); + ASSERT(!vVoteChoices.empty()); for (uint i = 0; i < vVoteChoices.size(); i++) { if (vVoteChoices[i] == LeagueHelpers::CHOICE_YES) @@ -13983,7 +13983,7 @@ int CvLeagueAI::ScoreProposal(CvLeague* pLeague, ResolutionTypes eResolution, in } } } - CvAssert(bFoundYes); + ASSERT(bFoundYes); return iYesScore; } @@ -13999,7 +13999,7 @@ int CvLeagueAI::ScoreProposal(CvLeague* pLeague, CvActiveResolution* pResolution if (eVoteDecision == RESOLUTION_DECISION_REPEAL) { std::vector vVoteChoices = pLeague->GetChoicesForDecision(fakeProposal.GetRepealDecision()->GetType(), GetPlayer()->GetID()); - CvAssert(!vVoteChoices.empty()); + ASSERT(!vVoteChoices.empty()); for (uint i = 0; i < vVoteChoices.size(); i++) { if (vVoteChoices[i] == LeagueHelpers::CHOICE_YES) @@ -14010,7 +14010,7 @@ int CvLeagueAI::ScoreProposal(CvLeague* pLeague, CvActiveResolution* pResolution } } } - CvAssert(bFoundYes); + ASSERT(bFoundYes); return iYesScore; } @@ -14105,7 +14105,7 @@ void CvLeagueAI::LogProposalConsidered(ProposalConsideration* pProposal, int iCh void CvLeagueAI::LogVoteChoiceConsidered(CvEnactProposal* pProposal, int iChoice, int iScore) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -14115,14 +14115,14 @@ void CvLeagueAI::LogVoteChoiceConsidered(CvEnactProposal* pProposal, int iChoice sMessage += ",Evaluating for Delegates"; sMessage += ","; - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { sMessage += pProposal->GetProposalName(/*bForLogging*/ true); } sMessage += ","; - CvAssert(iChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iChoice != LeagueHelpers::CHOICE_NONE); if (iChoice != LeagueHelpers::CHOICE_NONE) { sMessage += LeagueHelpers::GetTextForChoice(pProposal->GetVoterDecision()->GetType(), iChoice); @@ -14138,7 +14138,7 @@ void CvLeagueAI::LogVoteChoiceConsidered(CvEnactProposal* pProposal, int iChoice void CvLeagueAI::LogVoteChoiceConsidered(CvRepealProposal* pProposal, int iChoice, int iScore) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -14148,14 +14148,14 @@ void CvLeagueAI::LogVoteChoiceConsidered(CvRepealProposal* pProposal, int iChoic sMessage += ",Evaluating for Delegates"; sMessage += ","; - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { sMessage += pProposal->GetProposalName(/*bForLogging*/ true); } sMessage += ","; - CvAssert(iChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iChoice != LeagueHelpers::CHOICE_NONE); if (iChoice != LeagueHelpers::CHOICE_NONE) { sMessage += LeagueHelpers::GetTextForChoice(pProposal->GetRepealDecision()->GetType(), iChoice); @@ -14171,7 +14171,7 @@ void CvLeagueAI::LogVoteChoiceConsidered(CvRepealProposal* pProposal, int iChoic void CvLeagueAI::LogVoteChoiceCommitted(CvEnactProposal* pProposal, int iChoice, int iVotes) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -14181,14 +14181,14 @@ void CvLeagueAI::LogVoteChoiceCommitted(CvEnactProposal* pProposal, int iChoice, sMessage += ",Committing Delegates"; sMessage += ","; - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { sMessage += pProposal->GetProposalName(/*bForLogging*/ true); } sMessage += ","; - CvAssert(iChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iChoice != LeagueHelpers::CHOICE_NONE); if (iChoice != LeagueHelpers::CHOICE_NONE) { sMessage += LeagueHelpers::GetTextForChoice(pProposal->GetVoterDecision()->GetType(), iChoice); @@ -14204,7 +14204,7 @@ void CvLeagueAI::LogVoteChoiceCommitted(CvEnactProposal* pProposal, int iChoice, void CvLeagueAI::LogVoteChoiceCommitted(CvRepealProposal* pProposal, int iChoice, int iVotes) { - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (!(pProposal != NULL)) return; CvString sMessage = ""; @@ -14214,14 +14214,14 @@ void CvLeagueAI::LogVoteChoiceCommitted(CvRepealProposal* pProposal, int iChoice sMessage += ",Committing Delegates"; sMessage += ","; - CvAssert(pProposal != NULL); + ASSERT(pProposal != NULL); if (pProposal != NULL) { sMessage += pProposal->GetProposalName(/*bForLogging*/ true); } sMessage += ","; - CvAssert(iChoice != LeagueHelpers::CHOICE_NONE); + ASSERT(iChoice != LeagueHelpers::CHOICE_NONE); if (iChoice != LeagueHelpers::CHOICE_NONE) { sMessage += LeagueHelpers::GetTextForChoice(pProposal->GetRepealDecision()->GetType(), iChoice); diff --git a/CvGameCoreDLL_Expansion2/CvWonderProductionAI.cpp b/CvGameCoreDLL_Expansion2/CvWonderProductionAI.cpp index e865d42e0f..a53cd942d2 100644 --- a/CvGameCoreDLL_Expansion2/CvWonderProductionAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvWonderProductionAI.cpp @@ -47,7 +47,7 @@ void CvWonderProductionAI::Init(CvBuildingXMLEntries* pBuildings, CvPlayer* pPla /// Clear out AI local variables void CvWonderProductionAI::Reset() { - CvAssertMsg(m_pBuildings != NULL, "Wonder Production AI init failure: building entries are NULL"); + ASSERT(m_pBuildings != NULL, "Wonder Production AI init failure: building entries are NULL"); // Reset vector m_WonderAIWeights.clear(); diff --git a/CvGameCoreDLL_Expansion2/CvWorldBuilderMapLoader.cpp b/CvGameCoreDLL_Expansion2/CvWorldBuilderMapLoader.cpp index 0e08fe044d..bcb0e8f806 100644 --- a/CvGameCoreDLL_Expansion2/CvWorldBuilderMapLoader.cpp +++ b/CvGameCoreDLL_Expansion2/CvWorldBuilderMapLoader.cpp @@ -442,7 +442,7 @@ void CvWorldBuilderMapLoader::SetupPlayers() void SetPlayerInitialItems(CvPlayer& kGameplayPlayer, const CvWorldBuilderMap::Player& kSavedPlayer) { CvTreasury* pkTreasury = kGameplayPlayer.GetTreasury(); - FAssertMsg(pkTreasury, "Unable to set gold amount. Treasury Missing!"); + ASSERT(pkTreasury, "Unable to set gold amount. Treasury Missing!"); if(pkTreasury != NULL) pkTreasury->SetGold(kSavedPlayer.m_uiGold); @@ -971,7 +971,7 @@ bool CvWorldBuilderMapLoader::InitMap() { CvMap& kMap = GC.getMap(); - FAssertMsg( + ASSERT( sg_kSave.GetWidth() == kMap.getGridWidth() && sg_kSave.GetHeight() == kMap.getGridHeight(), "Save wrong size"); @@ -1046,7 +1046,7 @@ bool CvWorldBuilderMapLoader::InitMap() { const CvWorldBuilderMap::PlotMapData& kPlotData = sg_kSave.GetPlotData(i); CvPlot* pkPlot = kMap.plotByIndex(i); - FAssertMsg(pkPlot, "Missing CvPlot for this location"); + ASSERT(pkPlot, "Missing CvPlot for this location"); if(pkPlot == NULL) continue; pkPlot->setTerrainType((TerrainTypes)kPlotData.GetTerrainType(), false, false); @@ -1169,7 +1169,7 @@ bool CvWorldBuilderMapLoader::InitMap() { CvPlayer& kCityState = GET_PLAYER(eCityStatePlayer); CvMinorCivAI* pkAI = kCityState.GetMinorCivAI(); - FAssertMsg(pkAI, "Cannot set minor civ influence. Missing CvMinorCivAI."); + ASSERT(pkAI, "Cannot set minor civ influence. Missing CvMinorCivAI."); if(pkAI != NULL) { for(uint uiMajorCiv = 0; uiMajorCiv < uiPlayerCount; ++uiMajorCiv) @@ -1189,7 +1189,7 @@ bool CvWorldBuilderMapLoader::InitMap() { const CvWorldBuilderMap::PlotScenarioData& kPlotData = sg_kSave.GetPlotScenarioData(i); CvPlot* pkPlot = kMap.plotByIndex(i); - FAssertMsg(pkPlot, "Missing CvPlot for this location"); + ASSERT(pkPlot, "Missing CvPlot for this location"); if(pkPlot == NULL) continue; const int iPlotX = pkPlot->getX(); @@ -1240,7 +1240,7 @@ bool CvWorldBuilderMapLoader::InitMap() { const CvWorldBuilderMap::PlotScenarioData& kPlotData = sg_kSave.GetPlotScenarioData(i); CvPlot* pkPlot = kMap.plotByIndex(i); - FAssertMsg(pkPlot, "Missing CvPlot for this location"); + ASSERT(pkPlot, "Missing CvPlot for this location"); if(pkPlot == NULL) continue; const PlayerTypes eOwner = GetPlayerType(kPlotData.m_byCulture); @@ -1305,7 +1305,7 @@ bool CvWorldBuilderMapLoader::Save(const wchar_t* wszFilename, const char* szMap { CvWorldBuilderMap::PlotMapData& kPlotData = sg_kSave.GetPlotData(i); CvPlot* pkPlot = kMap.plotByIndex(i); - FAssertMsg(pkPlot, "Missing CvPlot for this location"); + ASSERT(pkPlot, "Missing CvPlot for this location"); if(pkPlot == NULL) continue; kPlotData.SetTerrainType((byte)pkPlot->getTerrainType()); @@ -1404,7 +1404,7 @@ int CvWorldBuilderMapLoader::LoadModData(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -1413,7 +1413,7 @@ int CvWorldBuilderMapLoader::LoadModData(lua_State* L) lua_getglobal(L, "MapModData"); bool bFoundTable = lua_istable(L, -1); - FAssertMsg(bFoundTable, "Unable to find mod data table"); + ASSERT(bFoundTable, "Unable to find mod data table"); if(!bFoundTable) { lua_settop(L, iTop); @@ -1640,7 +1640,7 @@ int CvWorldBuilderMapLoader::RunPostProcessScript(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -1672,18 +1672,18 @@ int CvWorldBuilderMapLoader::RunPostProcessScript(lua_State* L) const bool bResult = gDLL->GetEvaluatedMapScriptPath(szLua, szMapScriptPath, 1040); if(!bResult) { - FAssertMsg(0, "Failed to find \"PostProcessMap\" in Post Process Map Script."); + ASSERT(0, "Failed to find \"PostProcessMap\" in Post Process Map Script."); } const bool bLoadedMapGenerator = pkScriptSystem->LoadFile(L, szMapScriptPath); - FAssertMsg(bLoadedMapGenerator, "Failed to load Post Process Map Script."); + ASSERT(bLoadedMapGenerator, "Failed to load Post Process Map Script."); if(bLoadedMapGenerator) { lua_getglobal(L, "PostProcessMap"); if(lua_isfunction(L, -1)) pkScriptSystem->CallFunction(L, 0, 0); else - FAssertMsg(0, "Failed to find \"PostProcessMap\" in Post Process Map Script."); + ASSERT(0, "Failed to find \"PostProcessMap\" in Post Process Map Script."); } } } @@ -1714,7 +1714,7 @@ void CvWorldBuilderMapLoader::ValidateTerrain() } } - FAssertMsg(eValidTerrain != NO_TERRAIN, "Could not find ANY valid terrain types!"); + ASSERT(eValidTerrain != NO_TERRAIN, "Could not find ANY valid terrain types!"); const int iPlotCount = kMap.getGridWidth() * kMap.getGridHeight(); for(int i = 0; i < iPlotCount; ++i) @@ -1869,7 +1869,7 @@ void CvWorldBuilderMapLoader::MapPlayerToSlot(uint uiPlayer, PlayerTypes ePlayer sg_auiPlayerSlots[ePlayerSlot] = uiPlayer; - FAssertMsg(eOldSlot != NO_PLAYER, "Player list has holes in it!"); + ASSERT(eOldSlot != NO_PLAYER, "Player list has holes in it!"); if(eOldSlot != NO_PLAYER) sg_auiPlayerSlots[eOldSlot] = uiCurrent; } @@ -1921,7 +1921,7 @@ int CvWorldBuilderMapLoader::GetMapPreview(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -2034,7 +2034,7 @@ int CvWorldBuilderMapLoader::GetMapPlayers(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -2109,7 +2109,7 @@ int CvWorldBuilderMapLoader::AddRandomItems(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -2126,7 +2126,7 @@ int CvWorldBuilderMapLoader::AddRandomItems(lua_State* L) { const char* szLuaFile = "WorldBuilderRandomItems.lua"; const bool bLoadedMapGenerator = pkScriptSystem->LoadFile(L, szLuaFile); - FAssertMsg1(bLoadedMapGenerator, "Failed to load %s", szLuaFile); + FAssert(bLoadedMapGenerator, "Failed to load %s", szLuaFile); if(bLoadedMapGenerator) { if(bRandomGoodies) @@ -2136,7 +2136,7 @@ int CvWorldBuilderMapLoader::AddRandomItems(lua_State* L) if(lua_isfunction(L, -1)) pkScriptSystem->CallFunction(L, 0, 0); else - FAssertMsg2(0, "Failed to find \"%s\" in %s", szGoodiesFunction, szLuaFile); + FAssert(0, "Failed to find \"%s\" in %s", szGoodiesFunction, szLuaFile); } if(bRandomResources) @@ -2146,7 +2146,7 @@ int CvWorldBuilderMapLoader::AddRandomItems(lua_State* L) if(lua_isfunction(L, -1)) pkScriptSystem->CallFunction(L, 0, 0); else - FAssertMsg2(0, "Failed to find \"%s\" in %s", szResourcesFunction, szLuaFile); + FAssert(0, "Failed to find \"%s\" in %s", szResourcesFunction, szLuaFile); } } } @@ -2160,7 +2160,7 @@ int CvWorldBuilderMapLoader::ScatterResources(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -2170,14 +2170,14 @@ int CvWorldBuilderMapLoader::ScatterResources(lua_State* L) if(pkScriptSystem != NULL) { const bool bLoadedMapGenerator = pkScriptSystem->LoadFile(L, "WorldBuilderRandomItems.lua"); - FAssertMsg(bLoadedMapGenerator, "Failed to load WorldBuilderRandomItems.lua"); + ASSERT(bLoadedMapGenerator, "Failed to load WorldBuilderRandomItems.lua"); if(bLoadedMapGenerator) { lua_getglobal(L, "AddResourcesForWorldBuilderMap"); if(lua_isfunction(L, -1)) pkScriptSystem->CallFunction(L, 0, 0); else - FAssertMsg(0, "Failed to find \"AddResourcesForWorldBuilderMap\" in WorldBuilderRandomItems.lua"); + ASSERT(0, "Failed to find \"AddResourcesForWorldBuilderMap\" in WorldBuilderRandomItems.lua"); } } @@ -2190,7 +2190,7 @@ int CvWorldBuilderMapLoader::ScatterGoodies(lua_State* L) { if(L == NULL) { - FAssertMsg(L, "Seriously, you really need a lua state for this."); + ASSERT(L, "Seriously, you really need a lua state for this."); return 0; } @@ -2200,14 +2200,14 @@ int CvWorldBuilderMapLoader::ScatterGoodies(lua_State* L) if(pkScriptSystem != NULL) { const bool bLoadedMapGenerator = pkScriptSystem->LoadFile(L, "WorldBuilderRandomItems.lua"); - FAssertMsg(bLoadedMapGenerator, "Failed to load WorldBuilderRandomItems.lua"); + ASSERT(bLoadedMapGenerator, "Failed to load WorldBuilderRandomItems.lua"); if(bLoadedMapGenerator) { lua_getglobal(L, "AddGoodies"); if(lua_isfunction(L, -1)) pkScriptSystem->CallFunction(L, 0, 0); else - FAssertMsg(0, "Failed to find \"AddGoodies\" in WorldBuilderRandomItems.lua"); + ASSERT(0, "Failed to find \"AddGoodies\" in WorldBuilderRandomItems.lua"); } } diff --git a/CvGameCoreDLL_Expansion2/Lua/CvLuaCity.cpp b/CvGameCoreDLL_Expansion2/Lua/CvLuaCity.cpp index da259c47a1..0c0252f92d 100644 --- a/CvGameCoreDLL_Expansion2/Lua/CvLuaCity.cpp +++ b/CvGameCoreDLL_Expansion2/Lua/CvLuaCity.cpp @@ -2675,7 +2675,7 @@ int CvLuaCity::lSetPopulation(lua_State* L) CvCity* pkCity = GetInstance(L); int iValue = lua_tointeger(L, 2); bool bReassignPop = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : true; - CvAssertMsg(bReassignPop, "It is super dangerous to set this to false. Ken would love to see why you are doing this."); + ASSERT(bReassignPop, "It is super dangerous to set this to false. Ken would love to see why you are doing this."); pkCity->setPopulation(iValue, bReassignPop); return 1; @@ -2688,7 +2688,7 @@ int CvLuaCity::lChangePopulation(lua_State* L) CvCity* pkCity = GetInstance(L); int iChange = lua_tointeger(L, 2); bool bReassignPop = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : true; - CvAssertMsg(bReassignPop, "It is super dangerous to set this to false. Ken would love to see why you are doing this."); + ASSERT(bReassignPop, "It is super dangerous to set this to false. Ken would love to see why you are doing this."); pkCity->changePopulation(iChange, bReassignPop); return 1; @@ -5742,7 +5742,7 @@ int CvLuaCity::lGetBuildingEspionageModifier(lua_State* L) //CvCity* pkCity = GetInstance(L); const BuildingTypes eBuilding = (BuildingTypes) lua_tointeger(L, 2); CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null!"); + ASSERT(pBuildingInfo, "pBuildingInfo is null!"); if (pBuildingInfo) { lua_pushinteger(L, pBuildingInfo->GetEspionageModifier()); @@ -5759,7 +5759,7 @@ int CvLuaCity::lGetBuildingGlobalEspionageModifier(lua_State* L) { const BuildingTypes eBuilding = (BuildingTypes)lua_tointeger(L, 2); CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null!"); + ASSERT(pBuildingInfo, "pBuildingInfo is null!"); if (pBuildingInfo) { lua_pushinteger(L, pBuildingInfo->GetGlobalEspionageModifier()); @@ -5823,7 +5823,7 @@ int CvLuaCity::lGetBuildingConversionModifier(lua_State* L) //CvCity* pkCity = GetInstance(L); const BuildingTypes eBuilding = (BuildingTypes) lua_tointeger(L, 2); CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null!"); + ASSERT(pBuildingInfo, "pBuildingInfo is null!"); if (pBuildingInfo) { lua_pushinteger(L, pBuildingInfo->GetConversionModifier()); @@ -5840,7 +5840,7 @@ int CvLuaCity::lGetBuildingGlobalConversionModifier(lua_State* L) { const BuildingTypes eBuilding = (BuildingTypes)lua_tointeger(L, 2); CvBuildingEntry* pBuildingInfo = GC.getBuildingInfo(eBuilding); - CvAssertMsg(pBuildingInfo, "pBuildingInfo is null!"); + ASSERT(pBuildingInfo, "pBuildingInfo is null!"); if (pBuildingInfo) { lua_pushinteger(L, pBuildingInfo->GetGlobalConversionModifier()); diff --git a/CvGameCoreDLL_Expansion2/Lua/CvLuaGame.cpp b/CvGameCoreDLL_Expansion2/Lua/CvLuaGame.cpp index 3b4508487e..0c048929fb 100644 --- a/CvGameCoreDLL_Expansion2/Lua/CvLuaGame.cpp +++ b/CvGameCoreDLL_Expansion2/Lua/CvLuaGame.cpp @@ -2144,7 +2144,7 @@ int CvLuaGame::lGetAdvisorCounsel(lua_State* L) // close out previous table if(eCurrentAdvisorType != NUM_ADVISOR_TYPES) { - CvAssertMsg(bTableOpen, "Table should be open"); + ASSERT(bTableOpen, "Table should be open"); lua_rawseti(L, iTopLevelLua, eCurrentAdvisorType); bTableOpen = false; } @@ -2156,14 +2156,14 @@ int CvLuaGame::lGetAdvisorCounsel(lua_State* L) break; } eCurrentAdvisorType = eNextAdvisorType; - CvAssertMsg(!bTableOpen, "table should be open"); + ASSERT(!bTableOpen, "table should be open"); lua_createtable(L, 0, 0); bTableOpen = true; iAdvisorTableLevel = lua_gettop(L); iAdvisorIndex = 0; } - CvAssertMsg(bTableOpen, "Table should be open"); + ASSERT(bTableOpen, "Table should be open"); lua_pushstring(L, GC.getGame().GetAdvisorCounsel()->m_aCounsel[ui].m_strTxtKey); lua_rawseti(L, iAdvisorTableLevel, iAdvisorIndex); iAdvisorIndex++; diff --git a/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp b/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp index b90c2ff0de..e580cfde21 100644 --- a/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp +++ b/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp @@ -4678,7 +4678,7 @@ int CvLuaPlayer::lGetPuppetYieldPenalty(lua_State* L) { CvPlayerAI* pkPlayer = GetInstance(L); const YieldTypes eYield = (YieldTypes)lua_tointeger(L, 2); - CvAssertMsg(eYield > NO_YIELD && eYield < NUM_YIELD_TYPES, "Unexpected yield in lGetPuppetYieldPenalty"); + ASSERT(eYield > NO_YIELD && eYield < NUM_YIELD_TYPES, "Unexpected yield in lGetPuppetYieldPenalty"); int iResult = pkPlayer->GetPlayerTraits()->GetPuppetPenaltyReduction() + pkPlayer->GetPuppetYieldPenaltyMod(); switch (eYield) @@ -7007,11 +7007,11 @@ int CvLuaPlayer::lCanAdoptPolicy(lua_State* L) bool bIgnoreCost = luaL_optbool(L, 3, false); CvPlayerAI* pkPlayer = GetInstance(L); - CvAssert(pkPlayer != NULL); + ASSERT(pkPlayer != NULL); if(pkPlayer != NULL) { CvPlayerPolicies* pkPolicies = pkPlayer->GetPlayerPolicies(); - CvAssert(pkPolicies != NULL); + ASSERT(pkPolicies != NULL); if(pkPolicies != NULL) { bool bResult = pkPolicies->CanAdoptPolicy(ePolicy, bIgnoreCost); @@ -7153,7 +7153,7 @@ int CvLuaPlayer::lCanAdoptTenet(lua_State* L) bool bResult = false; CvPlayerPolicies* pkPolicies = pkPlayer->GetPlayerPolicies(); - CvAssert(pkPolicies != NULL); + ASSERT(pkPolicies != NULL); if(pkPolicies != NULL) { bResult = pkPolicies->CanAdoptPolicy(ePolicy, bIgnoreCost); @@ -9830,7 +9830,7 @@ int CvLuaPlayer::lGetIncomingUnitType(lua_State* L) if (pkPlayer->isMinorCiv()) { const CvMinorCivAI* pMinorCivAI = pkPlayer->GetMinorCivAI(); - CvAssert(pMinorCivAI); + ASSERT(pMinorCivAI); if (pMinorCivAI) { const PlayerTypes eFromPlayer = static_cast(lua_tointeger(L, 2)); @@ -9858,7 +9858,7 @@ int CvLuaPlayer::lGetIncomingUnitCountdown(lua_State* L) if (pkPlayer->isMinorCiv()) { const CvMinorCivAI* pMinorCivAI = pkPlayer->GetMinorCivAI(); - CvAssert(pMinorCivAI); + ASSERT(pMinorCivAI); if (pMinorCivAI) { const PlayerTypes eFromPlayer = static_cast(lua_tointeger(L, 2)); @@ -12886,7 +12886,7 @@ int CvLuaPlayer::lGetPolicyEspionageModifier(lua_State* L) { const PolicyTypes iIndex = (PolicyTypes)lua_tointeger(L, 2); CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(iIndex); - CvAssertMsg(pkPolicyInfo, "pkPolicyInfo is null!"); + ASSERT(pkPolicyInfo, "pkPolicyInfo is null!"); if (!pkPolicyInfo) { return 0; @@ -12901,7 +12901,7 @@ int CvLuaPlayer::lGetPolicyEspionageCatchSpiesModifier(lua_State* L) { const PolicyTypes iIndex = (PolicyTypes)lua_tointeger(L, 2); CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(iIndex); - CvAssertMsg(pkPolicyInfo, "pkPolicyInfo is null!"); + ASSERT(pkPolicyInfo, "pkPolicyInfo is null!"); if (!pkPolicyInfo) { return 0; @@ -12917,7 +12917,7 @@ int CvLuaPlayer::lGetPolicyConversionModifier(lua_State* L) { const PolicyTypes iIndex = (PolicyTypes)lua_tointeger(L, 2); CvPolicyEntry* pkPolicyInfo = GC.getPolicyInfo(iIndex); - CvAssertMsg(pkPolicyInfo, "pkPolicyInfo is null!"); + ASSERT(pkPolicyInfo, "pkPolicyInfo is null!"); if (!pkPolicyInfo) { return 0; @@ -14616,7 +14616,7 @@ int CvLuaPlayer::lGetOpinionTable(lua_State* L) str = Localization::Lookup("TXT_KEY_DIPLO_VASSAL_TREATMENT_ENSLAVED").toUTF8(); break; case NO_VASSAL_TREATMENT: - CvAssertMsg(false, "eTreatmentLevel is not expected to be NO_VASSAL_TREATMENT"); + ASSERT(false, "eTreatmentLevel is not expected to be NO_VASSAL_TREATMENT"); break; } @@ -16397,7 +16397,7 @@ int CvLuaPlayer::lGetNumTechsToSteal(lua_State* L) CvPlayerEspionage* pkPlayerEspionage = pkThisPlayer->GetEspionage(); int iPlayer = lua_tointeger(L, 2); - CvAssertMsg(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); + ASSERT(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); PlayerTypes ePlayer = (PlayerTypes)iPlayer; lua_pushinteger(L, pkPlayerEspionage->GetNumTechsToSteal(ePlayer)); return 1; @@ -16440,7 +16440,7 @@ int CvLuaPlayer::lHasRecentIntrigueAbout(lua_State* L) CvPlayerEspionage* pkPlayerEspionage = pkThisPlayer->GetEspionage(); int iPlayer = lua_tointeger(L, 2); - CvAssertMsg(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); + ASSERT(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); PlayerTypes ePlayer = (PlayerTypes)iPlayer; lua_pushboolean(L, pkPlayerEspionage->HasRecentIntrigueAbout(ePlayer)); @@ -16453,7 +16453,7 @@ int CvLuaPlayer::lGetRecentIntrigueInfo(lua_State* L) CvPlayerEspionage* pkPlayerEspionage = pkThisPlayer->GetEspionage(); int iPlayer = lua_tointeger(L, 2); - CvAssertMsg(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); + ASSERT(iPlayer >= 0 && iPlayer < MAX_MAJOR_CIVS, "iPlayer out of bounds"); PlayerTypes eTargetPlayer = (PlayerTypes)iPlayer; IntrigueNotificationMessage* pNotificationMessage = pkPlayerEspionage->GetRecentIntrigueInfo(eTargetPlayer); @@ -16479,7 +16479,7 @@ int CvLuaPlayer::lGetCoupChanceOfSuccess(lua_State* L) bool bIgnoreEnemySpies = luaL_optbool(L, 3, false); int iSpyIndex = pkPlayerEspionage->GetSpyIndexInCity(pkCity); - CvAssertMsg(iSpyIndex >= 0, "iSpyIndex out of bounds"); + ASSERT(iSpyIndex >= 0, "iSpyIndex out of bounds"); if(iSpyIndex < 0) { lua_pushinteger(L, 0); diff --git a/CvGameCoreDLL_Expansion2/Lua/CvLuaUnit.cpp b/CvGameCoreDLL_Expansion2/Lua/CvLuaUnit.cpp index ec1016005f..ea567ef3a4 100644 --- a/CvGameCoreDLL_Expansion2/Lua/CvLuaUnit.cpp +++ b/CvGameCoreDLL_Expansion2/Lua/CvLuaUnit.cpp @@ -4705,7 +4705,7 @@ int CvLuaUnit::lGetPlot(lua_State* L) CvUnit* pkUnit = GetInstance(L); if(!GC.getMap().isPlot(pkUnit->getX(), pkUnit->getY())) { - CvAssertMsg(false, "pUnit plot is not valid. Pushing nil!") + ASSERT(false, "pUnit plot is not valid. Pushing nil!") lua_pushnil(L); return 1; } diff --git a/CvGameCoreDLL_Expansion2/VoxPopuli.vcxproj b/CvGameCoreDLL_Expansion2/VoxPopuli.vcxproj index f4adcf51d0..d16569c85e 100644 --- a/CvGameCoreDLL_Expansion2/VoxPopuli.vcxproj +++ b/CvGameCoreDLL_Expansion2/VoxPopuli.vcxproj @@ -73,7 +73,7 @@ - FXS_IS_DLL;WIN32;_WINDOWS;_USRDLL;EXTERNAL_PAUSING;CVGAMECOREDLL_EXPORTS;FINAL_RELEASE;_CRT_SECURE_NO_WARNINGS;VPDEBUG;DISABLE_CVASSERT;%(PreprocessorDefinitions) + FXS_IS_DLL;WIN32;_WINDOWS;_USRDLL;EXTERNAL_PAUSING;CVGAMECOREDLL_EXPORTS;FINAL_RELEASE;_CRT_SECURE_NO_WARNINGS;VPDEBUG;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase @@ -97,7 +97,7 @@ - FXS_IS_DLL;WIN32;_WINDOWS;_USRDLL;EXTERNAL_PAUSING;CVGAMECOREDLL_EXPORTS;FINAL_RELEASE;_CRT_SECURE_NO_WARNINGS;STRONG_ASSUMPTIONS;NDEBUG;DISABLE_CVASSERT;%(PreprocessorDefinitions) + FXS_IS_DLL;WIN32;_WINDOWS;_USRDLL;EXTERNAL_PAUSING;CVGAMECOREDLL_EXPORTS;FINAL_RELEASE;_CRT_SECURE_NO_WARNINGS;STRONG_ASSUMPTIONS;NDEBUG;VPRELEASE_ERRORMSG;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase diff --git a/FirePlace/include/FireWorks/FAssert.h b/FirePlace/include/FireWorks/FAssert.h index 38f037aac1..84dc5d5246 100644 --- a/FirePlace/include/FireWorks/FAssert.h +++ b/FirePlace/include/FireWorks/FAssert.h @@ -151,14 +151,14 @@ void SetAssertLogCallback( FASSERT_LOG_CALLBACK pfnAssertLogCallback ); #elif !defined(NDEBUG) // Enable minimal assertion behavior for Vox-Populi debug builds. // For release builds we'll consider to assume that Firaxis' assertions hold true. - #define FAssert( expr ) ASSERT(expr) - #define FAssertMsg( expr, msg ) ASSERT(expr) - #define FAssertMsg0( expr, _fmt ) ASSERT(expr) - #define FAssertMsg1( expr, _fmt, _p0 ) ASSERT(expr) - #define FAssertMsg2( expr, _fmt, _p0, _p1 ) ASSERT(expr) - #define FAssertMsg3( expr, _fmt, _p0, _p1, _p2 ) ASSERT(expr) - #define FAssertMsg4( expr, _fmt, _p0, _p1, _p2, _p3 ) ASSERT(expr) - #define FAssertMsg6( expr, _fmt, _p0, _p1, _p2, _p3, _p4, _p5 ) ASSERT(expr) + #define FAssert( expr, ... ) if (!(expr)) do { ASSERT_DIALOGUE(#expr); BUILTIN_TRAP(); } while(0) + #define FAssertMsg( expr, msg ) FAssert(expr) + #define FAssertMsg0( expr, _fmt ) FAssert(expr) + #define FAssertMsg1( expr, _fmt, _p0 ) FAssert(expr) + #define FAssertMsg2( expr, _fmt, _p0, _p1 ) FAssert(expr) + #define FAssertMsg3( expr, _fmt, _p0, _p1, _p2 ) FAssert(expr) + #define FAssertMsg4( expr, _fmt, _p0, _p1, _p2, _p3 ) FAssert(expr) + #define FAssertMsg6( expr, _fmt, _p0, _p1, _p2, _p3, _p4, _p5 ) FAssert(expr) #else // FASSERT_ENABLE not defined @@ -175,10 +175,6 @@ void SetAssertLogCallback( FASSERT_LOG_CALLBACK pfnAssertLogCallback ); #define FASSERT( expr, msg ) FAssertMsg( expr, msg ) -#ifndef ASSERT -#define ASSERT FAssert -#endif // ASSERT - // A class that disables asserts when it is instantiated and // re-enables them (if they were enabled to being with) when // it goes out of scope diff --git a/build_vp_clang.py b/build_vp_clang.py index c3816a2d86..c5cbe9f536 100644 --- a/build_vp_clang.py +++ b/build_vp_clang.py @@ -67,10 +67,9 @@ class Config(Enum): 'CVGAMECOREDLL_EXPORTS', 'FINAL_RELEASE', '_CRT_SECURE_NO_WARNINGS', - '_WINDLL', - 'DISABLE_CVASSERT', + '_WINDLL' ] -RELEASE_PREDEFS = SHARED_PREDEFS + ['STRONG_ASSUMPTIONS', 'NDEBUG'] +RELEASE_PREDEFS = SHARED_PREDEFS + ['STRONG_ASSUMPTIONS', 'NDEBUG', 'VPRELEASE_ERRORMSG'] DEBUG_PREDEFS = SHARED_PREDEFS + ['VPDEBUG'] PREDEFS = { Config.Release: RELEASE_PREDEFS,