搜尋此網誌

2024年5月1日 星期三

IL_00af: call System.Int32& System.Int32[0...,0...]::Address

 打包app執行轟炸超人發現遊戲開局就crash了....


在pc上複查發現這個錯誤



最後發現是這邊出錯, int[,]在查詢數據時 address 不知道為什麼出錯了

for (int j = 0; j < map.MapConfig.ChunkH; j++){ strm += "["; for (int i = 0; i < map.MapConfig.ChunkW; i++){                 //這邊出錯
strm += matrixData[j, i] + ","; } strm += "],"; } strm += "]";


詳細錯誤如下

IL_00af: call System.Int32& System.Int32[0...,0...]::Address(System.Int32,System.Int32) at ETHotfix.AIPlayer.calcNonPath(System.Int32 depth) (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:366) at ETHotfix.AIPlayer.calcPath() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:200) at ETHotfix.AIPlayer.V_Think() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:86) at ETHotfix.AIPlayer.think() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AIPlayer.cs:79) at ETHotfix.AILogic.UpdateLogic() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/AI/AILogic.cs:292) at ETHotfix.BaseEntity.updateAILogicAct() (at G:/OlgCase/bbm/source/Unity/Assets/Hotfix/GameGather/Bomber/Entity/BaseEntity.cs:1581)

代碼修改, 把查詢給int再使用就好了


for (int j = 0; j < map.MapConfig.ChunkH; j++){ strm += "["; for (int i = 0; i < map.MapConfig.ChunkW; i++){ num = matrixData[j, i]; strm += num + ","; } strm += "],";
以後有空再來查這個問題

沒有留言:

張貼留言