mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 14:37:25 +00:00
213c3c37b0
* Add failArmor server side Address out of bounds reading in behavior Address the basicAttackBehavior reading out of bounds memory and reading bits that didnt exist, which occasionally caused crashes and also caused the behavior to do undefined behavior due to the bad reads. Tested that attacking a wall anywhere with a projectile now does not crash the game. Tested with logs that the behavior correctly returned when there were no allocated bits or returned when other states were met. Add back logs and add fail handle Remove comment block Revert "Add back logs and add fail handle" This reverts commit db19be0906fc8bf35bf89037e2bfba39f5ef9c0c. Split out checks * Remove case 2 * Update SkillComponent.cpp
24 lines
539 B
C++
24 lines
539 B
C++
#pragma once
|
|
#include "Behavior.h"
|
|
|
|
class BasicAttackBehavior final : public Behavior
|
|
{
|
|
public:
|
|
explicit BasicAttackBehavior(const uint32_t behaviorId) : Behavior(behaviorId) {
|
|
}
|
|
|
|
void Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) override;
|
|
|
|
void Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) override;
|
|
|
|
void Load() override;
|
|
private:
|
|
uint32_t m_MinDamage;
|
|
|
|
uint32_t m_MaxDamage;
|
|
|
|
Behavior* m_OnSuccess;
|
|
|
|
Behavior* m_OnFailArmor;
|
|
};
|