mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Updates per review
This commit is contained in:
+5
-3
@@ -2445,13 +2445,15 @@ Corpse *Corpse::LoadCharacterCorpse(
|
|||||||
c->m_become_npc = false;
|
c->m_become_npc = false;
|
||||||
c->m_consented_guild_id = cc.guild_consent_id;
|
c->m_consented_guild_id = cc.guild_consent_id;
|
||||||
|
|
||||||
if (!cc.entity_variables.empty() && cc.entity_variables != "null") {
|
try {
|
||||||
json j = json::parse(cc.entity_variables, nullptr, false);
|
if (Strings::IsValidJson(cc.entity_variables)) {
|
||||||
if (!j.is_discarded()) {
|
json j = json::parse(cc.entity_variables);
|
||||||
for (auto& el : j.items()) {
|
for (auto& el : j.items()) {
|
||||||
c->SetEntityVariable(el.key(), el.value().get<std::string>());
|
c->SetEntityVariable(el.key(), el.value().get<std::string>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
LogError("Failed to parse entity_variables JSON for corpse ID %u: %s", cc.id, ex.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
c->IsRezzed(cc.is_rezzed);
|
c->IsRezzed(cc.is_rezzed);
|
||||||
|
|||||||
Reference in New Issue
Block a user