From 770d3be466719936a49bbdd3fd712e0ad4d937c2 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 30 Jul 2020 20:06:41 +0200 Subject: [PATCH] Changes PkmnLibException. --- CInterface/Core.cpp | 2 +- CInterface/Core.hpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CInterface/Core.cpp b/CInterface/Core.cpp index b8aaaa8..70b51cf 100644 --- a/CInterface/Core.cpp +++ b/CInterface/Core.cpp @@ -1,4 +1,4 @@ #include "Core.hpp" -std::string ExceptionHandler::_lastException = ""; +std::string ExceptionHandler::_pkmnLibLastException = ""; export const char* PkmnLib_C_GetLastException() { return ExceptionHandler::GetLastException(); } \ No newline at end of file diff --git a/CInterface/Core.hpp b/CInterface/Core.hpp index 780c678..fc57421 100644 --- a/CInterface/Core.hpp +++ b/CInterface/Core.hpp @@ -6,15 +6,14 @@ #include #define export extern "C" -// CreatureLibException is 1, so use 2. -#define PkmnLibException 2 +#define PkmnLibException 4 class ExceptionHandler { - static std::string _lastException; + static std::string _pkmnLibLastException; public: - static void SetLastException(const std::exception& e) { _lastException = std::string(e.what()); } - static const char* GetLastException() { return _lastException.c_str(); } + static void SetLastException(const std::exception& e) { _pkmnLibLastException = std::string(e.what()); } + static const char* GetLastException() { return _pkmnLibLastException.c_str(); } }; #define Try(data) \