Fixed bug in lua file loading
This commit is contained in:
@@ -76,6 +76,8 @@ LuaService::LuaService(LuaService&& service) noexcept {
|
|||||||
lua = service.lua;
|
lua = service.lua;
|
||||||
service.lua = nullptr;
|
service.lua = nullptr;
|
||||||
name = std::move(service.name);
|
name = std::move(service.name);
|
||||||
|
loaded = false;
|
||||||
|
started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LuaService& LuaService::operator=(LuaService&& service) noexcept {
|
LuaService& LuaService::operator=(LuaService&& service) noexcept {
|
||||||
@@ -88,9 +90,9 @@ LuaService& LuaService::operator=(LuaService&& service) noexcept {
|
|||||||
|
|
||||||
void LuaService::load() {
|
void LuaService::load() {
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
if (lua_pcall(lua, 0, 0 ,0) != 0) {
|
if (lua_pcall(lua, 0, 0 ,0) == 0) {
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
}else{
|
||||||
spdlog::error("[{}] Unable to call 'lua_pcall()' in load(). [Lua: '{}']", name, lua_tostring(lua,-1));
|
spdlog::error("[{}] Unable to call 'lua_pcall()' in load(). [Lua: '{}']", name, lua_tostring(lua,-1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#define THRAWN_MAJOR_VERSION 1
|
#define THRAWN_MAJOR_VERSION 1
|
||||||
#define THRAWN_MINOR_VERSION 0
|
#define THRAWN_MINOR_VERSION 0
|
||||||
#define THRAWN_PATCH_VERSION 3
|
#define THRAWN_PATCH_VERSION 4
|
||||||
|
|
||||||
#endif // VERSION_H
|
#endif // VERSION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user