Skip to content

Commit

Permalink
Wild save file contained 0x05 "unsigned long" type of Trait Objects (…
Browse files Browse the repository at this point in the history
…normally it is 0x02 "short")
  • Loading branch information
dairymoose committed Aug 19, 2014
1 parent b88c10b commit b6a5b57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MooseEdit.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2014-08-14T20:47:45. -->
<!-- Written by QtCreator 3.1.2, 2014-08-18T21:20:37. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand Down
7 changes: 6 additions & 1 deletion TraitWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ void MainWindow::unload() {
delete globals[i];
}
globals.clear();
for (int i=0; i<globalTagList.size(); ++i) {
delete globalTagList[i];
}
globalTagList.clear();
}

void MainWindow::handleLoadButton() {
Expand Down Expand Up @@ -368,6 +372,11 @@ void MainWindow::handleLoadButton() {
equipHandler->addItem(item);
}
charTab->setEquipmentHandler(equipHandler);

QTreeWidget *tree = this->findChild<QTreeWidget *>("treeWidget");
std::vector<LsbObject *> one;
one.push_back(character->getObject());
displayAllItems2(tree, one);
}
}
else {
Expand Down

0 comments on commit b6a5b57

Please sign in to comment.