From eeb91fa6df7159772e97b13da90462d45f409177 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 12:55:26 -0500 Subject: [PATCH] test(loot): a luz spawner path's smashable_loot_matrix reaches the entity Live GF Large Crates (LOT 1859, path CrateMast) and FV small white shrines (LOT 3141, path gate_statue_quickbuild) dropped 1-point powerups outside their template matrices, from the path's smashable_loot_matrix=1:29 with smashable_loot_matrix_set=7:1. DLU already carries a spawner path's waypoint config into the spawned entity's settings; this pins it. Co-Authored-By: Claude Opus 5.5 --- .../DestroyableLevelConfigTests.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/dGameTests/dComponentsTests/DestroyableLevelConfigTests.cpp b/tests/dGameTests/dComponentsTests/DestroyableLevelConfigTests.cpp index 7d19b5ff1..fdb2dbc5c 100644 --- a/tests/dGameTests/dComponentsTests/DestroyableLevelConfigTests.cpp +++ b/tests/dGameTests/dComponentsTests/DestroyableLevelConfigTests.cpp @@ -68,6 +68,20 @@ TEST_F(DestroyableLevelConfigTests, LootMatrixWithTheSetKeyFalseIsIgnored) { EXPECT_FALSE(DestroyableComponent::GetLevelLootMatrix(*entity)); } +// A luz spawner path's waypoint config reaches the spawned entity: the waypoint's name/value pairs are parsed as +// "name=value" into the spawner node's config, which a spawner copies into the entity's settings. The GF Large Crate +// (LOT 1859, path CrateMast) and the FV small white shrine (LOT 3141, path gate_statue_quickbuild) set matrix 29. +TEST_F(DestroyableLevelConfigTests, SpawnerPathLootMatrixReachesTheEntity) { + LwoNameValue waypointConfig; + waypointConfig.ParseInsert(std::string("smashable_loot_matrix") + "=" + "1:29"); + waypointConfig.ParseInsert(std::string("smashable_loot_matrix_set") + "=" + "7:1"); + + EntityInfo spawnedInfo = info; + spawnedInfo.settings = waypointConfig; + const Entity spawned(2, spawnedInfo); + EXPECT_EQ(DestroyableComponent::GetLevelLootMatrix(spawned), 29); +} + TEST_F(DestroyableLevelConfigTests, LootMatrixMinusOneIsIgnored) { entity->SetVar(u"smashable_loot_matrix", -1); EXPECT_FALSE(DestroyableComponent::GetLevelLootMatrix(*entity));