1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Pack of tiny code improvements for @alexvins request

This commit is contained in:
ArseniyShestakov
2015-03-08 20:19:00 +03:00
parent f490ea1fcd
commit 826a64b579
3 changed files with 13 additions and 28 deletions

View File

@@ -720,8 +720,8 @@ ETeleportChannelType::ETeleportChannelType CGameInfoCallback::getTeleportChannel
{
std::vector<ObjectInstanceID> entrances = getTeleportChannelEntraces(id, ObjectInstanceID(), Player);
std::vector<ObjectInstanceID> exits = getTeleportChannelExits(id, ObjectInstanceID(), Player);
if((!entrances.size() || !exits.size())
|| (entrances.size() == 1 && entrances == exits))
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
{
return ETeleportChannelType::IMPASSABLE;
}