From 0fff81be48806b710aa187ae64376de1ec6cc11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Julian-Steffen=20M=C3=BCller?= Date: Mon, 17 Aug 2020 09:57:02 +0200 Subject: [PATCH] Fixed bug in lua file loading --- src/Service.cpp | 6 ++++-- src/Version.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Service.cpp b/src/Service.cpp index 9bef47f..cbe513f 100644 --- a/src/Service.cpp +++ b/src/Service.cpp @@ -76,6 +76,8 @@ LuaService::LuaService(LuaService&& service) noexcept { lua = service.lua; service.lua = nullptr; name = std::move(service.name); + loaded = false; + started = false; } LuaService& LuaService::operator=(LuaService&& service) noexcept { @@ -88,9 +90,9 @@ LuaService& LuaService::operator=(LuaService&& service) noexcept { void LuaService::load() { if (!loaded) { - if (lua_pcall(lua, 0, 0 ,0) != 0) { + if (lua_pcall(lua, 0, 0 ,0) == 0) { loaded = true; - + }else{ spdlog::error("[{}] Unable to call 'lua_pcall()' in load(). [Lua: '{}']", name, lua_tostring(lua,-1)); } } diff --git a/src/Version.h b/src/Version.h index ed41a91..eea9ec8 100644 --- a/src/Version.h +++ b/src/Version.h @@ -3,6 +3,6 @@ #define THRAWN_MAJOR_VERSION 1 #define THRAWN_MINOR_VERSION 0 -#define THRAWN_PATCH_VERSION 3 +#define THRAWN_PATCH_VERSION 4 #endif // VERSION_H