diff --git a/dDashboardServer/routes/SettingsCatalog.cpp b/dDashboardServer/routes/SettingsCatalog.cpp index d077655d4..dc5fc4666 100644 --- a/dDashboardServer/routes/SettingsCatalog.cpp +++ b/dDashboardServer/routes/SettingsCatalog.cpp @@ -151,6 +151,7 @@ namespace { c.Add(Bool(WORLD, "generate_dump", "Crash dumps from world servers", "Write a dump when a world server crashes (needs the crash dump folder).", false, true)); c.Add(Bool(WORLD, "save_lxfmls", "Save model files", "Save players' models (LXFML) to disk before they are split, for debugging.", false)); c.Add(Bool(WORLD, "ghosting_scenes", "Scene ghosting", "Players get the objects of the scenes their game keeps loaded (the scene under them, the scenes connected to it and the global scene), as the client streams scenes, instead of the ones within 100 to 150 units. Needs the zone's terrain scene map; zones without one keep distance ghosting.", false, true)); + c.Add(Bool(WORLD, "save_property_location", "Log back in on properties", "Logging out on a property and back in returns to that property. Off (as live): to the last world before it.", false)); c.Add(Bool(WORLD, "bbb_consume_bricks", "Brick building uses bricks", "Saving a brick by brick model uses up the bricks in it, as live did. Off: the bricks go back to the backpack.", false)); c.Add(Bool(SHARED, "dont_generate_dcf", "Don't build the chat filter file", "Skip compiling the chat word list to a file.", false, true)); diff --git a/dGame/Character.cpp b/dGame/Character.cpp index d4e11a9f3..bd498b362 100644 --- a/dGame/Character.cpp +++ b/dGame/Character.cpp @@ -6,6 +6,7 @@ #include "Logger.h" #include "BitStream.h" #include "Game.h" +#include "dConfig.h" #include #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()); diff --git a/resources/worldconfig.ini b/resources/worldconfig.ini index 693d050e9..8baff6937 100644 --- a/resources/worldconfig.ini +++ b/resources/worldconfig.ini @@ -109,6 +109,9 @@ save_lxfmls=0 # 1: saving a brick by brick model uses up the bricks in it, as live did. 0: they go back to the backpack. bbb_consume_bricks=0 +# 1: logging out on a property and back in returns to that property. 0 (as live): to the last world before it. +save_property_location=0 + # 1: players get the objects of the scenes their game keeps loaded (the scene under them, the scenes connected to it # by the zone's scene transitions, and the global scene) instead of the objects within the ghosting distances. # Needs the zone's terrain scene map; zones without one keep distance ghosting.