MantisBT - VCMI
View Issue Details
0001061VCMIAI - Adventure Mappublic2012-08-30 04:222014-05-30 17:41
Warmonger 
Tow 
normalcrashalways
closedfixed 
 
 
0001061: Crash at AI visiting Dragonflies.
This bug looks quite different than others and is easily reproductible.
No tags attached.
rar CrashDragonflies.rar (254,365) 2012-08-30 04:22
https://bugs.vcmi.eu/file_download.php?file_id=1047&type=bug
Issue History
2012-08-30 04:22WarmongerNew Issue
2012-08-30 04:22WarmongerStatusnew => assigned
2012-08-30 04:22WarmongerAssigned To => Tow
2012-08-30 04:22WarmongerFile Added: CrashDragonflies.rar
2012-08-30 04:59WarmongerNote Added: 0002951
2012-08-30 09:56TowNote Added: 0002952
2012-08-30 16:04TowNote Added: 0002954
2012-08-30 16:04TowStatusassigned => resolved
2012-08-30 16:04TowResolutionopen => fixed
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0002951)
Warmonger   
2012-08-30 04:59   
I noticed that game crashes usually along these lines:

        if(creatureBank)
            pos = attackerCreBank[armies[0]->stacksCount()-1][k];
        else if(armies[0]->formation)
            pos = attackerTight[armies[0]->stacksCount()-1][k];
        else
            pos = attackerLoose[armies[0]->stacksCount()-1][k];
(0002952)
Tow   
2012-08-30 09:56   
Quite an achievement AI made — Theodorus the Wizard has EIGHT stacks in army. Causes all kinds of out-of-range behaviours. The question is how that happened. I'll look into the code.
(0002954)
Tow   
2012-08-30 16:04   
Server should not allow creating such state with changes from r2866.
I also fixed the crash (so using your save to continue game is possible), though having creature in 7+ slot will probably crash it somewhen later (or cause other issues).

Marking as resolved, though there is still probably bug in the AI making it send illegal requests.