mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
CGTeleport: use vstd::erase_if_present in getAll functions
This commit is contained in:
parent
f7a999f0f3
commit
1801b5eaf4
@ -768,18 +768,18 @@ bool CGTeleport::isChannelExit(ObjectInstanceID id) const
|
||||
|
||||
std::vector<ObjectInstanceID> CGTeleport::getAllEntrances(bool excludeCurrent) const
|
||||
{
|
||||
std::vector<ObjectInstanceID> ret = cb->getTeleportChannelEntraces(channel);
|
||||
auto ret = cb->getTeleportChannelEntraces(channel);
|
||||
if(excludeCurrent)
|
||||
ret.erase(std::remove(ret.begin(), ret.end(), id), ret.end());
|
||||
vstd::erase_if_present(ret, id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<ObjectInstanceID> CGTeleport::getAllExits(bool excludeCurrent) const
|
||||
{
|
||||
std::vector<ObjectInstanceID> ret = cb->getTeleportChannelExits(channel);
|
||||
auto ret = cb->getTeleportChannelExits(channel);
|
||||
if(excludeCurrent)
|
||||
ret.erase(std::remove(ret.begin(), ret.end(), id), ret.end());
|
||||
vstd::erase_if_present(ret, id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user