From a3a2f3bbcd8b5b328e947ceab0b6c74d3c1f178e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 12 Feb 2023 13:30:33 -0500 Subject: [PATCH] Fix null characters being written to JSON files --- CHANGELOG.md | 1 + src/core/events.cpp | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a10d05..1117ef90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Change encounter tab copy and paste behavior. ### Fixed +- Fix null characters being unpredictably written to some JSON files. - Fix tilesets that share part of their name loading incorrectly. - Fix events being hidden behind connecting maps. - Fix some minor visual issues on the Connections tab. diff --git a/src/core/events.cpp b/src/core/events.cpp index 85e08116..fdce7893 100644 --- a/src/core/events.cpp +++ b/src/core/events.cpp @@ -151,8 +151,6 @@ EventFrame *ObjectEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new ObjectFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -307,8 +305,6 @@ EventFrame *CloneObjectEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new CloneObjectFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -417,8 +413,6 @@ EventFrame *WarpEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new WarpFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -509,8 +503,6 @@ EventFrame *TriggerEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new TriggerFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -585,8 +577,6 @@ EventFrame *WeatherTriggerEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new WeatherTriggerFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -660,8 +650,6 @@ EventFrame *SignEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new SignFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -735,8 +723,6 @@ EventFrame *HiddenItemEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new HiddenItemFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -830,8 +816,6 @@ EventFrame *SecretBaseEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new SecretBaseFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; } @@ -885,8 +869,6 @@ EventFrame *HealLocationEvent::createEventFrame() { if (!this->eventFrame) { this->eventFrame = new HealLocationFrame(this); this->eventFrame->setup(); - - QObject::connect(this->eventFrame, &QObject::destroyed, [this](){ this->eventFrame = nullptr; }); } return this->eventFrame; }