mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 07:02:54 +08:00
Make PlayerBuffManager::removeBuff actually remove buff
This commit is contained in:
parent
1ceda2a455
commit
65915b7666
@ -130,9 +130,7 @@ public class PlayerBuffManager extends BasePlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clear previous buff if it exists
|
// Clear previous buff if it exists
|
||||||
if (this.hasBuff(buffData.getGroupId())) {
|
|
||||||
this.removeBuff(buffData.getGroupId());
|
this.removeBuff(buffData.getGroupId());
|
||||||
}
|
|
||||||
|
|
||||||
// Create and store buff
|
// Create and store buff
|
||||||
PlayerBuff buff = new PlayerBuff(getNextBuffUid(), buffData, duration);
|
PlayerBuff buff = new PlayerBuff(getNextBuffUid(), buffData, duration);
|
||||||
@ -150,7 +148,7 @@ public class PlayerBuffManager extends BasePlayerManager {
|
|||||||
* @return True if a buff was remove
|
* @return True if a buff was remove
|
||||||
*/
|
*/
|
||||||
public synchronized boolean removeBuff(int buffGroupId) {
|
public synchronized boolean removeBuff(int buffGroupId) {
|
||||||
PlayerBuff buff = this.buffs.get(buffGroupId);
|
PlayerBuff buff = this.buffs.remove(buffGroupId);
|
||||||
|
|
||||||
if (buff != null) {
|
if (buff != null) {
|
||||||
getPlayer().sendPacket(
|
getPlayer().sendPacket(
|
||||||
|
Loading…
Reference in New Issue
Block a user