MantisBT - VCMI
View Issue Details
0001141VCMIModspublic2012-10-09 11:562013-01-19 20:37
q4a 
Warmonger 
normalminoralways
closedno change required 
x86WindowsXP SP3
 
 
0001141: Removing hero id=155 (or any) from trunk\config\heroes.json lead to crash
I'd like to remove some heroes from heroes.json, but if i remove any, for example, i got crash =(
Looks lite, that crash happens in CHeroHandler.cpp's function CHeroHandler::initHeroClasses().
Variable heroes.size() always = 156 and cycle trying to read nonexistent record.
Remove hero id=155 (or any) from trunk\config\heroes.json and run vcmi
No tags attached.
Issue History
2012-10-09 11:56q4aNew Issue
2012-10-09 12:12WarmongerNote Added: 0003174
2012-10-09 12:12WarmongerAssigned To => Warmonger
2012-10-09 12:12WarmongerStatusnew => acknowledged
2012-10-09 12:22q4aNote Added: 0003175
2013-01-19 20:37AlexVinSNote Added: 0003286
2013-01-19 20:37AlexVinSStatusacknowledged => closed
2013-01-19 20:37AlexVinSResolutionopen => no change required

Notes
(0003174)
Warmonger   
2012-10-09 12:12   
Size of original config file is hardcoded for a reason. Also, there is no way to handle missing heroes in original maps (for example in campaigns, prisons).
(0003175)
q4a   
2012-10-09 12:22   
Ok, now i saw in trunk\lib\GameConstants.h:
const int ARTIFACTS_QUANTITY=171;
const int HEROES_QUANTITY=156;
...

and that's ok. Original number of heroes can't be modified.
I just think, that heroes.size()=156 because of id number from heroes.json.

Issue can be closed.
(0003286)
AlexVinS   
2013-01-19 20:37   
closed by request of reporter