mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +02: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 {
|
const Owner Space::getOwner(int32_t proxyID) const {
|
||||||
std::unique_lock<std::mutex> lock(_proxiesMutex);
|
std::unique_lock<std::mutex> lock(_proxiesMutex);
|
||||||
if (_IDAllocator.checkIndex(proxyID)) {
|
if (isAllocatedID(proxyID) && (proxyID < (Index)_proxies.size())) {
|
||||||
return _owners[proxyID];
|
return _owners[proxyID];
|
||||||
}
|
}
|
||||||
return Owner();
|
return Owner();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Space::getRegion(int32_t proxyID) const {
|
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 _proxies[proxyID].region;
|
||||||
}
|
}
|
||||||
return (uint8_t)Region::INVALID;
|
return (uint8_t)Region::INVALID;
|
||||||
|
|
Loading…
Reference in a new issue