mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
more correct proxyID validation
This commit is contained in:
parent
f996989a40
commit
b523b2a81a
1 changed files with 3 additions and 2 deletions
|
@ -121,14 +121,15 @@ uint32_t Space::copyProxyValues(Proxy* proxies, uint32_t numDestProxies) const {
|
|||
|
||||
const Owner Space::getOwner(int32_t proxyID) const {
|
||||
std::unique_lock<std::mutex> lock(_proxiesMutex);
|
||||
if (_IDAllocator.checkIndex(proxyID)) {
|
||||
if (isAllocatedID(proxyID) && (proxyID < (Index)_proxies.size())) {
|
||||
return _owners[proxyID];
|
||||
}
|
||||
return Owner();
|
||||
}
|
||||
|
||||
uint8_t Space::getRegion(int32_t proxyID) const {
|
||||
if (_IDAllocator.checkIndex(proxyID)) {
|
||||
std::unique_lock<std::mutex> lock(_proxiesMutex);
|
||||
if (isAllocatedID(proxyID) && (proxyID < (Index)_proxies.size())) {
|
||||
return _proxies[proxyID].region;
|
||||
}
|
||||
return (uint8_t)Region::INVALID;
|
||||
|
|
Loading…
Reference in a new issue