mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-22 00:27:58 +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:
@@ -22,19 +22,19 @@ VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
MapInfoCallback::~MapInfoCallback() = default;
|
||||
|
||||
const CGObjectInstance * MapInfoCallback::getObj(ObjectInstanceID objid, bool verbose) const
|
||||
const CGObjectInstance * MapInfoCallback::getObj(const ObjectInstanceID objId, const bool verbose) const
|
||||
{
|
||||
if(!objid.hasValue())
|
||||
if(!objId.hasValue())
|
||||
{
|
||||
if(verbose)
|
||||
logGlobal->error("Cannot get object with id %d. No such object", objid.getNum());
|
||||
logGlobal->error("Cannot get object with id %d. No such object", objId.getNum());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const CGObjectInstance * ret = getMapConstPtr()->getObject(objid);
|
||||
const CGObjectInstance * ret = getMapConstPtr()->getObject(objId);
|
||||
if(!ret && verbose)
|
||||
{
|
||||
logGlobal->error("Cannot get object with id %d. Object was removed", objid.getNum());
|
||||
logGlobal->error("Cannot get object with id %d. Object was removed", objId.getNum());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user