mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 17:54:01 +00:00
Added config setting
Added a config setting to allow players to disable pets consuming imagination. This value defaults to zero as a feature of DLU.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "dZoneManager.h"
|
||||
#include "PropertyManagementComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "dConfig.h"
|
||||
|
||||
InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* document) : Component(parent)
|
||||
{
|
||||
@@ -1354,7 +1355,7 @@ void InventoryComponent::SpawnPet(Item* item)
|
||||
// First check if we can summon the pet. You need 1 imagination to do so.
|
||||
auto destroyableComponent = m_Parent->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent && destroyableComponent->GetImagination() <= 0) {
|
||||
if (Game::config->GetValue("pets_imagination") == "1" && destroyableComponent && destroyableComponent->GetImagination() <= 0) {
|
||||
GameMessages::SendUseItemRequirementsResponse(m_Parent->GetObjectID(), m_Parent->GetSystemAddress(), UseItemResponse::NoImaginationForPet);
|
||||
return;
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "../dWorldServer/ObjectIDManager.h"
|
||||
|
||||
#include "Game.h"
|
||||
#include "dConfig.h"
|
||||
#include "dChatFilter.h"
|
||||
#include "Database.h"
|
||||
|
||||
@@ -985,6 +986,8 @@ void PetComponent::Activate(Item* item, bool registerPet)
|
||||
}
|
||||
|
||||
void PetComponent::AddDrainImaginationTimer(Item* item) {
|
||||
if (Game::config->GetValue("pets_imagination") == "0") return;
|
||||
|
||||
auto playerInventory = item->GetInventory();
|
||||
if (!playerInventory) return;
|
||||
|
||||
|
Reference in New Issue
Block a user