Saving marks effect objects dead, so after a load the Heldenmut / Klingenblick buff was active but its aura effect (cObjectFX 842) was gone. A few ticks after a save game has loaded, the effect is created again for each such buff of a player hero (CreateAt + cEventFX 0x42, as the art's cast effect does), with the buff's remaining time. Shared game events (game/engine/events): engine tick and "save game loaded" callbacks; the WASD mod uses the tick through it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
57 lines
2.0 KiB
CMake
57 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.24)
|
|
project(sacred_re LANGUAGES C CXX)
|
|
|
|
# sacred.exe is a 32-bit process; everything we inject into it must be 32-bit too.
|
|
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
message(FATAL_ERROR "sacred_re must be built for 32-bit x86 (use the 'x86-*' presets / an x86 MSVC environment).")
|
|
endif()
|
|
if(NOT MSVC)
|
|
message(FATAL_ERROR "sacred_re requires MSVC (the game's C++ ABI is MSVC's).")
|
|
endif()
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
# Static CRT: no VC++ redistributable needed next to the game.
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS)
|
|
|
|
include(cmake/Detours.cmake)
|
|
include(cmake/Json.cmake)
|
|
|
|
set(SACRED_RE_CXX_FLAGS /W4 /permissive- /utf-8)
|
|
|
|
# --- sacred_re.dll: injected into sacred.exe, installs the hooks -------------
|
|
add_library(sacred_re SHARED
|
|
src/re/dllmain.cpp
|
|
src/re/hook.cpp
|
|
src/re/log.cpp
|
|
src/re/config.cpp
|
|
src/re/patch.cpp
|
|
src/re/sacred_re.def
|
|
src/game/engine/log.cpp
|
|
src/game/engine/cmdline.cpp
|
|
src/game/engine/events.cpp
|
|
src/mods/borderless.cpp
|
|
src/mods/widescreen.cpp
|
|
src/mods/hud.cpp
|
|
src/mods/wasd.cpp
|
|
src/mods/skillkeys.cpp
|
|
src/mods/input.cpp
|
|
src/mods/skillslots.cpp
|
|
src/mods/inventory_save.cpp
|
|
src/mods/skillbar.cpp
|
|
src/mods/arttarget.cpp
|
|
src/mods/aura_restore.cpp
|
|
)
|
|
target_include_directories(sacred_re PRIVATE src)
|
|
target_compile_options(sacred_re PRIVATE ${SACRED_RE_CXX_FLAGS})
|
|
target_link_libraries(sacred_re PRIVATE detours nlohmann_json::nlohmann_json)
|
|
|
|
# --- sacred_re.exe: launches sacred.exe with sacred_re.dll injected ----------
|
|
add_executable(sacred_re_launcher WIN32 src/launcher/main.cpp)
|
|
set_target_properties(sacred_re_launcher PROPERTIES OUTPUT_NAME sacred_re)
|
|
target_compile_options(sacred_re_launcher PRIVATE ${SACRED_RE_CXX_FLAGS})
|
|
target_link_libraries(sacred_re_launcher PRIVATE detours)
|
|
add_dependencies(sacred_re_launcher sacred_re)
|