mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-27 08:21:38 +00:00
feat: taking every object from one client can leave one out
DestructAllEntities takes an object to skip, for the seamless instance move that keeps the player's own ghost. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -499,8 +499,9 @@ void EntityManager::SerializeEntity(const Entity& entity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityManager::DestructAllEntities(const SystemAddress& sysAddr) {
|
void EntityManager::DestructAllEntities(const SystemAddress& sysAddr, const LWOOBJID except) {
|
||||||
for (auto* entity : m_Entities | std::views::values) {
|
for (auto* entity : m_Entities | std::views::values) {
|
||||||
|
if (entity && except != LWOOBJID_EMPTY && entity->GetObjectID() == except) continue;
|
||||||
DestructEntity(entity, sysAddr);
|
DestructEntity(entity, sysAddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ public:
|
|||||||
void SerializeEntity(const Entity& entity);
|
void SerializeEntity(const Entity& entity);
|
||||||
|
|
||||||
void ConstructAllEntities(const SystemAddress& sysAddr);
|
void ConstructAllEntities(const SystemAddress& sysAddr);
|
||||||
void DestructAllEntities(const SystemAddress& sysAddr);
|
// Takes every object away from one client, except `except` when given
|
||||||
|
void DestructAllEntities(const SystemAddress& sysAddr, LWOOBJID except = LWOOBJID_EMPTY);
|
||||||
|
|
||||||
void SetGhostDistanceMax(float value);
|
void SetGhostDistanceMax(float value);
|
||||||
void SetGhostDistanceMin(float value);
|
void SetGhostDistanceMin(float value);
|
||||||
|
|||||||
Reference in New Issue
Block a user