mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 23:43:34 +00:00
aba349301f
Resolves #224
16 lines
535 B
C++
16 lines
535 B
C++
#include "AmTeapotServer.h"
|
|
#include "InventoryComponent.h"
|
|
#include "GameMessages.h"
|
|
|
|
|
|
void AmTeapotServer::OnUse(Entity* self, Entity* user) {
|
|
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
|
if (!inventoryComponent) return;
|
|
|
|
if (inventoryComponent->GetLotCount(BLUE_FLOWER_LEAVES) >= 10){
|
|
inventoryComponent->RemoveItem(BLUE_FLOWER_LEAVES, 10);
|
|
inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1);
|
|
}
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
|
}
|