mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +02:00
CGameInfoCallback: now actually drop excludeId argument
This commit is contained in:
parent
861104f493
commit
00b0af7306
@ -698,20 +698,20 @@ std::vector<ObjectInstanceID> CGameInfoCallback::getVisibleTeleportObjects(std::
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ObjectInstanceID> CGameInfoCallback::getTeleportChannelEntraces(TeleportChannelID id, ObjectInstanceID excludeId, PlayerColor player) const
|
std::vector<ObjectInstanceID> CGameInfoCallback::getTeleportChannelEntraces(TeleportChannelID id, PlayerColor player) const
|
||||||
{
|
{
|
||||||
return getVisibleTeleportObjects(gs->map->teleportChannels[id]->entrances, player);
|
return getVisibleTeleportObjects(gs->map->teleportChannels[id]->entrances, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ObjectInstanceID> CGameInfoCallback::getTeleportChannelExits(TeleportChannelID id, ObjectInstanceID excludeId, PlayerColor player) const
|
std::vector<ObjectInstanceID> CGameInfoCallback::getTeleportChannelExits(TeleportChannelID id, PlayerColor player) const
|
||||||
{
|
{
|
||||||
return getVisibleTeleportObjects(gs->map->teleportChannels[id]->exits, player);
|
return getVisibleTeleportObjects(gs->map->teleportChannels[id]->exits, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor player) const
|
ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor player) const
|
||||||
{
|
{
|
||||||
std::vector<ObjectInstanceID> entrances = getTeleportChannelEntraces(id, ObjectInstanceID(), player);
|
std::vector<ObjectInstanceID> entrances = getTeleportChannelEntraces(id, player);
|
||||||
std::vector<ObjectInstanceID> exits = getTeleportChannelExits(id, ObjectInstanceID(), player);
|
std::vector<ObjectInstanceID> exits = getTeleportChannelExits(id, player);
|
||||||
if((!entrances.size() || !exits.size()) // impassable if exits or entrances list are empty
|
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
|
|| (entrances.size() == 1 && entrances == exits)) // impassable if only entrance and only exit is same object. e.g bidirectional monolith
|
||||||
{
|
{
|
||||||
|
@ -110,8 +110,8 @@ public:
|
|||||||
|
|
||||||
//teleport
|
//teleport
|
||||||
std::vector<ObjectInstanceID> getVisibleTeleportObjects(std::vector<ObjectInstanceID> ids, PlayerColor player) const;
|
std::vector<ObjectInstanceID> getVisibleTeleportObjects(std::vector<ObjectInstanceID> ids, PlayerColor player) const;
|
||||||
std::vector<ObjectInstanceID> getTeleportChannelEntraces(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const;
|
std::vector<ObjectInstanceID> getTeleportChannelEntraces(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const;
|
||||||
std::vector<ObjectInstanceID> getTeleportChannelExits(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const;
|
std::vector<ObjectInstanceID> getTeleportChannelExits(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const;
|
||||||
ETeleportChannelType getTeleportChannelType(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 isTeleportChannelImpassable(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const;
|
||||||
bool isTeleportChannelBidirectional(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const;
|
bool isTeleportChannelBidirectional(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const;
|
||||||
|
@ -3357,7 +3357,7 @@ void CPathfinder::calculatePaths()
|
|||||||
|| addTeleportOneWay(cObj)
|
|| addTeleportOneWay(cObj)
|
||||||
|| addTeleportOneWayRandom(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);
|
auto obj = getObj(objId);
|
||||||
if(CGTeleport::isExitPassable(gs, hero, obj))
|
if(CGTeleport::isExitPassable(gs, hero, obj))
|
||||||
@ -3575,7 +3575,7 @@ bool CPathfinder::addTeleportOneWay(const CGTeleport * obj) const
|
|||||||
{
|
{
|
||||||
if(allowTeleportOneWay && isTeleportChannelUnidirectional(obj->channel, hero->tempOwner))
|
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)
|
if(passableExits.size() == 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -3586,7 +3586,7 @@ bool CPathfinder::addTeleportOneWayRandom(const CGTeleport * obj) const
|
|||||||
{
|
{
|
||||||
if(allowTeleportOneWayRandom && isTeleportChannelUnidirectional(obj->channel, hero->tempOwner))
|
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)
|
if(passableExits.size() > 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user