Fixed bug in lua file loading

This commit is contained in:
2020-08-17 09:57:02 +02:00
parent 334fafe132
commit d3dddbde59
2 changed files with 5 additions and 3 deletions

View File

@@ -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));
}
}

View File

@@ -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