mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 17:55:27 +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:
@@ -40,7 +40,7 @@ protected:
|
||||
SetUpDependencies();
|
||||
CDClientDatabase::Connect(":memory:");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE ItemSets (setID INTEGER, itemIDs TEXT);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE Objects (id INTEGER, name TEXT, type TEXT);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE Objects (id INTEGER, name TEXT, type TEXT, interactionDistance REAL);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE ComponentsRegistry (id INTEGER, component_type INTEGER, component_id INTEGER);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE ObjectSkills (objectTemplate INTEGER, skillID INTEGER, castOnType INTEGER, AICombatWeight INTEGER);");
|
||||
CDClientDatabase::ExecuteDML("CREATE TABLE SkillBehavior (skillID INTEGER, behaviorID INTEGER);");
|
||||
@@ -228,7 +228,7 @@ TEST_F(LootMetricsTests, QuickbuildTakesItsCostAsTheSource) {
|
||||
auto pedestalInfo = info;
|
||||
pedestalInfo.lot = 8551;
|
||||
auto pedestal = std::make_unique<Entity>(0x0102030405060708LL, pedestalInfo);
|
||||
pedestal->SetVar<std::u16string>(u"CheckPrecondition", GeneralUtils::ASCIIToUTF16(std::to_string(PRECONDITION)));
|
||||
pedestal->SetCheckPrecondition(GeneralUtils::ASCIIToUTF16(std::to_string(PRECONDITION)));
|
||||
auto* const quickBuild = pedestal->AddComponent<QuickBuildComponent>(-1);
|
||||
quickBuild->SetResetTime(20.0f);
|
||||
quickBuild->SetCompleteTime(10.0f);
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace {
|
||||
CDClientDatabase::Connect(":memory:");
|
||||
for (const auto* table : {
|
||||
"ComponentsRegistry (id INTEGER, component_type INTEGER, component_id INTEGER)",
|
||||
"Objects (id INTEGER, name TEXT, type TEXT, interactionDistance REAL)",
|
||||
"ObjectSkills (objectTemplate INTEGER, skillID INTEGER, castOnType INTEGER, AICombatWeight INTEGER)",
|
||||
"SkillBehavior (skillID INTEGER, behaviorID INTEGER)",
|
||||
"ItemSets (setID INTEGER, itemIDs TEXT)",
|
||||
|
||||
@@ -294,6 +294,7 @@ namespace {
|
||||
CDClientDatabase::Connect(":memory:");
|
||||
for (const auto* table : {
|
||||
"ComponentsRegistry (id INTEGER, component_type INTEGER, component_id INTEGER)",
|
||||
"Objects (id INTEGER, name TEXT, type TEXT, interactionDistance REAL)",
|
||||
"BaseCombatAIComponent (id INTEGER, aggroRadius REAL, tetherSpeed REAL, pursuitSpeed REAL, softTetherRadius REAL, hardTetherRadius REAL, minRoundLength REAL, maxRoundLength REAL, combatRoundLength REAL)",
|
||||
"ItemSets (setID INTEGER, itemIDs TEXT)",
|
||||
"ObjectSkills (objectTemplate INTEGER, skillID INTEGER, castOnType INTEGER, AICombatWeight INTEGER)",
|
||||
|
||||
Reference in New Issue
Block a user