Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Buffs;

namespace CJBCheatsMenu.Framework.Cheats.PlayerAndTools;

/// <summary>A cheat which increases the player movement speed.</summary>
Expand Down Expand Up @@ -66,6 +66,9 @@ public override void OnUpdated(CheatContext context, UpdateTickedEventArgs e)
// add or extend buff
if (!Game1.player.buffs.AppliedBuffs.TryGetValue(MoveSpeedCheat.BuffId, out Buff? buff) || buff.millisecondsDuration <= MoveSpeedCheat.BuffMinDurationBeforeRenew)
{
// FIX: Xóa sạch buff cũ trước khi nạp buff mới để tránh lỗi cộng dồn (stacking) hiệu ứng của Stardew Valley 1.6
Game1.player.buffs.Remove(MoveSpeedCheat.BuffId);

Game1.player.applyBuff(
new Buff(
id: MoveSpeedCheat.BuffId,
Expand Down