1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

Update CGameHandler.cpp

Improve debugability with more helpful error-texts.
This commit is contained in:
Xilmi 2024-10-04 11:49:20 +02:00
parent 68e264d990
commit 6c44354843

View File

@ -786,7 +786,7 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, EMovementMode moveme
return false;
}
logGlobal->trace("Player %d (%s) wants to move hero %d from %s to %s", asker, asker.toString(), hid.getNum(), h->pos.toString(), dst.toString());
logGlobal->trace("Player %d (%s) wants to move hero %s from %s to %s", asker, asker.toString(), h->getNameTranslated(), h->pos.toString(), dst.toString());
const int3 hmpos = h->convertToVisitablePos(dst);
if (!gs->map->isInTheMap(hmpos))
@ -869,7 +869,7 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, EMovementMode moveme
return complainRet("Cannot disembark hero, tile is blocked!");
if(distance(h->pos, dst) >= 1.5 && movementMode == EMovementMode::STANDARD)
return complainRet("Tiles are not neighboring!");
return complainRet("Tiles " + h->pos.toString()+ " and "+ dst.toString() +" are not neighboring!");
if(h->inTownGarrison)
return complainRet("Can not move garrisoned hero!");