From 65915b7666ac7fb9fd4d0c6eaab24c2cec158173 Mon Sep 17 00:00:00 2001 From: AnimeGitB Date: Sat, 5 Nov 2022 17:26:20 +1030 Subject: [PATCH] Make PlayerBuffManager::removeBuff actually remove buff --- .../java/emu/grasscutter/game/player/PlayerBuffManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java b/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java index 73ae4ab78..3052ee4cd 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java @@ -130,9 +130,7 @@ public class PlayerBuffManager extends BasePlayerManager { } // Clear previous buff if it exists - if (this.hasBuff(buffData.getGroupId())) { - this.removeBuff(buffData.getGroupId()); - } + this.removeBuff(buffData.getGroupId()); // Create and store buff PlayerBuff buff = new PlayerBuff(getNextBuffUid(), buffData, duration); @@ -150,7 +148,7 @@ public class PlayerBuffManager extends BasePlayerManager { * @return True if a buff was remove */ public synchronized boolean removeBuff(int buffGroupId) { - PlayerBuff buff = this.buffs.get(buffGroupId); + PlayerBuff buff = this.buffs.remove(buffGroupId); if (buff != null) { getPlayer().sendPacket(