Skip to content

Commit 67f96ad

Browse files
committed
Simplified thing template count assertion.
1 parent ffe9f5e commit 67f96ad

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingFactory.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ void ThingFactory::init( void )
208208
//-------------------------------------------------------------------------------------------------
209209
void ThingFactory::reset( void )
210210
{
211-
UnsignedInt erased = 0;
212-
213211
ThingTemplate *t;
214212
// go through all templates and delete any overrides
215213
for( t = m_firstTemplate; t; /* empty */ )
@@ -237,14 +235,13 @@ void ThingFactory::reset( void )
237235
if (stillValid == NULL) {
238236
// Also needs to be removed from the Hash map.
239237
m_templateHashMap.erase(templateName);
240-
++erased;
241238
}
242239

243240
t = nextT;
244241
}
245242

246243
// TheSuperHackers @bugfix Caball009 25/12/2025 Avoid mismatches by making m_nextTemplateID unique for a single match instead of unique since game launch.
247-
DEBUG_ASSERTCRASH(m_templateIDCount + erased == m_nextTemplateID, ("Thing template ID is invalid after deleting overrides"));
244+
DEBUG_ASSERTCRASH(m_templateHashMap.size() + 1 == m_templateCount, ("The ThingTemplate count is invalid after deleting overrides"));
248245
m_nextTemplateID = m_templateCount;
249246
}
250247

0 commit comments

Comments
 (0)