mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
The client's TacArcBehavior::DoHit (0x00fb10c0) writes the closest max-targets ids from a set, so ascending and each once, then the action data per id in that same order; DoUnserializeBS (0x00fb26a0) reads them the same way and skips empty ids. The server handled the targets in list order and skipped ids whose object it could not find without reading their action data, so every later target read the wrong bits (several pirates under a Doom Slicer). Handle now reads the action for every listed id in ascending order, and the server's own casts write ids and actions in ascending order after picking the closest targets. TacArcBehavior::Cast (0x00fb2d10): a picked target that passes the filter gets the action with no TacArc data (the server's own cast now calculates that action instead of handling it); otherwise the target is dropped, and an arc measured from the target's position writes nothing. Check in game: Doom Slicer and multi-target katanas on groups of pirates/admirals damage each of them; apes still take damage during their stun; enemies with arc attacks (apes, Maelstrom horsemen) still hit players. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.9 KiB
CMake
59 lines
1.9 KiB
CMake
set(DGAMETEST_SOURCES
|
|
"GameDependencies.cpp"
|
|
"GuildManagerTests.cpp"
|
|
"LUBitStreamTests.cpp"
|
|
"MailIdPinTests.cpp"
|
|
"EconomyLedgerTests.cpp"
|
|
"PlayerReportsLimitTests.cpp"
|
|
"SlashCommandPermissionTests.cpp"
|
|
"StaleSaveGuardTests.cpp"
|
|
"ContrabandTests.cpp"
|
|
"KnockbackTests.cpp"
|
|
"CollisionFilterTests.cpp"
|
|
"ItemSetPassiveAbilityTests.cpp"
|
|
"PowerUpStatisticTests.cpp"
|
|
"PlayerStatisticTests.cpp"
|
|
"BrickByBrickTests.cpp"
|
|
"PropertyBuildersTests.cpp"
|
|
"ModularBuildTableTests.cpp"
|
|
"ModularBuildIdMigrationTests.cpp"
|
|
"UgcManifestTests.cpp"
|
|
"SceneGhostingTests.cpp"
|
|
"HolidayEventsTests.cpp"
|
|
"SetCurrencySourceTests.cpp"
|
|
"LootDropPositionTests.cpp"
|
|
"SpiderQueenTests.cpp"
|
|
"TacArcTests.cpp"
|
|
)
|
|
|
|
add_subdirectory(dComponentsTests)
|
|
list(APPEND DGAMETEST_SOURCES ${DCOMPONENTS_TESTS})
|
|
|
|
add_subdirectory(dGameMessagesTests)
|
|
list(APPEND DGAMETEST_SOURCES ${DGAMEMESSAGES_TESTS})
|
|
|
|
add_subdirectory(dNetTests)
|
|
list(APPEND DGAMETEST_SOURCES ${DNET_TESTS})
|
|
|
|
file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
|
file(COPY ${COMPONENT_TEST_DATA} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
# Add the executable. Remember to add all tests above this!
|
|
add_executable(dGameTests ${DGAMETEST_SOURCES})
|
|
target_include_directories(dGameTests PRIVATE "." "${PROJECT_SOURCE_DIR}/dChatServer" "${PROJECT_SOURCE_DIR}/dScripts")
|
|
# Tests against the live CDClient look for it in the source tree's build folder
|
|
target_compile_definitions(dGameTests PRIVATE PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
|
|
|
|
if(APPLE)
|
|
add_custom_target(dGameTestsLink
|
|
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
add_dependencies(dGameTests dGameTestsLink)
|
|
endif()
|
|
|
|
target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main
|
|
dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dChatServer dNavigation bcrypt MD5)
|
|
|
|
# Discover the tests
|
|
gtest_discover_tests(dGameTests)
|