diff --git a/include/core/event.h b/include/core/event.h index a49a3c00..8bbb7168 100644 --- a/include/core/event.h +++ b/include/core/event.h @@ -53,6 +53,9 @@ public: uint16_t getU16(QString key) { return values.value(key).toUShort(nullptr, 0); } + int16_t getS16(QString key) { + return values.value(key).toShort(nullptr, 0); + } void put(QString key, int value) { put(key, QString("%1").arg(value)); } diff --git a/src/core/event.cpp b/src/core/event.cpp index 58d1ec28..74f9db35 100644 --- a/src/core/event.cpp +++ b/src/core/event.cpp @@ -298,8 +298,8 @@ OrderedJson::object Event::buildObjectEventJSON() if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokefirered) { eventObj["in_connection"] = this->getInt("in_connection") > 0 || this->get("in_connection") == "TRUE"; } - eventObj["x"] = this->getU16("x"); - eventObj["y"] = this->getU16("y"); + eventObj["x"] = this->getS16("x"); + eventObj["y"] = this->getS16("y"); eventObj["elevation"] = this->getInt("elevation"); eventObj["movement_type"] = this->get("movement_type"); eventObj["movement_range_x"] = this->getInt("radius_x");