#include "VeBricksampleServer.h" #include "InventoryComponent.h" #include "EntityManager.h" #include "MissionComponent.h" #include "GameMessages.h" #include "eMissionState.h" void VeBricksampleServer::OnUse(Entity* self, Entity* user) { auto missionComponent = user->GetComponent(); if (missionComponent != nullptr && missionComponent->GetMissionState(1183) == eMissionState::ACTIVE) { const auto loot = self->GetVar(m_LootVariable); auto inventoryComponent = user->GetComponent(); if (loot && inventoryComponent != nullptr && inventoryComponent->GetLotCount(loot) == 0) { inventoryComponent->AddItem(loot, 1, eLootSourceType::ACTIVITY); for (auto* brickEntity : EntityManager::Instance()->GetEntitiesInGroup("Bricks")) { GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup"); } } } }