mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 08:45:27 +00:00
fix(component): send a script component only when the client makes one
The client makes a script component for a registry script with a non-zero id, or for a custom script in the config it is sent (LOT 176 never): ApplyScriptComponentIfHasScript and LWOScriptComponent's allocator. A character's script and a server-only custom_script_server stay on the server and send nothing. The 5 LOTs whose registry script id is 0 (e.g. the AG concert fan, LOT 3002: live sent no config and no script) lose the bit the client never read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1133,6 +1133,12 @@ void Entity::SetGMLevel(eGameMasterLevel value) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Entity::IsVarSentToClient(const std::u16string& name) const {
|
||||
if (GetComponent<ModelComponent>() && !GetComponent<PetComponent>()) return m_Settings.values.contains(name);
|
||||
const auto& syncLDF = GetVar<std::vector<std::u16string>>(u"syncLDF");
|
||||
return std::ranges::find(syncLDF, name) != syncLDF.end();
|
||||
}
|
||||
|
||||
void Entity::WriteLDFData(const LwoNameValue& ldf, RakNet::BitStream& outBitStream) const {
|
||||
RakNet::BitStream settingStream;
|
||||
int32_t numberOfValidKeys = ldf.values.size();
|
||||
|
||||
Reference in New Issue
Block a user