1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Fix rare crash if player selects maximum movement speed and moves hero

across event that grants enough XP to level up
This commit is contained in:
Ivan Savenko
2025-04-06 18:43:55 +03:00
parent 87caec6be1
commit cbfaefd805

View File

@@ -70,6 +70,15 @@ void ApplyGhNetPackVisitor::visitMoveHero(MoveHero & pack)
result = false; result = false;
return; return;
} }
// player got some query he has to reply to first for example, from triggered event
// ignore remaining path (if any), but handle this as success - since at least part of path was legal & was applied
auto query = gh.queries->topQuery(pack.player);
if (query && query->blocksPack(&pack))
{
result = true;
return;
}
} }
result = true; result = true;