Browse Source

fix: 🚑 fix the bug about rescue and treat when in the same Position

tags/v0.1.0
shangfengh 2 years ago
parent
commit
d5102a4355
3 changed files with 9 additions and 9 deletions
  1. +5
    -2
      docs/版本更新说明.md
  2. +4
    -6
      logic/GameClass/GameObj/Map/Map.cs
  3. +0
    -1
      logic/Preparation/Utility/GameData.cs

+ 5
- 2
docs/版本更新说明.md View File

@@ -94,6 +94,9 @@
# 5月26日14:00更新
- improve:优化CD逻辑

# 5月26日更新
# 5月26日19:00更新
- docs:指令执行失败可能会使你返回idle状态,而非简单的无效
- docs:删除了“实际上唤醒或勉励不同的人是有效的”
- docs:删除了“实际上唤醒或勉励不同的人是有效的”

# 5月26日更新
- fix:修复了坐标相同导致无法唤醒和勉励的问题

+ 4
- 6
logic/GameClass/GameObj/Map/Map.cs View File

@@ -250,18 +250,16 @@ namespace GameClass.GameObj
}
return GameObjForInteract;
}
public Student? StudentForInteract(XY Pos)
public Student? StudentForInteract(XY Pos, Student AStudent)
{
Student? GameObjForInteract = null;
GameObjLockDict[GameObjType.Character].EnterReadLock();
try
{
foreach (Character character in GameObjDict[GameObjType.Character])
{
if (!character.IsGhost() && GameData.ApproachToInteract(character.Position, Pos))
if (!character.IsGhost() && character != AStudent && GameData.ApproachToInteract(character.Position, Pos))
{
GameObjForInteract = (Student)character;
break;
return (Student)character;
}
}
}
@@ -269,7 +267,7 @@ namespace GameClass.GameObj
{
GameObjLockDict[GameObjType.Character].ExitReadLock();
}
return GameObjForInteract;
return null;
}
public GameObj? OneInTheSameCell(XY Pos, GameObjType gameObjType)
{


+ 0
- 1
logic/Preparation/Utility/GameData.cs View File

@@ -78,7 +78,6 @@ namespace Preparation.Utility
}
public static bool ApproachToInteract(XY pos1, XY pos2)
{
if (pos1 == pos2) return false;
return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1;
}
public static bool ApproachToInteractInACross(XY pos1, XY pos2)


Loading…
Cancel
Save