summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-03-22 00:04:22 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-03-22 00:04:22 +0000
commit81c35c3e8444d1c8cb949eb71c2fe3d6e47cb8b0 (patch)
treee7bb01719297e0ac5c67adb6c65cc6362a4717dc
parent0b48d900157d66c381acc9b116ffc6d40819edce (diff)
parent72fac1f6b469a962f7b1ff35e39147d8d286b0d4 (diff)
Merge branch 'master' of https://github.com/SuperV1234/SSVOpenHexagon into 2.0.42.0.4
-rw-r--r--include/SSVOpenHexagon/Core/HexagonGame.hpp10
-rw-r--r--include/SSVOpenHexagon/Global/Config.hpp2
-rw-r--r--include/SSVOpenHexagon/Utils/LuaMetadataProxy.hpp9
-rw-r--r--src/SSVOpenHexagon/Core/HGUpdate.cpp2
-rw-r--r--src/SSVOpenHexagon/Global/Config.cpp2
5 files changed, 19 insertions, 6 deletions
diff --git a/include/SSVOpenHexagon/Core/HexagonGame.hpp b/include/SSVOpenHexagon/Core/HexagonGame.hpp
index 53beee1b..4b9b1d35 100644
--- a/include/SSVOpenHexagon/Core/HexagonGame.hpp
+++ b/include/SSVOpenHexagon/Core/HexagonGame.hpp
@@ -280,6 +280,16 @@ public:
goToMenu(false /* mSendScores */, true /* mError */);
}
}
+ catch(...)
+ {
+ std::cout << "[runLuaFunction] Unknown error on \"" << mName
+ << "\" with level \"" << levelData->name << std::endl;
+
+ if(!Config::getDebug())
+ {
+ goToMenu(false /* mSendScores */, true /* mError */);
+ }
+ }
return decltype(
Utils::runLuaFunctionIfExists<T, TArgs...>(lua, mName, mArgs...)){};
diff --git a/include/SSVOpenHexagon/Global/Config.hpp b/include/SSVOpenHexagon/Global/Config.hpp
index 87c1df32..5c0e4197 100644
--- a/include/SSVOpenHexagon/Global/Config.hpp
+++ b/include/SSVOpenHexagon/Global/Config.hpp
@@ -24,7 +24,7 @@ class Trigger;
namespace hg::Config
{
-inline constexpr GameVersion GAME_VERSION{2, 0, 3};
+inline constexpr GameVersion GAME_VERSION{2, 0, 4};
void loadConfig(const std::vector<std::string>& mOverridesIds);
void resetConfigToDefaults();
diff --git a/include/SSVOpenHexagon/Utils/LuaMetadataProxy.hpp b/include/SSVOpenHexagon/Utils/LuaMetadataProxy.hpp
index 9c07a1e5..86bc24e2 100644
--- a/include/SSVOpenHexagon/Utils/LuaMetadataProxy.hpp
+++ b/include/SSVOpenHexagon/Utils/LuaMetadataProxy.hpp
@@ -34,7 +34,8 @@ private:
std::vector<std::string> argNames;
template <typename... Ts>
- [[nodiscard]] static std::string typeToStr(TypeWrapper<std::tuple<Ts...>>) noexcept
+ [[nodiscard]] static std::string typeToStr(
+ TypeWrapper<std::tuple<Ts...>>) noexcept
{
std::string result;
@@ -46,7 +47,8 @@ private:
}
template <typename T>
- [[nodiscard]] constexpr static const char* typeToStr(TypeWrapper<T>) noexcept
+ [[nodiscard]] constexpr static const char* typeToStr(
+ TypeWrapper<T>) noexcept
{
if constexpr(std::is_same_v<T, void>)
{
@@ -181,7 +183,8 @@ public:
using AE =
Utils::ArgExtractor<decltype(&std::decay_t<F>::operator())>;
- return typeToStr(TypeWrapper<std::decay_t<typename AE::Return>>{});
+ return typeToStr(
+ TypeWrapper<std::decay_t<typename AE::Return>>{});
}},
erasedArgs{[](LuaMetadataProxy* self) {
return makeArgsString<std::decay_t<F>>(self);
diff --git a/src/SSVOpenHexagon/Core/HGUpdate.cpp b/src/SSVOpenHexagon/Core/HGUpdate.cpp
index c309f622..01aea88f 100644
--- a/src/SSVOpenHexagon/Core/HGUpdate.cpp
+++ b/src/SSVOpenHexagon/Core/HGUpdate.cpp
@@ -100,7 +100,7 @@ void HexagonGame::update(ssvu::FT mFT)
{
// Player successfully swapped.
// TODO: document and cleanup
- runLuaFunction<void>("onSwap");
+ runLuaFunctionIfExists<void>("onSwap");
}
}
diff --git a/src/SSVOpenHexagon/Global/Config.cpp b/src/SSVOpenHexagon/Global/Config.cpp
index 78aed633..3cb1387e 100644
--- a/src/SSVOpenHexagon/Global/Config.cpp
+++ b/src/SSVOpenHexagon/Global/Config.cpp
@@ -207,7 +207,7 @@ void loadConfig(const vector<string>& mOverridesIds)
{
lo("::loadConfig") << "loading config\n";
- for(const auto& p :
+ for(const ssvufs::Path& p :
getScan<ssvufs::Mode::Single, ssvufs::Type::File, ssvufs::Pick::ByExt>(
"ConfigOverrides/", ".json"))
{