MantisBT - VCMI
View Issue Details
0002345VCMIMechanics - Adventure Mappublic2015-12-08 03:362022-04-12 11:04
SXX 
SXX 
normalcrashalways
closedfixed 
0.98e 
0.98f 
0002345: Fog of War changing objects may completely cover heroes/towns
I was investigating crashes during AI movement and find out about the problem: it's looks like at least neutral Necropolis towns may completely cover objects of player like towns and heroes when player isn't being Red.
1 - Get my "SXX_TEST_MAP_v4.h3m" map:
http://forum.vcmi.eu/viewtopic.php?t=1108 [^]
2 - Start game as pink player.
No tags attached.
has duplicate 0002175closed SXX Crash during AI turn 
has duplicate 0002153closed SXX Crash turn AI 
has duplicate 0002134closed SXX Crash during AI turn - current tile invisible 
has duplicate 0002274closed SXX green hero take sulfur mine and heroes quit 
has duplicate 0002287closed SXX Heroes just closed when turn AI 
has duplicate 0002108closed SXX Cover of Darkness close view of the city 
has duplicate 0002411closed SXX Crash during AI movement 
related to 0002168closed SXX Terra incognito 
related to 0001750assigned SXX Cover of darkness covers dwellings, player owned guarded gates 
related to 0002251assigned SXX Mines (and possibly other objects) possessed by player get covered by necropolis town's cover of darkness 
jpg fow_bug.jpg (123,062) 2015-12-08 03:36
https://bugs.vcmi.eu/file_download.php?file_id=2400&type=bug
jpg
Issue History
2015-12-08 03:36SXXNew Issue
2015-12-08 03:36SXXFile Added: fow_bug.jpg
2015-12-08 04:02SXXNote Added: 0006148
2015-12-09 07:16SXXNote Added: 0006154
2015-12-09 07:16SXXStatusnew => resolved
2015-12-09 07:16SXXFixed in Version => 0.98f
2015-12-09 07:16SXXResolutionopen => fixed
2015-12-09 07:16SXXAssigned To => SXX
2015-12-09 07:28SXXRelationship addedhas duplicate 0002175
2015-12-09 07:41SXXRelationship addedhas duplicate 0002153
2015-12-09 08:14SXXRelationship addedhas duplicate 0002134
2015-12-09 08:15SXXRelationship addedhas duplicate 0002274
2015-12-09 08:31SXXRelationship addedhas duplicate 0002287
2015-12-24 13:07SXXRelationship addedrelated to 0002168
2015-12-24 19:48SXXRelationship addedhas duplicate 0002108
2016-02-10 05:05SXXRelationship addedhas duplicate 0002411
2016-09-14 02:59SXXRelationship addedrelated to 0001750
2016-09-14 02:59SXXRelationship addedrelated to 0002251
2022-04-12 11:04PovelitelStatusresolved => closed

Notes
(0006148)
SXX   
2015-12-08 04:02   
Some details on why it's was tricky to find and reproduce:

* When all 8 tiles around AI hero covered by FoW it can't move so it's can't trigger assertion/crash within moveHeroToTile.
* Still that hero may visit object under it (e.g visit town) and that "movement" clear FoW around.
* If any of tiles around hero aren't in FoW hero can attempt to move there because pathfinder don't check visibility of initial tile.
* Movement from invisible tile cause assertion/crash.

BTW for quite some time I think that weird problem has come due to my movement code changes, but looks like it's was there for a while and my changes just make it appear.
(0006154)
SXX   
2015-12-09 07:16   
Fixed:
https://github.com/vcmi/vcmi/commit/2be6818e33a39147bb72474c038fa08b811d7f49 [^]

Though all FoW-related code need massive refactoring.