fix: powerup drops and hardcore loot drops (#1914)

tested the following are now functional
ag buff station
tiki torch
ve rocket part boxes
ns statue
property behavior
extra items from full inventory
hardcore drops (items and coins)
This commit is contained in:
David Markowitz
2025-10-16 12:13:38 -07:00
committed by GitHub
parent ec6253c80c
commit 4c9c773ec5
10 changed files with 86 additions and 58 deletions

View File

@@ -7,6 +7,7 @@
#include "eReplicaComponentType.h"
#include "RenderComponent.h"
#include "eTerminateType.h"
#include "Loot.h"
void GfTikiTorch::OnStartup(Entity* self) {
LightTorch(self);
@@ -22,7 +23,14 @@ void GfTikiTorch::OnUse(Entity* self, Entity* killer) {
self->SetI64(u"userID", killer->GetObjectID());
for (int i = 0; i < m_numspawn; i++) {
GameMessages::SendDropClientLoot(killer, self->GetObjectID(), 935, 0, self->GetPosition());
GameMessages::DropClientLoot lootMsg{};
lootMsg.target = killer->GetObjectID();
lootMsg.ownerID = killer->GetObjectID();
lootMsg.sourceID = self->GetObjectID();
lootMsg.item = 935;
lootMsg.count = 1;
lootMsg.spawnPos = self->GetPosition();
Loot::DropItem(*killer, lootMsg);
}
self->AddTimer("InteractionCooldown", 4);

View File

@@ -4,6 +4,7 @@
#include "GameMessages.h"
#include "SkillComponent.h"
#include "TeamManager.h"
#include "Loot.h"
void AgSurvivalBuffStation::OnQuickBuildComplete(Entity* self, Entity* target) {
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
@@ -55,7 +56,14 @@ void AgSurvivalBuffStation::OnTimerDone(Entity* self, std::string timerName) {
for (auto memberID : team) {
auto member = Game::entityManager->GetEntity(memberID);
if (member != nullptr && !member->GetIsDead()) {
GameMessages::SendDropClientLoot(member, self->GetObjectID(), powerupToDrop, 0, self->GetPosition());
GameMessages::DropClientLoot lootMsg{};
lootMsg.target = member->GetObjectID();
lootMsg.ownerID = member->GetObjectID();
lootMsg.sourceID = self->GetObjectID();
lootMsg.item = powerupToDrop;
lootMsg.count = 1;
lootMsg.spawnPos = self->GetPosition();
Loot::DropItem(*member, lootMsg, true, true);
}
}
}