From 76d31871996bbe24d402be54964b598982937297 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 18 Nov 2023 20:20:58 -0600 Subject: [PATCH] actually check if the player can afford to dig --- dScripts/02_server/Map/General/PetDigServer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dScripts/02_server/Map/General/PetDigServer.cpp b/dScripts/02_server/Map/General/PetDigServer.cpp index 3aa62fce..bb057627 100644 --- a/dScripts/02_server/Map/General/PetDigServer.cpp +++ b/dScripts/02_server/Map/General/PetDigServer.cpp @@ -109,12 +109,14 @@ void PetDigServer::OnUse(Entity* self, Entity* user) { if (!petComponent) return; if(petComponent->GetIsReadyToDig()) { // TODO: Add handling of the "first time" dig message - petComponent->SetTreasureTime(2.0f); - auto* destroyableComponent = user->GetComponent(); if (!destroyableComponent) return; auto imagination = destroyableComponent->GetImagination(); + if (imagination == 0) return; // TODO: Check if there was special behavior for this in the live game + + petComponent->SetTreasureTime(2.0f); // TODO: Get rid of this magic number + imagination -= 1; // TODO: Get rid of this magic number destroyableComponent->SetImagination(imagination); Game::entityManager->SerializeEntity(user);