View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003160VCMIMechanics - Battlespublic2020-12-13 07:582020-12-13 08:46
Assigned To 
PlatformUbuntuOSLinuxOS Versionvarious
Product Version 
Target VersionFixed in Version 
Summary0003160: Crash on some battle actions
DescriptionThe bug is well reproducible, but it takes some time of gameplay to get to it. The bug is: If an experienced stack, that casts some magic before attack, attacks a weak stack, then it may be that this magic casting already kills the stack. Now if then after that magic the original attack takes place, this affects an already dead (aka no more existent) stack. This immediately crashes the game with a memory access violation.
This mostly happens with Gogs and Liches. F.ex. Gogs cast fireball before attacking. If that fireball already kills the stack, then the following original attack crashes the game.
I assume that a stack, that gets killed, is removed (the object is deleted). So the pointer to the object is now invalid. The subsequent attack uses this invalid pointer and so crashes the game.
Suggestion: When killing a stack, after deleting the object, set the pointer to NULL. And then before any action, check for NULL pointer, and if so, just do nothing.
Steps To ReproduceIt takes some time of gameplay to reproduce this. You need an experienced stack of Gogs or Liches. And preferably a big stack. Now take that big experienced stack and attack a weak stack (f.ex. a single level 1 creature). You see the pre-attack magic taking place and killing the stack. Then the subsequent attack crashes the game.
It is not possible to reproduce this bug with a fresh new map on day 1. To reproduce it you need a sufficiently experienced stack. You get easier to a sufficiently experienced stack on big maps.
Additional InformationThis bug seems to not only happen in real battles with at least 1 human player. It seems it also happens in pure AI battles. At least the crash messages and the logs point to this.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
misiokles (reporter)
2020-12-13 08:46

I can confirm that sometimes it happens.

- Issue History
Date Modified Username Field Change
2020-12-13 07:58 Siegfried New Issue
2020-12-13 08:46 misiokles Note Added: 0007961

Site | Forums | Wiki | Slack | GitHub

Copyright © 2000 - 2021 MantisBT Team
Hosting provided by DigitalOcean