Skip to content

Commit 1f3cf6c

Browse files
authored
CvAssert and PRECONDITION (LoneGazebo#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
1 parent 0bbc47c commit 1f3cf6c

File tree

121 files changed

+5861
-5783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+5861
-5783
lines changed

CvGameCoreDLLUtil/include/CvAssert.h

+15-33
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
//! This file includes assertion macros used by Civilization.
66
//!
77
//! Key Macros:
8-
//! - CvAssert(expr) - assertions w/ no message
9-
//! - CvAssertFmt(expr, fmt, ...) - assertions w/ printf style messages
10-
//! - CvAssertMsg(expr, msg) - assertions w/ constant messages
8+
//! - CvAssert(expr, ...) - assertions w/ printf style messages
119
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1210
#ifndef _CVASSERT_H
1311
#define _CVASSERT_H
@@ -23,48 +21,35 @@ bool CvAssertDlg(const char* expr, const char* szFile, unsigned int uiLine, bool
2321
#define CVASSERT_BREAKPOINT assert(0)
2422
#endif
2523

26-
// Only compile in FAssert's if CVASSERT_ENABLE is defined. By default, however, let's key off of
27-
// _DEBUG. Sometimes, however, it's useful to enable asserts in release builds, and you can do that
28-
// simply by changing the following lines to define CVASSERT_ENABLE or using project settings to override
29-
#if !defined(FINAL_RELEASE) || defined(VPDEBUG)
24+
// Only compile in CvAssertMsg's in debug configuration, or in release configuration (with a more user-friendly text) if VPRELEASE_ERRORMSG is defined
25+
// Asserts can be disabled by defining DISABLE_CVASSERT in the project settings
26+
#if !defined(CVASSERT_ENABLE) && !defined(DISABLE_CVASSERT)
27+
#if !defined(FINAL_RELEASE) || defined(VPDEBUG) || defined(VPRELEASE_ERRORMSG)
3028
#define CVASSERT_ENABLE
3129
#endif // FINAL_RELEASE
32-
30+
#endif // DISABLE_CVASSERT
3331

3432
#ifdef CVASSERT_ENABLE
3533

36-
#define CvAssertMsg(expr, msg) \
34+
// shows a message dialog if expr is false and CVASSERT_ENABLE is defined.
35+
// Unlike PRECONDITION, a failed assertion does not cause the game to crash
36+
#define ASSERT(expr, ...) \
3737
{ \
3838
static bool bIgnoreAlways = false; \
39-
if( !bIgnoreAlways && !(expr) ) \
40-
{ \
41-
if(CvAssertDlg(#expr, __FILE__, __LINE__, bIgnoreAlways, msg)) \
42-
{ CVASSERT_BREAKPOINT; } \
43-
} \
44-
}
45-
46-
#define CvAssertFmt(expr, fmt, ...) \
47-
{ \
48-
static bool bIgnoreAlways = false; \
49-
if( !bIgnoreAlways && !(expr) ) \
39+
if( !bIgnoreAlways && !(expr) ) \
5040
{ \
5141
CvString str; \
52-
CvString::format(str, fmt, __VA_ARGS__); \
53-
if(CvAssertDlg(#expr, __FILE__, __LINE__, \
54-
bIgnoreAlways, str.c_str())) \
55-
{ CVASSERT_BREAKPOINT; } \
42+
CvString::format(str, __VA_ARGS__); \
43+
if(CvAssertDlg(#expr, __FILE__, __LINE__, bIgnoreAlways, str.c_str())) \
44+
{ CVASSERT_BREAKPOINT; } \
5645
} \
5746
}
5847

59-
#define CvAssert( expr ) CvAssertMsg(expr, "")
60-
6148
// An assert that only happens in the when CVASSERT_ENABLE is true AND it is a debug build
6249
#ifdef _DEBUG
63-
#define CvAssert_Debug( expr ) CvAssertMsg(expr, "")
64-
#define CvAssertMsg_Debug(expr, msg) CvAssertMsg(expr, msg)
50+
#define CvAssert_Debug( expr, ...) CvAssertMsg( expr, __VA_ARGS__)
6551
#else
66-
#define CvAssert_Debug(expr)
67-
#define CvAssertMsg_Debug(expr, msg)
52+
#define CvAssert_Debug(expr, ...)
6853
#endif
6954

7055
#if 0 // disabling Object Validation
@@ -106,11 +91,8 @@ struct ObjectValidator
10691

10792
#else //CVASSERT_ENABLE == FALSE
10893

109-
#define CvAssertFmt(expr, fmt, ...)
110-
#define CvAssertMsg(expr, msg)
11194
#define CvAssert(expr)
11295
#define CvAssert_Debug(expr)
113-
#define CvAssertMsg_Debug(expr, msg)
11496

11597
#define OBJECT_VALIDATE_DEFINITION(ObjectType)
11698
#define OBJECT_ALLOCATED

CvGameCoreDLLUtil/include/CvString.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CvString : public std::string
2222
public:
2323
CvString() {}
2424
CvString(int iLen) { reserve(iLen); }
25-
CvString(const char* s) : std::string(s ? s : "") {CvAssertMsg(s != NULL, "Passing NULL to std::string; possible heap corruption!");}
25+
CvString(const char* s) : std::string(s ? s : "") {ASSERT(s != NULL, "Passing NULL to std::string; possible heap corruption!");}
2626
CvString(const std::string& s): std::string(s) {}
2727

2828
~CvString() {}

CvGameCoreDLL_Expansion2/CustomMods.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1213,11 +1213,11 @@ void CheckSentinel(uint);
12131213

12141214
#define MOD_SERIALIZE_INIT_WRITE_NO_SENTINEL(stream) uint uiDllSaveVersion = MOD_DLL_VERSION_NUMBER; (stream) << uiDllSaveVersion;
12151215
#define MOD_SERIALIZE_INIT_WRITE(stream) uint uiDllSaveVersion = MOD_DLL_VERSION_NUMBER; (stream) << uiDllSaveVersion; (stream) << 0xDEADBEEF;
1216-
#define MOD_SERIALIZE_WRITE(stream, member) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member
1217-
#define MOD_SERIALIZE_WRITE_AUTO(stream, member) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member
1218-
#define MOD_SERIALIZE_WRITE_ARRAY(stream, member, type, size) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapper<type>(size, member)
1219-
#define MOD_SERIALIZE_WRITE_CONSTARRAY(stream, member, type, size) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapperConst<type>(size, member)
1220-
#define MOD_SERIALIZE_WRITE_HASH(stream, member, type, size, obj) CvAssert(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); CvInfosSerializationHelper::WriteHashedDataArray<obj, type>(stream, member, size)
1216+
#define MOD_SERIALIZE_WRITE(stream, member) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member
1217+
#define MOD_SERIALIZE_WRITE_AUTO(stream, member) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << member
1218+
#define MOD_SERIALIZE_WRITE_ARRAY(stream, member, type, size) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapper<type>(size, member)
1219+
#define MOD_SERIALIZE_WRITE_CONSTARRAY(stream, member, type, size) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); (stream) << ArrayWrapperConst<type>(size, member)
1220+
#define MOD_SERIALIZE_WRITE_HASH(stream, member, type, size, obj) ASSERT(uiDllSaveVersion == MOD_DLL_VERSION_NUMBER); CvInfosSerializationHelper::WriteHashedDataArray<obj, type>(stream, member, size)
12211221
#else
12221222
#define MOD_SERIALIZE_INIT_READ(stream) __noop
12231223
#define MOD_SERIALIZE_READ(version, stream, member, def) __noop

CvGameCoreDLL_Expansion2/CvAdvisorCounsel.cpp

+30-30
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
8686
bool bSuccess = false;
8787
strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_ECONOMIC");
8888
bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_ECONOMIC, strLoc.toUTF8(), 99);
89-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
89+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
9090
uiCounselIndex++;
9191

9292
strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_MILITARY");
9393
bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 99);
94-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
94+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
9595
uiCounselIndex++;
9696

9797
strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_SCIENCE");
9898
bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 99);
99-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
99+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
100100
uiCounselIndex++;
101101

102102
strLoc = Localization::Lookup("TXT_KEY_BUILD_A_CITY_MCFLY_FOREIGN");
103103
bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_FOREIGN, strLoc.toUTF8(), 99);
104-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
104+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
105105
uiCounselIndex++;
106106

107107
std::stable_sort(&m_aCounsel[0], &m_aCounsel[0] + m_aCounsel.size(), CounselSort);
@@ -123,7 +123,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
123123
{
124124
strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText());
125125
bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance());
126-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
126+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
127127
if(!bSuccess)
128128
{
129129
break;
@@ -143,15 +143,15 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
143143
if(pMilitaryAI->IsUsingStrategy(eStrategy))
144144
{
145145
CvMilitaryAIStrategyXMLEntry* pStrategy = pMilitaryAI->GetMilitaryAIStrategies()->GetEntry(iStrategiesLoop);
146-
CvAssert(pStrategy != NULL);
146+
ASSERT(pStrategy != NULL);
147147
if(pStrategy)
148148
{
149149
// if this strategy has an advisor set, then try to add it to the list
150150
if(pStrategy->GetAdvisor() != NO_ADVISOR_TYPE)
151151
{
152152
strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText());
153153
bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance());
154-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
154+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
155155
if(!bSuccess)
156156
{
157157
break;
@@ -181,7 +181,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
181181
strLoc = Localization::Lookup(pStrategy->GetAdvisorCounselText());
182182
strLoc << pLoopCity->getNameKey();
183183
bool bSuccess = SetCounselEntry(uiCounselIndex, pStrategy->GetAdvisor(), strLoc.toUTF8(), pStrategy->GetAdvisorCounselImportance());
184-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
184+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
185185
if(!bSuccess)
186186
{
187187
break;
@@ -228,7 +228,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
228228
strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey();
229229

230230
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2);
231-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
231+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
232232
if(!bSuccess)
233233
{
234234
break;
@@ -244,7 +244,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
244244
strLoc << GC.getBuildingInfo(pPlayerTechs->GetCivTechUniqueBuilding(eTech))->GetTextKey();
245245
strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey();
246246
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2);
247-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
247+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
248248
if(!bSuccess)
249249
{
250250
break;
@@ -260,7 +260,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
260260
strLoc << GC.getImprovementInfo(pPlayerTechs->GetCivTechUniqueImprovement(eTech))->GetTextKey();
261261
strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey();
262262
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2);
263-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
263+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
264264
if(!bSuccess)
265265
{
266266
break;
@@ -276,7 +276,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
276276
strLoc << pPlayerTechs->GetTechs()->GetEntry(eTech)->GetTextKey();
277277
strLoc << GET_PLAYER(ePlayer).getCivilizationInfo().getAdjectiveKey();
278278
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 2);
279-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
279+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
280280
if(!bSuccess)
281281
{
282282
break;
@@ -300,7 +300,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
300300
strLoc << pPlayerTechs->GetTechs()->GetEntry(eTech)->GetTextKey();
301301
strLoc << GC.getResourceInfo(eResource)->GetTextKey();
302302
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 60);
303-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
303+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
304304
if (!bSuccess)
305305
{
306306
break;
@@ -368,7 +368,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
368368
}
369369

370370
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 15);
371-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
371+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
372372
if(!bSuccess)
373373
{
374374
break;
@@ -443,7 +443,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
443443

444444
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 15);
445445
DEBUG_VARIABLE(bSuccess);
446-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
446+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
447447
uiCounselIndex++;
448448
}
449449
}
@@ -459,7 +459,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
459459

460460
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_MILITARY, strLoc.toUTF8(), 15);
461461
DEBUG_VARIABLE(bSuccess);
462-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
462+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
463463
uiCounselIndex++;
464464
}
465465
}
@@ -512,7 +512,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
512512

513513
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), iRating);
514514
DEBUG_VARIABLE(bSuccess);
515-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
515+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
516516
uiCounselIndex++;
517517
}
518518

@@ -974,7 +974,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
974974
if(eAdvisor != NO_ADVISOR_TYPE)
975975
{
976976
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating);
977-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
977+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
978978
if(!bSuccess)
979979
{
980980
break;
@@ -1096,7 +1096,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
10961096
if(eAdvisor != NO_ADVISOR_TYPE)
10971097
{
10981098
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating);
1099-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1099+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
11001100
if(!bSuccess)
11011101
{
11021102
break;
@@ -1308,7 +1308,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
13081308
{
13091309
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating);
13101310
DEBUG_VARIABLE(bSuccess);
1311-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1311+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
13121312
uiCounselIndex++;
13131313
}
13141314
}
@@ -1380,7 +1380,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
13801380
strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey();
13811381

13821382
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating);
1383-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1383+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
13841384
if(!bSuccess)
13851385
{
13861386
break;
@@ -1449,7 +1449,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
14491449
strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey();
14501450
break;
14511451
default:
1452-
CvAssertMsg(false, "No entry for this quest type!");
1452+
ASSERT(false, "No entry for this quest type!");
14531453
break;
14541454
}
14551455
}
@@ -1520,7 +1520,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
15201520
strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey();
15211521
break;
15221522
default:
1523-
CvAssertMsg(false, "No entry for this quest type!");
1523+
ASSERT(false, "No entry for this quest type!");
15241524
break;
15251525
}
15261526
}
@@ -1590,7 +1590,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
15901590
strLoc << GC.getMinorCivInfo(pMinorCivAI->GetMinorCivType())->GetTextKey();
15911591
break;
15921592
default:
1593-
CvAssertMsg(false, "No entry for this quest type!");
1593+
ASSERT(false, "No entry for this quest type!");
15941594
break;
15951595
}
15961596
}
@@ -1614,7 +1614,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
16141614
if(iMessageRating > 0)
16151615
{
16161616
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisor, strLoc.toUTF8(), iMessageRating);
1617-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1617+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
16181618
if(!bSuccess)
16191619
{
16201620
break;
@@ -1706,7 +1706,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
17061706
strLoc << GC.getBuildingInfo(eRecommendedResearchBuilding)->GetTextKey();
17071707

17081708
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_SCIENCE, strLoc.toUTF8(), 20);
1709-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1709+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
17101710
if(!bSuccess)
17111711
{
17121712
break;
@@ -1832,7 +1832,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
18321832

18331833
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_ECONOMIC, strLoc.toUTF8(), 20);
18341834
DEBUG_VARIABLE(bSuccess);
1835-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1835+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
18361836
uiCounselIndex++;
18371837
}
18381838

@@ -1934,15 +1934,15 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
19341934
}
19351935
else
19361936
{
1937-
CvAssertMsg(false, "Can't trade a bonus resource");
1937+
ASSERT(false, "Can't trade a bonus resource");
19381938
}
19391939

19401940
strLoc << GC.getResourceInfo(eTradableResource)->GetTextKey();
19411941
strLoc << GET_PLAYER(eTargetPlayer).getCivilizationInfo().GetTextKey();
19421942

19431943
bool bSuccess = SetCounselEntry(uiCounselIndex, ADVISOR_FOREIGN, strLoc.toUTF8(), 20);
19441944
DEBUG_VARIABLE(bSuccess);
1945-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1945+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
19461946
uiCounselIndex++;
19471947
}
19481948

@@ -1987,7 +1987,7 @@ void CvAdvisorCounsel::BuildCounselList(PlayerTypes ePlayer)
19871987

19881988
bool bSuccess = SetCounselEntry(uiCounselIndex, eAdvisorTypes, strLoc.toUTF8(), 0);
19891989
DEBUG_VARIABLE(bSuccess);
1990-
CvAssertMsg(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
1990+
ASSERT(bSuccess, "Unable to add counsel to list. Too many strategies running at once");
19911991
uiCounselIndex++;
19921992
}
19931993
}

0 commit comments

Comments
 (0)