mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 09:45:28 +00:00
feat(entity): the object's interaction distance, preconditions and world state, as the client
LWOGameObject loads these itself: interactionDistance from its Objects row (16 without one) and the level's interaction_distance over it, CheckPrecondition and objectWorldState from the level config, before its components load theirs. The quickbuild, the pet and the race instancer read them from the object; the race instancer now uses the Objects row's distance like the client does, instead of a fixed 16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -105,6 +105,7 @@ TEST_F(ClientMessagesTests, CasterDeadMatchesLiveCapture) {
|
||||
TEST_F(ClientMessagesTests, CasterDeadEndsTheDeadCastersSkill) {
|
||||
CDClientDatabase::Connect(":memory:"); // the entity manager looks the new entity up
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE ComponentsRegistry (id INTEGER, component_type INTEGER, component_id INTEGER);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE Objects (id INTEGER, name TEXT, type TEXT, interactionDistance REAL);");
|
||||
auto* const caster = Game::entityManager->CreateEntity(info, nullptr, nullptr, false, 0x40040000000bdb5LL);
|
||||
ASSERT_NE(caster, nullptr);
|
||||
auto* const destroyable = caster->AddComponent<DestroyableComponent>(-1);
|
||||
@@ -130,6 +131,7 @@ TEST_F(ClientMessagesTests, ResyncEquipmentResendsTheEquipment) {
|
||||
auto msg = FromLiveClientCapture<GameMessages::ResyncEquipment>(std::string(PLAYER_HEADER) + "d604");
|
||||
CDClientDatabase::Connect(":memory:"); // the inventory looks its component up
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE ComponentsRegistry (id INTEGER, component_type INTEGER, component_id INTEGER);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE Objects (id INTEGER, name TEXT, type TEXT, interactionDistance REAL);");
|
||||
auto* const inventory = player->AddComponent<InventoryComponent>(-1);
|
||||
RakNet::BitStream first;
|
||||
inventory->Serialize(first, false); // clears the dirty flag it starts with
|
||||
|
||||
Reference in New Issue
Block a user