From 433b63d976bd6064afcd281246593053611062dd Mon Sep 17 00:00:00 2001 From: sven-n Date: Fri, 20 Oct 2023 17:00:40 +0200 Subject: [PATCH] Prevent adding points during mini game --- .../PlayerActions/Character/IncreaseStatsAction.cs | 5 ++--- .../PlugIns/ChatCommands/AddStatChatCommandPlugIn.cs | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/GameLogic/PlayerActions/Character/IncreaseStatsAction.cs b/src/GameLogic/PlayerActions/Character/IncreaseStatsAction.cs index c137acfbf..58a98da73 100644 --- a/src/GameLogic/PlayerActions/Character/IncreaseStatsAction.cs +++ b/src/GameLogic/PlayerActions/Character/IncreaseStatsAction.cs @@ -69,12 +69,11 @@ private async ValueTask IncreaseStatsByMultiplePointsAsync(Player player, ushort X1 = player.Position.X, X2 = player.Position.X, Y1 = player.Position.Y, - Y2 = player.Position.Y + Y2 = player.Position.Y, }; await player.WarpToAsync(currentGate).ConfigureAwait(false); - - + return; } diff --git a/src/GameLogic/PlugIns/ChatCommands/AddStatChatCommandPlugIn.cs b/src/GameLogic/PlugIns/ChatCommands/AddStatChatCommandPlugIn.cs index 08af776c3..947d6c23d 100644 --- a/src/GameLogic/PlugIns/ChatCommands/AddStatChatCommandPlugIn.cs +++ b/src/GameLogic/PlugIns/ChatCommands/AddStatChatCommandPlugIn.cs @@ -49,6 +49,12 @@ public async ValueTask HandleCommandAsync(Player player, string command) return; } + if (player.CurrentMiniGame is not null) + { + await player.ShowMessageAsync("Adding multiple points is not allowed when playing a mini game.").ConfigureAwait(false); + return; + } + await this._action.IncreaseStatsAsync(player, attribute, arguments.Amount).ConfigureAwait(false); } catch (ArgumentException e)