From dc2bd76abae758bdf31a1e0262e44f219b901d59 Mon Sep 17 00:00:00 2001 From: wincent Date: Sat, 5 Feb 2022 12:27:24 +0100 Subject: [PATCH] Fixed scripted powerup spawners When applied this commit fixes scripted powerups --- dScripts/ScriptedPowerupSpawner.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dScripts/ScriptedPowerupSpawner.cpp b/dScripts/ScriptedPowerupSpawner.cpp index 5fc013c1..fe35dfed 100644 --- a/dScripts/ScriptedPowerupSpawner.cpp +++ b/dScripts/ScriptedPowerupSpawner.cpp @@ -15,6 +15,11 @@ void ScriptedPowerupSpawner::OnTimerDone(Entity *self, std::string message) { const auto itemLOT = self->GetVar(u"lootLOT"); + // Build drop table + std::unordered_map drops; + + drops.emplace(itemLOT, 1); + // Spawn the required number of powerups auto* owner = EntityManager::Instance()->GetEntity(self->GetSpawnerID()); if (owner != nullptr) { @@ -24,7 +29,7 @@ void ScriptedPowerupSpawner::OnTimerDone(Entity *self, std::string message) { renderComponent->PlayEffect(0, u"cast", "N_cast"); } - LootGenerator::Instance().DropLoot(owner, self, itemLOT, 0, 1); + LootGenerator::Instance().DropLoot(owner, self, drops, 0, 0); } // Increment the current cycle