mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 01:05:28 +00:00
fix(component): the zone control object constructs as on live
Minigame control (50) is an activity component in the client (LWOMinigameComponent) and is made from the registry, so the zone control object (LOT 2365, registry id 0) has one; it sends what an activity sends (dirty, no players), not a fixed 0x40000000 (which nothing sent: the old id > 0 check never made it). The zone's script on that object is server only: the client makes no script component for it, so it sends nothing. DLU's zone control construction now equals live's byte for byte (209 captures, e.g. GruntMonkey world2); the decoder reads 50 as an activity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -585,7 +585,8 @@ void Entity::Initialize() {
|
||||
if (zoneData != nullptr) {
|
||||
const int32_t zoneScriptID = zoneData->scriptID;
|
||||
CDScriptComponent zoneScriptData = scriptCompTable->GetByID(zoneScriptID);
|
||||
AddComponent<ScriptComponent>(zoneScriptID, zoneScriptData.script_name, true, false);
|
||||
// A server script only: the client has no script component on the zone control object (live sent none)
|
||||
AddComponent<ScriptComponent>(zoneScriptID, zoneScriptData.script_name, false, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -797,8 +798,9 @@ void Entity::Initialize() {
|
||||
break;
|
||||
}
|
||||
case eReplicaComponentType::MINI_GAME_CONTROL: {
|
||||
const auto minigameControlID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MINI_GAME_CONTROL);
|
||||
if (minigameControlID > 0) {
|
||||
// The client makes it from the registry (the zone control object's id is 0)
|
||||
const auto minigameControlID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MINI_GAME_CONTROL, -1);
|
||||
if (minigameControlID > -1) {
|
||||
AddComponent<MiniGameControlComponent>(minigameControlID);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user