MantisBT - VCMI
View Issue Details
0001148VCMIMechanics - Adventure Mappublic2012-11-14 15:142014-05-30 17:41
cirdan 
Ivan 
normalcrashalways
closedfixed 
0.9 
0.91 
0001148: Crash when casting dimension door from a town
When a hero standing on a town successfully casts dimension door, it is not removed as visiting hero from the town--its portrait is still shown in the town window. If another hero tries to enter the town, the game crashes.

The attached patch seems to fix this.
1. Have a hero in a town cast dimension door.
2. Move another hero into the town.
No tags attached.
diff town-dimdoor.diff (433) 2012-11-14 15:14
https://bugs.vcmi.eu/file_download.php?file_id=1155&type=bug
Issue History
2012-11-14 15:14cirdanNew Issue
2012-11-14 15:14cirdanFile Added: town-dimdoor.diff
2012-11-15 17:29IvanNote Added: 0003210
2012-11-15 17:29IvanAssigned To => Ivan
2012-11-15 17:29IvanStatusnew => assigned
2012-11-15 18:11cirdanNote Added: 0003211
2012-11-15 18:22WarmongerNote Added: 0003213
2012-11-15 18:29IvanNote Added: 0003214
2012-11-16 00:13IvanNote Added: 0003216
2012-11-16 00:13IvanStatusassigned => resolved
2012-11-16 00:13IvanFixed in Version => 0.91
2012-11-16 00:13IvanResolutionopen => fixed
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0003210)
Ivan   
2012-11-15 17:29   
Thanks for patch - this will save me some time to find out what's wrong but this is not correct location for fix.
For example you can get same bug by embarking on boat adjacent to town.
(0003211)
cirdan   
2012-11-15 18:11   
Well, I just looked for a way to stop the crash, and this worked, but I understand that a more general solution may be needed to encompass all the ways that a hero can leave a town.
(0003213)
Warmonger   
2012-11-15 18:22   
Probably more general use of teleportHero could help here. It already sets town unvisited, but cna have only other town as target (for Town Portal).

Another option is TryMoveHero netpack.
(0003214)
Ivan   
2012-11-15 18:29   
teleportHero does not suits for boats
call in TryMoveHero::applyGS caused crash in moving hero on client side (that part of code is hard to debug for me)

So far unvisit object call works fine in gameHander::moveHero but that function needs some generalization - a lot of copy-paste in it.
(0003216)
Ivan   
2012-11-16 00:13   
Should be fixed in rev 3012