1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Merge pull request #3136 from IvanSavenko/fix_teleport

Fix crash on teleport cast
This commit is contained in:
Ivan Savenko 2023-11-03 15:49:55 +02:00 committed by GitHub
commit eea4cbf242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@
#include "Teleport.h"
#include "Registry.h"
#include "../ISpellMechanics.h"
#include "../../battle/IBattleState.h"
#include "../../battle/CBattleInfoCallback.h"
#include "../../battle/Unit.h"
#include "../../networkPacks/PacksForClientBattle.h"
@ -76,6 +77,7 @@ void Teleport::apply(ServerCallback * server, const Mechanics * m, const EffectT
const auto destination = target[1].hexValue;
BattleStackMoved pack;
pack.battleID = m->battle()->getBattle()->getBattleID();
pack.distance = 0;
pack.stack = targetUnit->unitId();
std::vector<BattleHex> tiles;