mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
fix: skip pass and priority pass if hero is not valid anymore to as extra checks for lost heroes
This commit is contained in:
@@ -111,17 +111,16 @@ TurnTimerInfo CGameInfoCallback::getPlayerTurnTime(PlayerColor color) const
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
const CGObjectInstance* CGameInfoCallback::getObj(ObjectInstanceID objid, bool verbose) const
|
||||
const CGObjectInstance * CGameInfoCallback::getObj(const ObjectInstanceID objId, const bool verbose) const
|
||||
{
|
||||
const CGObjectInstance * ret = MapInfoCallback::getObj(objid, verbose);
|
||||
|
||||
const CGObjectInstance * ret = MapInfoCallback::getObj(objId, verbose);
|
||||
if(!ret)
|
||||
return nullptr;
|
||||
|
||||
if(getPlayerID().has_value() && !isVisibleFor(ret, *getPlayerID()) && ret->tempOwner != getPlayerID())
|
||||
{
|
||||
if(verbose)
|
||||
logGlobal->error("Cannot get object with id %d. Object is not visible.", objid.getNum());
|
||||
logGlobal->error("Cannot get object with id %d. Object is not visible.", objId.getNum());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user