[Client] Do not copy strings in getLocalActor and getDedicatedActor

sol2-server-rewrite
Koncord 7 years ago
parent e2e197d84a
commit c2578918f2

@ -434,12 +434,12 @@ void Cell::uninitializeDedicatedActors()
dedicatedActors.clear();
}
LocalActor *Cell::getLocalActor(std::string actorIndex)
LocalActor *Cell::getLocalActor(const std::string &actorIndex)
{
return localActors.at(actorIndex);
}
DedicatedActor *Cell::getDedicatedActor(std::string actorIndex)
DedicatedActor *Cell::getDedicatedActor(const std::string &actorIndex)
{
return dedicatedActors.at(actorIndex);
}

@ -36,8 +36,8 @@ namespace mwmp
void uninitializeLocalActors();
void uninitializeDedicatedActors();
virtual LocalActor *getLocalActor(std::string actorIndex);
virtual DedicatedActor *getDedicatedActor(std::string actorIndex);
virtual LocalActor *getLocalActor(const std::string &actorIndex);
virtual DedicatedActor *getDedicatedActor(const std::string &actorIndex);
bool hasLocalAuthority();
void setAuthority(const RakNet::RakNetGUID& guid);

Loading…
Cancel
Save