Escorts lost their place on the hero's follower list after a load, so quest checks like the one in "Furchtbares Verbrechen" failed; they are added back once after loading (town NPCs that tag along briefly are left out). Restarted quests stay available (flag 1), which their giver's dialog and accepting them need. Quest givers are read from the quest scripts: when a running quest's giver dies, the quest restarts and the giver is spawned again at her start; an accepted quest without its giver is repaired on load. Notes on the script format and opcodes in docs/quests.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
98 lines
3.0 KiB
CMake
98 lines
3.0 KiB
CMake
cmake_minimum_required(VERSION 3.24)
|
|
project(sacredK 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 "sacredK must be built for 32-bit x86 (use the 'x86-*' presets / an x86 MSVC environment).")
|
|
endif()
|
|
if(NOT MSVC)
|
|
message(FATAL_ERROR "sacredK 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(SACREDK_CXX_FLAGS /W4 /permissive- /utf-8)
|
|
|
|
# --- sacredK.dll: injected into sacred.exe, installs the hooks -------------
|
|
add_library(sacredK SHARED
|
|
src/re/dllmain.cpp
|
|
src/re/hook.cpp
|
|
src/re/log.cpp
|
|
src/re/config.cpp
|
|
src/re/patch.cpp
|
|
src/re/crash.cpp
|
|
src/re/sacredK.def
|
|
src/game/engine/log.cpp
|
|
src/game/engine/cmdline.cpp
|
|
src/game/engine/events.cpp
|
|
src/game/engine/fx.cpp
|
|
src/game/engine/orders.cpp
|
|
src/game/engine/items.cpp
|
|
src/game/engine/stream.cpp
|
|
src/game/ui/texts.cpp
|
|
src/game/engine/art.cpp
|
|
src/mods/monitor.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/potioncounts.cpp
|
|
src/mods/itemstack.cpp
|
|
src/mods/sharedchest.cpp
|
|
src/mods/skillbar.cpp
|
|
src/mods/arttarget.cpp
|
|
src/mods/aura_restore.cpp
|
|
src/mods/autoattack.cpp
|
|
src/mods/aurarecast.cpp
|
|
src/mods/artregen.cpp
|
|
src/mods/combos.cpp
|
|
src/mods/aurahits.cpp
|
|
src/mods/chainlightning.cpp
|
|
src/mods/dwarfarts.cpp
|
|
src/mods/arttooltip.cpp
|
|
src/mods/escape.cpp
|
|
src/mods/recordcache.cpp
|
|
src/mods/megamap.cpp
|
|
src/mods/respec.cpp
|
|
src/mods/runetrade.cpp
|
|
src/mods/teleportpotion.cpp
|
|
src/mods/guards.cpp
|
|
src/mods/options.cpp
|
|
src/mods/lootfilter.cpp
|
|
src/mods/userfolders.cpp
|
|
src/mods/charfile.cpp
|
|
src/mods/screen.cpp
|
|
src/mods/characters.cpp
|
|
src/mods/mainmenu.cpp
|
|
src/mods/mapreveal.cpp
|
|
src/mods/questbook.cpp
|
|
src/mods/followers.cpp
|
|
src/mods/questfail.cpp
|
|
src/mods/questgiver.cpp
|
|
src/mods/questnpc.cpp
|
|
src/mods/anticheat.cpp
|
|
src/mods/loadingscreen.cpp
|
|
)
|
|
target_include_directories(sacredK PRIVATE src)
|
|
target_compile_options(sacredK PRIVATE ${SACREDK_CXX_FLAGS})
|
|
target_link_libraries(sacredK PRIVATE detours nlohmann_json::nlohmann_json dbghelp)
|
|
|
|
# --- sacredK.exe: launches sacred.exe with sacredK.dll injected ----------
|
|
add_executable(sacredK_launcher WIN32 src/launcher/main.cpp)
|
|
set_target_properties(sacredK_launcher PROPERTIES OUTPUT_NAME sacredK)
|
|
target_compile_options(sacredK_launcher PRIVATE ${SACREDK_CXX_FLAGS})
|
|
target_link_libraries(sacredK_launcher PRIVATE detours)
|
|
add_dependencies(sacredK_launcher sacredK)
|