From 64d4c3236f302cd5e692b4eb42bf1d27c2d1b887 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Thu, 25 May 2023 21:08:03 +0800 Subject: [PATCH] fix: :ambulance: fix the bug about Graduating --- docs/版本更新说明.md | 10 ++++++++-- logic/GameClass/GameObj/Map/Map.cs | 10 +++++----- logic/Gaming/ActionManager.cs | 7 ++++++- logic/Preparation/Utility/GameData.cs | 4 ++++ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/版本更新说明.md b/docs/版本更新说明.md index 798a98d..96d7874 100644 --- a/docs/版本更新说明.md +++ b/docs/版本更新说明.md @@ -70,9 +70,15 @@ # 5月22日11:00更新 - fix:修复了开校门的bug -# 5月25日21:00更新 +# 5月25日20:00更新 - fix:修复了多线程的问题 - fix:修复了终局得分的问题 +- fix:修复了唤醒卡死的问题 + +# 5月25日21:00更新 +- fix:修复了可以学习完成作业的问题 +- fix:修复了HaveTea越界的问题 # 5月25日更新 -- fix:修复了可以学习完成作业的问题 \ No newline at end of file +- fix:修复了终局得分的问题 +- fix:修复了开校门的问题 \ No newline at end of file diff --git a/logic/GameClass/GameObj/Map/Map.cs b/logic/GameClass/GameObj/Map/Map.cs index b38b8c9..8fbec0c 100644 --- a/logic/GameClass/GameObj/Map/Map.cs +++ b/logic/GameClass/GameObj/Map/Map.cs @@ -73,6 +73,8 @@ namespace GameClass.GameObj public void MapEscapeStudent() { + if (Interlocked.Increment(ref numOfRemovedStudent) == GameData.numOfStudent - 1) + OpenEmergencyExit(); if (Interlocked.Increment(ref numOfNoHpStudent) == GameData.numOfStudent) { AddScoreFromAddict(); @@ -80,11 +82,11 @@ namespace GameClass.GameObj return; } Interlocked.Increment(ref numOfEscapedStudent); - if (Interlocked.Increment(ref numOfRemovedStudent) == GameData.numOfStudent - 1) - OpenEmergencyExit(); } public void MapDieStudent() { + if (Interlocked.Increment(ref numOfRemovedStudent) == GameData.numOfStudent - 1) + OpenEmergencyExit(); uint noHp = Interlocked.Increment(ref numOfNoHpStudent); ghost!.AddScore(GameData.TrickerScoreStudentDie); if (noHp == GameData.numOfStudent) @@ -94,8 +96,6 @@ namespace GameClass.GameObj return; } Interlocked.Increment(ref numOfDeceasedStudent); - if (Interlocked.Increment(ref numOfRemovedStudent) == GameData.numOfStudent - 1) - OpenEmergencyExit(); } public void MapAddictStudent() { @@ -130,7 +130,7 @@ namespace GameClass.GameObj } private void AddScoreFromAddict() { - ghost.AddScore(GameData.TrickerScoreStudentDie * (GameData.numOfStudent - NumOfRemovedStudent)); + ghost!.AddScore(GameData.TrickerScoreStudentDie * (GameData.numOfStudent - NumOfRemovedStudent)); } diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index c27a14c..d7737e0 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -148,12 +148,17 @@ namespace Gaming () => { player.ThreadNum.WaitOne(); + if (!doorwayToOpen.TryToOpen()) + { + player.ThreadNum.Release(); + player.ResetPlayerState(stateNum); + return; + } if (!player.StartThread(stateNum, RunningStateType.RunningSleepily)) { player.ThreadNum.Release(); return; } - doorwayToOpen.TryToOpen(); Thread.Sleep(GameData.degreeOfOpenedDoorway - doorwayToOpen.OpenDegree); if (player.ResetPlayerState(stateNum)) diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index a5d734e..7fed7a4 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -91,7 +91,11 @@ namespace Preparation.Utility public const int characterRadius = numOfPosGridPerCell * 4 / 10; // 人物半径 public const int basicTreatSpeed = 100; +#if DEBUG + public const int basicFixSpeed = 1800; +#else public const int basicFixSpeed = 123; +#endif public const int basicSpeedOfOpeningOrLocking = 5000; public const int basicStudentSpeedOfClimbingThroughWindows = 1222; public const int basicGhostSpeedOfClimbingThroughWindows = 2540;