mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-18 18:50:58 +00:00
Rework buff callbacks
The first implementation was way too complicated and prone to bugs. This is much more simple flexible; first off, std::function is now used instead of a raw function pointer, so lambdas and binds are fair game which is great for scripting. Second, callbacks for all stacks are executed. It is up to the callback target to ensure correct behavior.
This commit is contained in:
@@ -90,7 +90,7 @@ struct Player : public Entity, public ICombatant {
|
||||
virtual void disappearFromViewOf(CNSocket *sock) override;
|
||||
|
||||
virtual void addBuff(BuffStack* buff) override;
|
||||
virtual BuffStack* getBuff(int buffId) override;
|
||||
virtual Buff* getBuff(int buffId) override;
|
||||
virtual void removeBuff(int buffId) override;
|
||||
virtual bool hasBuff(int buffId) override;
|
||||
virtual int getCompositeCondition() override;
|
||||
|
||||
Reference in New Issue
Block a user