mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat(zone): don't spawn carver_only objects, keep them as walls
The client never loads a level object whose config has carver_only set (its resource manager skips the load; LWOBasePhysComponent::LoadConfigData 0x00c495c9 reads the flag next to navmesh_carver), and live never sent one: none of the 331 carver_only placements (mostly Crux Prime's trigger boxes) shows up among the live constructions, where their zones' other objects do. DLU spawned them as objects. They are skipped now. The ones that carve the navmesh (53, in six zones, among them the Avant Gardens Sentinel camp walls) still stop the server's movers: their shape goes into the world's movement blockers without an object, owned by the physics world (dpWorld::AddOwnedMovementBlocker) and freed when it shuts down. None of them has a script, trigger or group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "dpGrid.h"
|
||||
#include "DetourCommon.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Game.h"
|
||||
@@ -24,6 +25,7 @@ namespace {
|
||||
bool phys_spatial_partitioning = true;
|
||||
|
||||
std::vector<dpMovementBlocker> m_MovementBlockers;
|
||||
std::vector<std::unique_ptr<dpEntity>> m_OwnedMovementBlockers;
|
||||
};
|
||||
|
||||
void dpWorld::Initialize(unsigned int zoneID, bool generateNewNavMesh) {
|
||||
@@ -88,6 +90,7 @@ void dpWorld::Shutdown() {
|
||||
}
|
||||
|
||||
m_MovementBlockers.clear();
|
||||
m_OwnedMovementBlockers.clear();
|
||||
}
|
||||
|
||||
bool dpWorld::IsLoaded() {
|
||||
@@ -197,6 +200,12 @@ void dpWorld::AddMovementBlocker(const dpEntity* entity, const uint32_t filter)
|
||||
m_MovementBlockers.push_back({ entity, filter });
|
||||
}
|
||||
|
||||
void dpWorld::AddOwnedMovementBlocker(dpEntity* entity, const uint32_t filter) {
|
||||
if (!entity) return;
|
||||
m_OwnedMovementBlockers.emplace_back(entity);
|
||||
AddMovementBlocker(entity, filter);
|
||||
}
|
||||
|
||||
void dpWorld::RemoveMovementBlocker(const dpEntity* entity) {
|
||||
std::erase_if(m_MovementBlockers, [entity](const dpMovementBlocker& blocker) { return blocker.entity == entity; });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user