MantisBT - VCMI
View Issue Details
0002347VCMIMechanics - Adventure Mappublic2015-12-10 08:422015-12-10 09:51
SXX 
SXX 
normalcrashhave not tried
resolvedfixed 
0.98e 
0.98f 
0002347: In some cases not all AI heroes are removed on loss
I'm not yet find how to reproduce this, but looks like sometimes when AI hero lose game due to lack of town some heroes may be not removed. This of course result in neutral hero that cause crash if attacked.
No tags attached.
Issue History
2015-12-10 08:42SXXNew Issue
2015-12-10 09:05SXXAssigned To => SXX
2015-12-10 09:05SXXStatusnew => assigned
2015-12-10 09:38SXXNote Added: 0006174
2015-12-10 09:51SXXNote Added: 0006175
2015-12-10 09:51SXXStatusassigned => resolved
2015-12-10 09:51SXXFixed in Version => 0.98f
2015-12-10 09:51SXXResolutionopen => fixed

Notes
(0006174)
SXX   
2015-12-10 09:38   
So issue was added within recent refactoring:
https://github.com/vcmi/vcmi/commit/abe88ea89050e1af2f0dc8963068cdbd626a43fe [^]
Before there was copy of heroes vector because removal of object from vector invalidate iterator (PlayerState immediately change once player hero removed).
(0006175)
SXX   
2015-12-10 09:51   
Fixed:
https://github.com/vcmi/vcmi/commit/d900e9bec2ec14f55bfd861745515cb6190cd1ed [^]