|Anonymous | Login||2021-06-25 14:12 UTC|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003160||VCMI||Mechanics - Battles||public||2020-12-13 07:58||2020-12-13 08:46|
|Target Version||Fixed in Version|
|Summary||0003160: Crash on some battle actions|
|Description||The 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 Reproduce||It 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 Information||This 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.|
|Tags||No tags attached.|
|2020-12-13 07:58||Siegfried||New Issue|
|2020-12-13 08:46||misiokles||Note Added: 0007961|
|Copyright © 2000 - 2021 MantisBT Team|