mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-13 19:58:21 +00:00
Selective saving for map and location (#732)
* Don't save the map and char location info if we are in an instanced * LUP worlds will be handled in a future PR * simplify check
This commit is contained in:
parent
3b7f1dad54
commit
976bd3c41b
@ -301,9 +301,9 @@ void Character::SaveXMLToDatabase() {
|
||||
character->SetAttribute("gm", m_GMLevel);
|
||||
character->SetAttribute("cc", m_Coins);
|
||||
|
||||
// lzid garbage, binary concat of zoneID, zoneInstance and zoneClone
|
||||
if (Game::server->GetZoneID() != 0) {
|
||||
auto zoneInfo = dZoneManager::Instance()->GetZone()->GetZoneID();
|
||||
// lzid garbage, binary concat of zoneID, zoneInstance and zoneClone
|
||||
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
||||
uint64_t lzidConcat = zoneInfo.GetCloneID();
|
||||
lzidConcat = (lzidConcat << 16) | uint16_t(zoneInfo.GetInstanceID());
|
||||
lzidConcat = (lzidConcat << 16) | uint16_t(zoneInfo.GetMapID());
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "CDClientManager.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Character.h"
|
||||
#include "dZoneManager.h"
|
||||
|
||||
ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Component(entity) {
|
||||
m_Position = {};
|
||||
@ -163,6 +164,9 @@ void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto zoneInfo = dZoneManager::Instance()->GetZone()->GetZoneID();
|
||||
|
||||
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0) {
|
||||
character->SetAttribute("lzx", m_Position.x);
|
||||
character->SetAttribute("lzy", m_Position.y);
|
||||
character->SetAttribute("lzz", m_Position.z);
|
||||
@ -171,6 +175,7 @@ void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
character->SetAttribute("lzrz", m_Rotation.z);
|
||||
character->SetAttribute("lzrw", m_Rotation.w);
|
||||
}
|
||||
}
|
||||
|
||||
void ControllablePhysicsComponent::SetPosition(const NiPoint3& pos) {
|
||||
if (m_Static) {
|
||||
|
Loading…
Reference in New Issue
Block a user