From 04858534baf2f6da63f31787b04d41df01a3f828 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Fri, 5 Jul 2024 22:56:24 +0800 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=20the=20player=20did?= =?UTF-8?q?=20not=20select=20the=20first=20item=20slot,=20but=20the=20item?= =?UTF-8?q?=20in=20their=20hand=20would=20become=20the=20item=20they=20jus?= =?UTF-8?q?t=20picked=20up.=20=E8=A7=A3=E5=86=B3=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=E4=B8=8D=E6=98=AF=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=89=A9=E5=93=81=E6=A7=BD=EF=BC=8C=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=89=8B=E4=B8=AD=E6=8C=81=E6=9C=89=E7=9A=84=E7=89=A9=E5=93=81?= =?UTF-8?q?=E4=BC=9A=E5=8F=98=E6=88=90=E5=88=9A=E5=88=9A=E6=8D=A1=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E7=89=A9=E5=93=81=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/character/CharacterTemplate.cs | 3 ++- scripts/character/Player.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/character/CharacterTemplate.cs b/scripts/character/CharacterTemplate.cs index dba931d..573fff6 100644 --- a/scripts/character/CharacterTemplate.cs +++ b/scripts/character/CharacterTemplate.cs @@ -340,7 +340,8 @@ public partial class CharacterTemplate : CharacterBody2D pickAbleTemplate.Sleeping = true; } - if (_currentItem == null) + + if (_currentItem == null && selectItemSlotNode.GetItem() == item) { //If the selected item slot in the item container is a newly picked item, and there is no item in the hand, then we put the selected item into the hand. //如果物品容器内选中的物品槽是刚刚捡到的物品,且手里没有物品持有,那么我们将选中的物品放到手上。 diff --git a/scripts/character/Player.cs b/scripts/character/Player.cs index bceef92..6e0068d 100644 --- a/scripts/character/Player.cs +++ b/scripts/character/Player.cs @@ -294,7 +294,7 @@ public partial class Player : CharacterTemplate if (_parabola != null) { - _parabola.Points = new[] { Vector2.Zero }; + _parabola.Points = [Vector2.Zero]; } ThrowItem(ItemContainer.GetSelectIndex(), 1, GetThrowVelocity());