diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index f85f7d38f..8cf353b0b 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -698,20 +698,20 @@ std::vector CGameInfoCallback::getVisibleTeleportObjects(std:: return ids; } -std::vector CGameInfoCallback::getTeleportChannelEntraces(TeleportChannelID id, ObjectInstanceID excludeId, PlayerColor player) const +std::vector CGameInfoCallback::getTeleportChannelEntraces(TeleportChannelID id, PlayerColor player) const { return getVisibleTeleportObjects(gs->map->teleportChannels[id]->entrances, player); } -std::vector CGameInfoCallback::getTeleportChannelExits(TeleportChannelID id, ObjectInstanceID excludeId, PlayerColor player) const +std::vector CGameInfoCallback::getTeleportChannelExits(TeleportChannelID id, PlayerColor player) const { return getVisibleTeleportObjects(gs->map->teleportChannels[id]->exits, player); } ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor player) const { - std::vector entrances = getTeleportChannelEntraces(id, ObjectInstanceID(), player); - std::vector exits = getTeleportChannelExits(id, ObjectInstanceID(), player); + std::vector entrances = getTeleportChannelEntraces(id, player); + std::vector exits = getTeleportChannelExits(id, player); if((!entrances.size() || !exits.size()) // impassable if exits or entrances list are empty || (entrances.size() == 1 && entrances == exits)) // impassable if only entrance and only exit is same object. e.g bidirectional monolith { diff --git a/lib/CGameInfoCallback.h b/lib/CGameInfoCallback.h index bc9b2fd18..1c821e01c 100644 --- a/lib/CGameInfoCallback.h +++ b/lib/CGameInfoCallback.h @@ -110,8 +110,8 @@ public: //teleport std::vector getVisibleTeleportObjects(std::vector ids, PlayerColor player) const; - std::vector getTeleportChannelEntraces(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const; - std::vector getTeleportChannelExits(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const; + std::vector getTeleportChannelEntraces(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; + std::vector getTeleportChannelExits(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; bool isTeleportChannelImpassable(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; bool isTeleportChannelBidirectional(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index f7968eaae..4b64980a5 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -3357,7 +3357,7 @@ void CPathfinder::calculatePaths() || addTeleportOneWay(cObj) || addTeleportOneWayRandom(cObj))) { - for(auto objId : gs->getTeleportChannelExits(cObj->channel, ObjectInstanceID(), hero->tempOwner)) + for(auto objId : gs->getTeleportChannelExits(cObj->channel, hero->tempOwner)) { auto obj = getObj(objId); if(CGTeleport::isExitPassable(gs, hero, obj)) @@ -3575,7 +3575,7 @@ bool CPathfinder::addTeleportOneWay(const CGTeleport * obj) const { if(allowTeleportOneWay && isTeleportChannelUnidirectional(obj->channel, hero->tempOwner)) { - auto passableExits = CGTeleport::getPassableExits(gs, hero, gs->getTeleportChannelExits(obj->channel, ObjectInstanceID(), hero->tempOwner)); + auto passableExits = CGTeleport::getPassableExits(gs, hero, gs->getTeleportChannelExits(obj->channel, hero->tempOwner)); if(passableExits.size() == 1) return true; } @@ -3586,7 +3586,7 @@ bool CPathfinder::addTeleportOneWayRandom(const CGTeleport * obj) const { if(allowTeleportOneWayRandom && isTeleportChannelUnidirectional(obj->channel, hero->tempOwner)) { - auto passableExits = CGTeleport::getPassableExits(gs, hero, gs->getTeleportChannelExits(obj->channel, ObjectInstanceID(), hero->tempOwner)); + auto passableExits = CGTeleport::getPassableExits(gs, hero, gs->getTeleportChannelExits(obj->channel, hero->tempOwner)); if(passableExits.size() > 1) return true; }