MantisBT - VCMI
View Issue Details
0002066VCMIMechanics - Adventure Mappublic2015-02-10 22:012015-10-15 02:38
SXX 
SXX 
normalmajoralways
closedfixed 
0.97b 
0.97c 
0002066: First hero movement after town / non-pickable object visit can't be interrupted
So if you're accidentally sent hero to attack some monster it's impossible to interrupt this movement and hero going to die. Though it's only happen on very first movement of hero after visit and any movement after that can be interrupted just fine.

This problem only happen after visiting objects that spawn dialogue window, but aren't pickable. E.g it's won't happen after visiting/picking Campfire or Treasure Chest.

Also it's will happen even after visiting object you will use other hero before and only then switch back to that hero that visited it.
  - Run normal game in VCMI.
  - Now with hero visit any town or if it's here just open town screen.
  - Close town screen
  - Hero will be automatically selected at this point.
  - Sent this hero to any point on map.
  - Try to interrupt movement using mouse buttons or space bar.

You'll notice it's impossible to interrupt this movement no matter what.

Same will happen after hero visit non-pickable object (Learning stone, etc).
No tags attached.
related to 0000984closed SXX Hero move on adv. map should be interruptible 
Issue History
2015-02-10 22:01SXXNew Issue
2015-02-10 22:02SXXRelationship addedrelated to 0000984
2015-02-15 23:31SXXAssigned To => SXX
2015-02-15 23:31SXXStatusnew => assigned
2015-02-15 23:36SXXNote Added: 0005520
2015-02-16 07:28SXXNote Added: 0005523
2015-02-16 07:50SXXNote Edited: 0005523bug_revision_view_page.php?bugnote_id=5523#r2838
2015-02-16 07:53SXXNote Added: 0005524
2015-02-16 08:08SXXNote Added: 0005525
2015-02-20 20:21IvanNote Added: 0005552
2015-02-22 06:39SXXNote Added: 0005560
2015-03-10 18:55SXXNote Added: 0005609
2015-03-10 18:55SXXStatusassigned => resolved
2015-03-10 18:55SXXFixed in Version => 0.97c
2015-03-10 18:55SXXResolutionopen => fixed
2015-10-15 02:38SXXStatusresolved => closed

Notes
(0005520)
SXX   
2015-02-15 23:36   
So I almost find out about this one. Problem occur because of check in "CPlayerInterface::doMoveHero". There is "curTile" that was added to avoid hero stopping at blocked tile while flying:
https://github.com/vcmi/vcmi/commit/71b73bad530224333e21df1ab51846c7380ed51b [^]

This check itself is broken because it's never change after hero first move. Also this check possible always return "blocked" for the tile where hero itself standing while I not sure about that because there no such problem with removable objects.
(0005523)
SXX   
2015-02-16 07:28   
(edited on: 2015-02-16 07:50)
So I find out why it's happen. As curTile a pointer to TerrainTile it's become unblocked once hero leave this tile, but this doesn't happen for dwellings as they always remain here and marked as "blocked".

Currently I'm going to find out how fly effect worked with map objects in original to make sure behavior I'm going implement is correct one.

(0005524)
SXX   
2015-02-16 07:53   
Here is H3 behaviour: fly skill prefer to flying above non-blocked object (including corpse!) and it's does let you stop on dwellings entry points except they're blocked by another hero or not allowed to stop on them at all (corpse).
(0005525)
SXX   
2015-02-16 08:08   
Also in H3 it's was possible to stay on some objects like magic well without actually visiting them.
(0005552)
Ivan   
2015-02-20 20:21   
>> and it's does let you stop on dwellings entry points except they're blocked by another hero

Isn't this is an obvious bug in H3? Try "capturing" towns this way - IIRC this completely breaks H3 creating ghost armies in town garrison and such.

(IMO possibility to *stop* on visitables without possibility to *move* on them directly is definitely wrong)
(0005560)
SXX   
2015-02-22 06:39   
I'm kind a agree with you on that and it's will make whole fly pathfinding a bit easier, but not sure if I want to make decision to disable that or not.

Hope @Warmonger or other devs may comment on this one too.
(0005609)
SXX   
2015-03-10 18:55   
Should now be fixed with merge of my teleport branch:
https://github.com/vcmi/vcmi/commit/ec879046ca52ecc5c431f4409ff9c3bd75363d26 [^]

As this check didn't work at all and It's was only cause problems with testing teleports I dropped it. In future when movement re-implemented for cheat-free flying and water walking we should make sure to not do same mistake again.