mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
No error on hero move when timer is expired
This commit is contained in:
parent
2ce50915e1
commit
23aaa72dfe
@ -2220,6 +2220,9 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
|
||||
// not turn of that hero or player can't simply teleport hero (at least not with this function)
|
||||
if (!h || (asker != PlayerColor::NEUTRAL && (teleporting || h->getOwner() != gs->currentPlayer)))
|
||||
{
|
||||
if(h && getStartInfo()->turnTimerInfo.isEnabled() && gs->players[h->getOwner()].turnTimer.turnTimer == 0)
|
||||
return true; //timer expired, no error
|
||||
|
||||
logGlobal->error("Illegal call to move hero!");
|
||||
return false;
|
||||
}
|
||||
|
@ -64,7 +64,6 @@ void ApplyGhNetPackVisitor::visitDismissHero(DismissHero & pack)
|
||||
|
||||
void ApplyGhNetPackVisitor::visitMoveHero(MoveHero & pack)
|
||||
{
|
||||
gh.throwOnWrongOwner(&pack, pack.hid);
|
||||
result = gh.moveHero(pack.hid, pack.dest, 0, pack.transit, gh.getPlayerAt(pack.c));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user