mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
[Client] Use faster check for whether actors are DedicatedPlayers
This commit is contained in:
parent
c8ec77875c
commit
f7a084c824
1 changed files with 8 additions and 2 deletions
|
@ -71,8 +71,10 @@ DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr)
|
|||
{
|
||||
if (p.second == 0 || p.second->getPtr().mRef == 0)
|
||||
continue;
|
||||
string refid = ptr.getCellRef().getRefId();
|
||||
if (p.second->getPtr().getCellRef().getRefId() == refid)
|
||||
|
||||
string refId = ptr.getCellRef().getRefId();
|
||||
|
||||
if (p.second->getPtr().getCellRef().getRefId() == refId)
|
||||
return p.second;
|
||||
}
|
||||
return 0;
|
||||
|
@ -83,6 +85,10 @@ bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr)
|
|||
if (ptr.mRef == nullptr)
|
||||
return false;
|
||||
|
||||
// Players always have 0 as their refNumIndex and mpNum
|
||||
if (ptr.getCellRef().getRefNum().mIndex != 0 || ptr.getCellRef().getMpNum() != 0)
|
||||
return false;
|
||||
|
||||
return (getPlayer(ptr) != 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue