Object event coords from unsigned to signed

This commit is contained in:
GriffinR 2020-05-15 15:32:57 -04:00 committed by huderlem
parent 23a20dd736
commit 99b95882fe
2 changed files with 5 additions and 2 deletions

View file

@ -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));
}

View file

@ -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");