From 55bfcaec19640f079015d166cb8fa8cbae1d471b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 21 May 2025 22:11:51 -0400 Subject: [PATCH] Fix missing ID handling for warp events --- src/core/events.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/events.cpp b/src/core/events.cpp index ce376c44..a4ab33a9 100644 --- a/src/core/events.cpp +++ b/src/core/events.cpp @@ -343,6 +343,7 @@ Event *WarpEvent::duplicate() const { copy->setX(this->getX()); copy->setY(this->getY()); copy->setElevation(this->getElevation()); + copy->setIdName(this->getIdName()); copy->setDestinationMap(this->getDestinationMap()); copy->setDestinationWarpID(this->getDestinationWarpID()); @@ -362,6 +363,10 @@ EventFrame *WarpEvent::createEventFrame() { OrderedJson::object WarpEvent::buildEventJson(Project *project) { OrderedJson::object warpJson; + QString idName = this->getIdName(); + if (!idName.isEmpty()) + warpJson["warp_id"] = idName; + warpJson["x"] = this->getX(); warpJson["y"] = this->getY(); warpJson["elevation"] = this->getElevation(); @@ -376,6 +381,7 @@ OrderedJson::object WarpEvent::buildEventJson(Project *project) { bool WarpEvent::loadFromJson(QJsonObject json, Project *project) { this->setX(readInt(&json, "x")); this->setY(readInt(&json, "y")); + this->setIdName(readString(&json, "warp_id")); this->setElevation(readInt(&json, "elevation")); this->setDestinationWarpID(readString(&json, "dest_warp_id"));