From 310d917d236023398e0520912ba55e0c93fcced5 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Sat, 18 May 2013 22:54:26 +0100 Subject: [PATCH] Fixed compile errors, closed issue #19 --- src/game.cpp | 48 ++++++++++++++++++++++++++++++++++---------- src/gui/settings.cpp | 5 ----- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 6e81fba0..5b3c8a63 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -231,20 +231,33 @@ namespace boss { else if (Id() == GAME_FONV) ret = lo_create_handle(&gh, LIBLO_GAME_FNV, gamePath.string().c_str()); - if (ret != LIBLO_OK) - throw error(ERROR_LIBLO_ERROR, "libloadorder game handle creation failed."); + if (ret != LIBLO_OK) { + const char * err; + lo_get_error_message(&err); + lo_cleanup(); + throw error(ERROR_LIBLO_ERROR, err); + } ret = lo_set_game_master(gh, _masterFile.c_str()); - if (ret != LIBLO_OK) + if (ret != LIBLO_OK) { + const char * err; + lo_get_error_message(&err); + lo_destroy_handle(gh); + lo_cleanup(); throw error(ERROR_LIBLO_ERROR, "libloadorder total conversion support setup failed."); + } - if (lo_get_active_plugins(gh, &pluginArr, &pluginArrSize) != LIBLO_OK) - throw error(ERROR_LIBLO_ERROR, "Active plugin list lookup failed."); - else { - for (size_t i=0; i < pluginArrSize; ++i) { - activePlugins.insert(string(pluginArr[i])); - } + if (lo_get_active_plugins(gh, &pluginArr, &pluginArrSize) != LIBLO_OK) { + const char * err; + lo_get_error_message(&err); + lo_destroy_handle(gh); + lo_cleanup(); + throw error(ERROR_LIBLO_ERROR, err); + } + + for (size_t i=0; i < pluginArrSize; ++i) { + activePlugins.insert(string(pluginArr[i])); } lo_destroy_handle(gh); @@ -269,13 +282,22 @@ namespace boss { else if (Id() == GAME_FONV) ret = lo_create_handle(&gh, LIBLO_GAME_FNV, gamePath.string().c_str()); - if (ret != LIBLO_OK) + if (ret != LIBLO_OK) { + const char * err; + lo_get_error_message(&err); + lo_cleanup(); throw error(ERROR_LIBLO_ERROR, "libloadorder game handle creation failed."); + } ret = lo_set_game_master(gh, _masterFile.c_str()); - if (ret != LIBLO_OK) + if (ret != LIBLO_OK) { + const char * err; + lo_get_error_message(&err); + lo_destroy_handle(gh); + lo_cleanup(); throw error(ERROR_LIBLO_ERROR, "libloadorder total conversion support setup failed."); + } pluginArrSize = loadOrder.size(); pluginArr = new char*[pluginArrSize]; @@ -290,6 +312,10 @@ namespace boss { for (size_t i=0; i < pluginArrSize; i++) delete [] pluginArr[i]; delete [] pluginArr; + const char * err; + lo_get_error_message(&err); + lo_destroy_handle(gh); + lo_cleanup(); throw error(ERROR_LIBLO_ERROR, "Setting load order failed."); } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index c8ac12fc..5f7446c0 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -65,11 +65,6 @@ SettingsFrame::SettingsFrame(wxWindow *parent, const wxString& title, YAML::Node LanguageChoice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, Language); DebugVerbosityChoice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, DebugVerbosity); - OblivionURL = new wxTextCtrl(this, wxID_ANY); - SkyrimURL = new wxTextCtrl(this, wxID_ANY); - FO3URL = new wxTextCtrl(this, wxID_ANY); - FONVURL = new wxTextCtrl(this, wxID_ANY); - UpdateMasterlistBox = new wxCheckBox(this, wxID_ANY, translate("Update masterlist before sorting.")); reportViewBox = new wxCheckBox(this, wxID_ANY, translate("View reports externally in default browser."));