From eb6da37e3b96b5dd2a73b1b11c957cbd184ad970 Mon Sep 17 00:00:00 2001 From: Emagi Date: Mon, 18 Aug 2025 15:12:41 -0400 Subject: [PATCH] keep propertiesMutex only for the initial set attempt, not for Register/SetProperty --- source/WorldServer/Entity.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source/WorldServer/Entity.cpp b/source/WorldServer/Entity.cpp index f3d152b..6838ee1 100644 --- a/source/WorldServer/Entity.cpp +++ b/source/WorldServer/Entity.cpp @@ -4022,18 +4022,19 @@ sint64 Entity::GetInfoStructSInt(std::string field) bool Entity::SetInfoStructString(std::string field, std::string value) { - std::shared_lock rlock(propertiesMutex); - map>::const_iterator itr = set_string_funcs.find(field); - if(itr != set_string_funcs.end()) { - (itr->second)(value); - return true; + std::shared_lock rlock(propertiesMutex); + map>::const_iterator itr = set_string_funcs.find(field); + if(itr != set_string_funcs.end()) + { + (itr->second)(value); + return true; + } } - else { - RegisterProperty(field); - SetProperty(field, value); - } - return false; + + RegisterProperty(field); + SetProperty(field, value); + return true; }