diff --git a/scripts/character/AiCharacter.cs b/scripts/character/AiCharacter.cs
index 2cd2b6b..c035fe4 100644
--- a/scripts/character/AiCharacter.cs
+++ b/scripts/character/AiCharacter.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using ColdMint.scripts.bubble;
using ColdMint.scripts.camp;
+using ColdMint.scripts.debug;
using ColdMint.scripts.inventory;
using ColdMint.scripts.stateMachine;
using ColdMint.scripts.utils;
@@ -210,7 +211,7 @@ public sealed partial class AiCharacter : CharacterTemplate
///
private void AddInitialWeapon(string? initWeaponRes)
{
- if (initWeaponRes == null)
+ if (string.IsNullOrEmpty(initWeaponRes))
{
return;
}
diff --git a/scripts/character/CharacterTemplate.cs b/scripts/character/CharacterTemplate.cs
index b0f7f89..3c2e32b 100644
--- a/scripts/character/CharacterTemplate.cs
+++ b/scripts/character/CharacterTemplate.cs
@@ -403,7 +403,6 @@ public partial class CharacterTemplate : CharacterBody2D
}
NodeUtils.CallDeferredReparent(ItemMarker2D, pickAbleItemNode2D);
- pickAbleItemNode2D.Position = Vector2.Zero;
return true;
}
diff --git a/scripts/loader/uiLoader/SplashScreenLoader.cs b/scripts/loader/uiLoader/SplashScreenLoader.cs
index 06b71cc..318c314 100644
--- a/scripts/loader/uiLoader/SplashScreenLoader.cs
+++ b/scripts/loader/uiLoader/SplashScreenLoader.cs
@@ -130,6 +130,6 @@ public partial class SplashScreenLoader : UiLoaderTemplate
ModLoader.LoadAllMods(modPath);
}
- await Task.CompletedTask;
+ await Task.Yield();
}
}
\ No newline at end of file
diff --git a/scripts/projectile/ProjectileTemplate.cs b/scripts/projectile/ProjectileTemplate.cs
index 92b444e..e254b26 100644
--- a/scripts/projectile/ProjectileTemplate.cs
+++ b/scripts/projectile/ProjectileTemplate.cs
@@ -105,7 +105,7 @@ public partial class ProjectileTemplate : CharacterBody2D
return false;
}
- if (target is TileMap)
+ if (target is TileMapLayer)
{
//When we hit the tile, we return true to prevent the bullet from penetrating the tile.
//撞击到瓦片时,我们返回true,是为了防止子弹穿透瓦片。
diff --git a/scripts/utils/TileMapUtils.cs b/scripts/utils/TileMapUtils.cs
deleted file mode 100644
index 09399a6..0000000
--- a/scripts/utils/TileMapUtils.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Godot;
-
-namespace ColdMint.scripts.utils;
-
-///
-/// TileMapUtils
-/// TileMap工具
-///
-public static class TileMapUtils
-{
- ///
- /// Get the layer number corresponding to LayerName in TileMap
- /// 在TileMap内获取LayerName所对应的图层序号
- ///
- ///
- ///
- ///
- ///− 1 is returned after obtaining failure
- ///获取失败返回-1
- ///
- public static int GetTileMapLayer(TileMap tileMap, string layerName)
- {
- var count = tileMap.GetLayersCount();
- for (var i = 0; i < count; i++)
- {
- var currentLayerName = tileMap.GetLayerName(i);
- if (currentLayerName == layerName)
- {
- return i;
- }
- }
-
- return -1;
- }
-
-}
\ No newline at end of file
diff --git a/scripts/weapon/WeaponTemplate.cs b/scripts/weapon/WeaponTemplate.cs
index 4ae56ed..b6380f9 100644
--- a/scripts/weapon/WeaponTemplate.cs
+++ b/scripts/weapon/WeaponTemplate.cs
@@ -82,7 +82,7 @@ public abstract partial class WeaponTemplate : PickAbleTemplate
var forceX = Math.Abs(_recoil.X);
if (Math.Abs(RotationDegrees) < 90)
{
- //The weapon goes to the right and we apply a recoil to the left
+ //The weapon goes to the right, and we apply a recoil to the left
//武器朝向右边我们向左施加后坐力
forceX = -forceX;
}