feat: save_property_location, logging back in on a property

A character's location was only saved outside properties, so logging out
on a property and back in always went to the last world before it (as
live). save_property_location=1 (worldconfig.ini, dashboard: world
settings) saves it on properties too, and login returns to that property.
Off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 11:33:47 -05:00
parent 32448a8556
commit 379f09dd7c
3 changed files with 9 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
#include "Logger.h"
#include "BitStream.h"
#include "Game.h"
#include "dConfig.h"
#include <chrono>
#include "Entity.h"
#include "EntityManager.h"
@@ -282,8 +283,11 @@ void Character::SaveXMLToDatabase() {
character->SetAttribute("cc", m_Coins);
auto zoneInfo = Game::zoneManager->GetZone()->GetZoneID();
// Where the character logs back in. Not a property (a clone) unless save_property_location is 1: by default
// logging in from a property goes to the last world before it.
const bool savesHere = zoneInfo.GetCloneID() == 0 || (Game::config && Game::config->GetValue("save_property_location") == "1");
// lzid garbage, binary concat of zoneID, zoneInstance and zoneClone
if (zoneInfo.GetMapID() != 0 && zoneInfo.GetCloneID() == 0 && !Game::zoneManager->GetDisableSaveLocation()) {
if (zoneInfo.GetMapID() != 0 && savesHere && !Game::zoneManager->GetDisableSaveLocation()) {
uint64_t lzidConcat = zoneInfo.GetCloneID();
lzidConcat = (lzidConcat << 16) | uint16_t(zoneInfo.GetInstanceID());
lzidConcat = (lzidConcat << 16) | uint16_t(zoneInfo.GetMapID());