| 1478 | } |
| 1479 | |
| 1480 | void NetworkReplicator::RemoveObject(ScriptingObject* obj) |
| 1481 | { |
| 1482 | if (!obj || NetworkManager::IsOffline()) |
| 1483 | return; |
| 1484 | ScopeLock lock(ObjectsLock); |
| 1485 | const auto it = Objects.Find(obj->GetID()); |
| 1486 | if (it == Objects.End()) |
| 1487 | return; |
| 1488 | |
| 1489 | // Remove object from the list |
| 1490 | NETWORK_REPLICATOR_LOG(Info, "[NetworkReplicator] Remove object {}, owned by {}", obj->GetID().ToString(), it->Item.ParentId.ToString()); |
| 1491 | if (Hierarchy && it->Item.Role == NetworkObjectRole::OwnedAuthoritative) |
| 1492 | Hierarchy->RemoveObject(obj); |
| 1493 | Objects.Remove(it); |
| 1494 | } |
| 1495 | |
| 1496 | void NetworkReplicator::SpawnObject(ScriptingObject* obj) |
| 1497 | { |
no test coverage detected