mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 07:23:34 +00:00
b261e63233
* chore: Change entity and component logic to use bitstream references * merge
22 lines
648 B
C++
22 lines
648 B
C++
#include "RemoveBuffBehavior.h"
|
|
|
|
#include "BehaviorBranchContext.h"
|
|
#include "BehaviorContext.h"
|
|
#include "EntityManager.h"
|
|
#include "BuffComponent.h"
|
|
|
|
void RemoveBuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
|
auto* entity = Game::entityManager->GetEntity(context->caster);
|
|
if (!entity) return;
|
|
|
|
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
|
if (!buffComponent) return;
|
|
|
|
buffComponent->RemoveBuff(m_BuffId, false, m_RemoveImmunity);
|
|
}
|
|
|
|
void RemoveBuffBehavior::Load() {
|
|
this->m_RemoveImmunity = GetBoolean("remove_immunity");
|
|
this->m_BuffId = GetInt("buff_id");
|
|
}
|