1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Allow sending requests to move across multiple tiles at once

This commit is contained in:
Ivan Savenko
2024-04-18 15:13:16 +03:00
parent 7d93206786
commit d5a2ad1be8
8 changed files with 55 additions and 21 deletions

View File

@@ -59,7 +59,17 @@ void ApplyGhNetPackVisitor::visitDismissHero(DismissHero & pack)
void ApplyGhNetPackVisitor::visitMoveHero(MoveHero & pack)
{
gh.throwIfWrongOwner(&pack, pack.hid);
result = gh.moveHero(pack.hid, pack.dest, 0, pack.transit, pack.player);
for (auto const & dest : pack.path)
{
if (!gh.moveHero(pack.hid, dest, 0, pack.transit, pack.player))
{
result = false;
return;
}
}
result = true;
}
void ApplyGhNetPackVisitor::visitCastleTeleportHero(CastleTeleportHero & pack)