Some fixes to LUA so that it complies

This commit is contained in:
wincent
2023-06-17 20:52:15 +02:00
parent ba5153c0d4
commit 958ced24f3
11 changed files with 633 additions and 551 deletions

View File

@@ -60,20 +60,25 @@ foreach(file ${DSCRIPTS_SOURCES})
set(DGAME_SOURCES ${DGAME_SOURCES} "${PROJECT_SOURCE_DIR}/dScripts/${file}")
endforeach()
set(DGAME_LIBRARIES dDatabase)
# If we are including LUA, include the dLua files in dGame
if(__include_lua__)
# Append the dLua files to the dGame files
set(DGAME_SOURCES ${DGAME_SOURCES} ${DGAME_DLUA})
foreach(file ${DGAME_DLUA_SOURCES})
set(DGAME_SOURCES ${DGAME_SOURCES} "${PROJECT_SOURCE_DIR}/dLua/${file}")
endforeach()
find_package(Lua REQUIRED)
set(DGAME_LIBRARIES ${DGAME_LIBRARIES} ${LUA_LIBRARIES})
add_library(dGame STATIC ${DGAME_SOURCES})
target_link_libraries(dGame dDatabase Recast Detour ${LUA_LIBRARIES})
include_directories("${PROJECT_SOURCE_DIR}/dLua/")
message(STATUS "Linking dGame to LUA " ${LUA_LIBRARIES})
else()
add_library(dGame STATIC ${DGAME_SOURCES})
target_link_libraries(dGame dDatabase Recast Detour)
endif()
add_library(dGame STATIC ${DGAME_SOURCES})
target_link_libraries(dGame dDatabase Recast Detour)

View File

@@ -262,6 +262,8 @@ void RebuildComponent::SpawnActivator() {
info.spawnerID = m_Parent->GetObjectID();
info.pos = m_ActivatorPosition == NiPoint3::ZERO ? m_Parent->GetPosition() : m_ActivatorPosition;
Game::logger->Log("RebuildComponent", "Spawning activator at <%f, %f, %f>", info.pos.x, info.pos.y, info.pos.z);
m_Activator = EntityManager::Instance()->CreateEntity(info, nullptr, m_Parent);
if (m_Activator) {
m_ActivatorId = m_Activator->GetObjectID();

View File

@@ -632,7 +632,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
#if __include_lua__ == 1
if (chatCommand == "lua" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
if (chatCommand == "lua" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
std::string input = "";
// If the first argument is "load", load the file