From b6a5b570dcadb609d7d95e45c65de7732e653fc4 Mon Sep 17 00:00:00 2001 From: dairymoose Date: Mon, 18 Aug 2014 21:38:14 -0400 Subject: [PATCH] Wild save file contained 0x05 "unsigned long" type of Trait Objects (normally it is 0x02 "short") --- MooseEdit.pro.user | 2 +- TraitWidget.cpp | 7 ++++++- mainwindow.cpp | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/MooseEdit.pro.user b/MooseEdit.pro.user index aa1a81f..ccc9294 100644 --- a/MooseEdit.pro.user +++ b/MooseEdit.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/TraitWidget.cpp b/TraitWidget.cpp index df8985e..d4efb92 100644 --- a/TraitWidget.cpp +++ b/TraitWidget.cpp @@ -79,7 +79,12 @@ void TraitWidget::editTextChanged(const QString &text, QLabel *label) { if (id != -1 && id < traitObjects.size()) { LsbObject *traitObject = traitObjects[id]; if (traitObject != 0) { - traitObject->setData((char *)&value, sizeof(short)); + if (traitObject->getType() == 0x02) { + traitObject->setData((char *)&value, sizeof(short)); + } else { + unsigned long longValue = value; + traitObject->setData((char *)&longValue, sizeof(longValue)); + } } } } diff --git a/mainwindow.cpp b/mainwindow.cpp index e341932..fd4e9cd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -275,6 +275,10 @@ void MainWindow::unload() { delete globals[i]; } globals.clear(); + for (int i=0; iaddItem(item); } charTab->setEquipmentHandler(equipHandler); + + QTreeWidget *tree = this->findChild("treeWidget"); + std::vector one; + one.push_back(character->getObject()); + displayAllItems2(tree, one); } } else {