mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-28 00:17:23 +00:00
fix
This commit is contained in:
parent
9e530b91d6
commit
8f9df9178a
@ -16,8 +16,11 @@ void ApplyBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitS
|
||||
|
||||
if (buffComponent == nullptr) return;
|
||||
|
||||
buffComponent->ApplyBuff(m_BuffId, m_Duration, context->originator, m_AddImmunity, m_ApplyOnTeammates m_CancelOnDamaged, m_CancelOnDeath,
|
||||
m_CancelOnLogout, m_CancelOnRemoveBuff, m_CancelOnUi, m_CancelOnUnequip, m_CancelOnZone, m_CancelOnDamageAbsDone, m_UseRefCount);
|
||||
buffComponent->ApplyBuff(m_BuffId, m_Duration, context->originator,
|
||||
m_AddImmunity, m_ApplyOnTeammates,
|
||||
m_CancelOnDamaged, m_CancelOnDeath, m_CancelOnLogout, m_CancelOnRemoveBuff,
|
||||
m_CancelOnUi, m_CancelOnUnequip, m_CancelOnZone, m_CancelOnDamageAbsDone,
|
||||
m_UseRefCount);
|
||||
}
|
||||
|
||||
void ApplyBuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch) {
|
||||
|
@ -90,13 +90,6 @@ void BuffComponent::ApplyBuff(const int32_t id, const float duration, const LWOO
|
||||
bool cancelOnDamaged, bool cancelOnDeath, bool cancelOnLogout, bool cancelOnRemoveBuff,
|
||||
bool cancelOnUi, bool cancelOnUnequip, bool cancelOnZone, bool cancelOnDamageAbsDone,
|
||||
bool useRefCount) {
|
||||
// Prevent buffs from stacking.
|
||||
|
||||
if (HasBuff(id)) {
|
||||
if (useRefCount){
|
||||
auto buff = m_Buffs.find(id);
|
||||
} else return;
|
||||
}
|
||||
|
||||
GameMessages::SendAddBuff(const_cast<LWOOBJID&>(m_Parent->GetObjectID()), source, (uint32_t)id,
|
||||
(uint32_t)duration * 1000, addImmunity, applyOnTeammates, cancelOnDamaged, cancelOnDeath,
|
||||
@ -139,6 +132,7 @@ void BuffComponent::ApplyBuff(const int32_t id, const float duration, const LWOO
|
||||
buff.cancelOnZone = cancelOnZone;
|
||||
buff.useRefCount = useRefCount;
|
||||
buff.refcount = 1;
|
||||
|
||||
m_Buffs.emplace(id, buff);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct Buff
|
||||
bool cancelOnZone = false;
|
||||
bool useRefCount = false;
|
||||
|
||||
uint32_t refcount = 1
|
||||
uint32_t refcount = 1;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user