Fixed scripted powerup spawners

When applied this commit fixes scripted powerups
This commit is contained in:
wincent 2022-02-05 12:27:24 +01:00
parent f0a4324bd4
commit dc2bd76aba

View File

@ -15,6 +15,11 @@ void ScriptedPowerupSpawner::OnTimerDone(Entity *self, std::string message) {
const auto itemLOT = self->GetVar<LOT>(u"lootLOT"); const auto itemLOT = self->GetVar<LOT>(u"lootLOT");
// Build drop table
std::unordered_map<LOT, int32_t> drops;
drops.emplace(itemLOT, 1);
// Spawn the required number of powerups // Spawn the required number of powerups
auto* owner = EntityManager::Instance()->GetEntity(self->GetSpawnerID()); auto* owner = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
if (owner != nullptr) { if (owner != nullptr) {
@ -24,7 +29,7 @@ void ScriptedPowerupSpawner::OnTimerDone(Entity *self, std::string message) {
renderComponent->PlayEffect(0, u"cast", "N_cast"); 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 // Increment the current cycle