mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-03-23 01:23:32 +08:00
清理调试日志和添加英文注释
- 移除Dustbin.cs中CalcGetSands方法的调试日志输出 - 移除StoragePatch.cs中的调试方法(LogTranspilerInfo, LogReturnValue, LogInserterState) - 移除transpiler中对调试方法的调用 - 为StoragePatch.cs中的所有中文注释添加英文翻译 - 保持修复bug的核心逻辑完整性
This commit is contained in:
@@ -61,28 +61,11 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
|
||||
public static int CalcGetSands(int itemId, int count, int inc)
|
||||
{
|
||||
var sandsPerItem = itemId <= 12000 ? Dustbin.SandsFactors[itemId] : 0;
|
||||
|
||||
// Log item information for debugging
|
||||
var itemProto = LDB.items.Select(itemId);
|
||||
if (itemProto != null)
|
||||
{
|
||||
Logger.LogInfo($"Item destroyed - ID: {itemId}, Name: {itemProto.name}, Type: {itemProto.Type}, StackSize: {itemProto.StackSize}, Grade: {itemProto.Grade}, Count: {count}, Inc: {inc}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogInfo($"Item destroyed - ID: {itemId}, Name: Unknown, Count: {count}, Inc: {inc}");
|
||||
}
|
||||
|
||||
if (sandsPerItem <= 0)
|
||||
{
|
||||
Logger.LogInfo($"No sands generated for item {itemId} (SandsFactor: {sandsPerItem}, Inc: {inc}) - Returning {count} to indicate item destroyed");
|
||||
return count;
|
||||
}
|
||||
if (sandsPerItem <= 0) return count;
|
||||
|
||||
var player = GameMain.mainPlayer;
|
||||
var addCount = count * sandsPerItem;
|
||||
player.sandCount += addCount;
|
||||
Logger.LogInfo($"Sands calculation - ItemID: {itemId}, SandsFactor: {sandsPerItem}, Total sands: {addCount}, Inc: {inc} - Returning {count} to indicate item destroyed");
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user