mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 16:55:27 +00:00
fix: a character's mount save is written as 0, as live did
All 450 live saves looked at had <mnt a="0"/>. The server wrote the item of the mount being ridden, a value live never showed and the client would start with although nobody rides after a load. <mnt a="0"/> is now always written, riding or not. A save that holds another value, or one that is not a number, is still read without failing and gets 0 at the next save. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include "MountControlComponent.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "PossessorComponent.h"
|
||||
|
||||
#include "tinyxml2.h"
|
||||
|
||||
@@ -18,6 +16,6 @@ void MountControlComponent::WriteSaveData(tinyxml2::XMLDocument& doc) {
|
||||
auto* mount = obj->FirstChildElement("mnt");
|
||||
if (!mount) mount = obj->InsertNewChildElement("mnt");
|
||||
|
||||
const auto* const possessor = m_Parent->GetComponent<PossessorComponent>();
|
||||
mount->SetAttribute("a", possessor ? possessor->GetMountItemID() : LWOOBJID_EMPTY);
|
||||
// 0 in every live save looked at (450), so 0 is written, riding or not
|
||||
mount->SetAttribute("a", 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user