MantisBT - VCMI
View Issue Details
0002277VCMIMechanics - Otherpublic2015-10-03 21:562016-09-18 07:08
0002277: Random heroes always have subID of zero and don't inherit predefined options
This is problem specific for Obj::RANDOM_HERO. Any heroes that was spawned from random hero object on map are never fully initialized. Also if hero chosen by GameState::randomizeObject had predefined skills/spells/etc in map options those won't be used at all.

I find that issue because at least "RemoveObject::applyGs" use subID for ID in available heroes pool. So when map only have limited number of heroes allowed and they all spawned as "RANDOM_HERO" they won't back into pool after defeat / dismiss.
No tags attached.
related to 0001929resolved Ivan Game start: if hero selected pre-game and map have multiple start towns you'll get multiple clones of same hero 
related to 0002127resolved SXX Possible crash when hero is hired in town that gives him primary skill bonus 
? SXX_TELEPORT_Heroes_non-random.h3m (9,592) 2015-10-04 13:42
? SXX_TELEPORT_Heroes_random.h3m (9,594) 2015-10-04 13:42
? SXX_TELEPORT_Heroes_random_predefined.h3m (9,641) 2015-10-04 13:42
? SXX_Hero_subID_bug.h3m (1,865) 2015-12-05 08:02
Issue History
2015-10-03 21:56SXXNew Issue
2015-10-04 09:13WarmongerNote Added: 0005904
2015-10-04 13:35SXXNote Added: 0005905
2015-10-04 13:42SXXFile Added: SXX_TELEPORT_Heroes_non-random.h3m
2015-10-04 13:42SXXFile Added: SXX_TELEPORT_Heroes_random.h3m
2015-10-04 13:42SXXFile Added: SXX_TELEPORT_Heroes_random_predefined.h3m
2015-10-04 13:42SXXNote Edited: 0005905bug_revision_view_page.php?bugnote_id=5905#r2951
2015-10-04 13:58SXXNote Added: 0005906
2015-10-04 16:29WarmongerNote Edited: 0005904bug_revision_view_page.php?bugnote_id=5904#r2953
2015-11-25 16:15SXXRelationship addedrelated to 0001929
2015-11-25 16:15SXXNote Added: 0006115
2015-12-05 07:54SXXNote Added: 0006147
2015-12-05 08:02SXXFile Added: SXX_Hero_subID_bug.h3m
2016-09-12 03:26SXXAssigned To => SXX
2016-09-12 03:26SXXStatusnew => assigned
2016-09-18 01:39SXXRelationship addedrelated to 0002127
2016-09-18 07:08SXXNote Added: 0006682
2016-09-18 07:08SXXStatusassigned => resolved
2016-09-18 07:08SXXFixed in Version => 0.99
2016-09-18 07:08SXXResolutionopen => fixed

2015-10-04 09:13   
(edited on: 2015-10-04 16:29)
Where do random heroes come from? How to place one in map editor?

2015-10-04 13:35   
(edited on: 2015-10-04 13:42)
It's icon is next to last in list. Just before "Hero Placeholder".

2015-10-04 13:58   
Just in case uploaded few maps where I find that issue.
2015-11-25 16:15   
It's funny how this bug likely related to one of first bugs I ever reported for VCMI. :-)
2015-12-05 07:54   
Ivan commit fixed that at least partially: [^]

Though I'm not yet 100% sure that all data related to random and non-random heroes are loaded properly from map settings. So I'll do more testing of this one later one.
2016-09-18 07:08   
First I that Ivan's changes fixed object property loading so army, skills and spells were fine for quite some time.

Now I find out what cause exactly subID problem and looks like everything should be fine now: [^]