MantisBT - VCMI
View Issue Details
0001945VCMIMechanics - Objectspublic2014-11-11 11:412016-01-17 12:35
Tablet ASUS TF201Android4.1.1.
0001945: Crash when learning skill from University or Magic Univercity
Game crash when trying to learnqa new skill from Univercity on adventure map or from Conflux's Magic Univercity. Any hero, any map, any time, always.

After clicking buy, you exit chosen skill window and see Univercity window again, but skill doesn't turn "gold", shortly after buying skill crash happens.
Click to buy skill in certain building.
No tags attached.
related to 0001899closed SXX in this map when I visit the hill fort - crash 
related to 0001991closed SXX Conflux error 
Issue History
2014-11-11 11:41SebtNew Issue
2014-11-11 11:41SebtStatusnew => assigned
2014-11-11 11:41SebtAssigned To => Warmonger
2014-11-17 11:15NouiNote Added: 0005118
2015-01-07 11:11SXXRelationship addedhas duplicate 0001991
2015-01-07 11:13SXXNote Added: 0005356
2015-01-07 11:14SXXAssigned ToWarmonger => SXX
2015-01-07 11:50SXXNote Added: 0005357
2015-01-07 11:59WarmongerNote Added: 0005358
2015-01-07 12:06SXXNote Added: 0005359
2015-01-07 15:15SXXRelationship addedrelated to 0001899
2015-01-07 15:41SXXRelationship replacedrelated to 0001991
2015-01-07 15:48SXXNote Added: 0005363
2015-01-07 15:48SXXStatusassigned => resolved
2015-01-07 15:48SXXFixed in Version => 0.97c
2015-01-07 15:48SXXResolutionopen => fixed
2016-01-17 12:35SXXStatusresolved => closed

2014-11-17 11:15   
Confirmed, I get this crash as well
2015-01-07 11:13   
@Warmonger if you not looking into this one I'll fix this one. :-)

At moment problem is pretty easy:
1 - First of all server-side always get SecondarySkill::PATHFINDING when player attempt to buy skill.
2 - There also possible some issue with "availableItemsIds" check.
2015-01-07 11:50   
Funny, but it's exactly same bug like with 0001899.

There is lambda function that use local variable which end up being garbage, but likely in process of network request it's become 0. Also once fixed it's looks like availableItemsIds check start to work as expected too.
2015-01-07 11:59   
At some point GUI was reworked, possibly more such lambdas were introduced.
2015-01-07 12:06   
Though I'm checked source code and it's looks like there no other dangerous lambdas like this one. As far as I understand it's should be safe to use non-local variables by reference in lambdas, but would be great if someone more experienced can check exist usages.

Will send pull request once check everything work as expected.
2015-01-07 15:48   
So I'm not completely sure what possible caused crash, so I'm decide mark this one as related to this one as related to 0001991 and not as duplicate. Though I suppose Android may be more sensitive to such corruption.

Anyway this one should be fixed in git now: [^]