mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-24 04:40:05 +00:00
Add overload to remove specific class of buff
I initially added this because, despite the higher tickrate for composite condition calculations thanks to the last commit, there is still a slight status icon delay when rapidly switching nanos. I attempted to use this to make that problem go away and for whatever reason it wasn't effective, but I figure it would be useful to have anyway so I'm keeping it.
This commit is contained in:
@@ -48,6 +48,16 @@ void Player::removeBuff(int buffId) {
|
||||
}
|
||||
}
|
||||
|
||||
void Player::removeBuff(int buffId, int buffClass) {
|
||||
if(hasBuff(buffId)) {
|
||||
buffs[buffId]->clear((BuffClass)buffClass);
|
||||
if(buffs[buffId]->isStale()) {
|
||||
delete buffs[buffId];
|
||||
buffs.erase(buffId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::hasBuff(int buffId) {
|
||||
auto buff = buffs.find(buffId);
|
||||
return buff != buffs.end() && !buff->second->isStale();
|
||||
@@ -161,6 +171,8 @@ Buff* CombatNPC::getBuff(int buffId) { /* stubbed */
|
||||
|
||||
void CombatNPC::removeBuff(int buffId) { /* stubbed */ }
|
||||
|
||||
void CombatNPC::removeBuff(int buffId, int buffClass) { /* stubbed */ }
|
||||
|
||||
bool CombatNPC::hasBuff(int buffId) { /* stubbed */
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user