BattletechModders / LootMagnet

BattleTech Game mod that makes salvage suck less
MIT License
11 stars 7 forks source link

NRE when selling in some cases #18

Closed IceRaptor closed 4 years ago

IceRaptor commented 4 years ago

From RT #ticket-3347:

Uploading Crash Report
NullReferenceException
  at (wrapper managed-to-native) UnityEngine.GameObject.get_transform(UnityEngine.GameObject)
  at BattleTech.Data.PrefabCache.PooledInstantiate (System.String id, System.Nullable`1[T] position, System.Nullable`1[T] rotation, UnityEngine.Transform parent, System.Boolean forceInstantiate) [0x00038] in <4184af8dbeb44635831353f4d349631c>:0 
  at (wrapper dynamic-method) BattleTech.Data.DataManager.PooledInstantiate_Patch2(object,string,BattleTech.BattleTechResourceType,System.Nullable`1<UnityEngine.Vector3>,System.Nullable`1<UnityEngine.Quaternion>,UnityEngine.Transform)
  at BattleTech.UI.ListElementController_SalvageMechPart_NotListView.InitAndCreate (BattleTech.SalvageDef theSalvageDef, BattleTech.SimGameState theSim, BattleTech.Data.DataManager dm, BattleTech.UI.IMechLabDropTarget dropParent, System.Int32 theQuantity, System.Boolean isStoreItem) [0x00007] in <4184af8dbeb44635831353f4d349631c>:0 
  at BattleTech.UI.AAR_SalvageScreen.AddNewSalvageEntryToWidget (BattleTech.SalvageDef salvageDef, BattleTech.UI.IMechLabDropTarget targetWidget) [0x00087] in <4184af8dbeb44635831353f4d349631c>:0 
  at LootMagnet.Helper.CalculateAndAddAvailableSalvage (BattleTech.UI.AAR_SalvageScreen salvageScreen, System.Collections.Generic.List`1[T] potentialSalvage) [0x00059] in <ee9beade6ee74b2a834e8f0884a945a9>:0 
  at LootMagnet.AAR_SalvageScreen_CalculateAndAddAvailableSalvage.Prefix (BattleTech.UI.AAR_SalvageScreen __instance, BattleTech.Contract ___contract, System.Int32& ___totalSalvageMadeAvailable) [0x0016a] in <ee9beade6ee74b2a834e8f0884a945a9>:0 
  at (wrapper dynamic-method) BattleTech.UI.AAR_SalvageScreen.CalculateAndAddAvailableSalvage_Patch1(object)
  at (wrapper dynamic-method) BattleTech.UI.AAR_SalvageScreen.BeginSalvageScreen_Patch1(object)
  at BattleTech.UI.MissionResults.AdvanceAARState () [0x000f0] in <4184af8dbeb44635831353f4d349631c>:0 
  at BattleTech.UI.MissionResults.ScreenContinueClicked () [0x00000] in <4184af8dbeb44635831353f4d349631c>:0 
  at BattleTech.UI.AAR_UnitsResult_Screen.OnCompleted () [0x00000] in <4184af8dbeb44635831353f4d349631c>:0 
  at BattleTech.UI.AAR_UnitsResult_Screen.ReceiveButtonPress (System.String button) [0x0000d] in <4184af8dbeb44635831353f4d349631c>:0 
  at UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) [0x00011] in <9a6ceb7f013a4a599806f492fc789483>:0 
  at UnityEngine.Events.CachedInvokableCall`1[T].Invoke (System.Object[] args) [0x00001] in <9a6ceb7f013a4a599806f492fc789483>:0 
  at UnityEngine.Events.UnityEvent.Invoke () [0x0006e] in <9a6ceb7f013a4a599806f492fc789483>:0 
  at BattleTech.UI.HBSButton.OnPointerUp (UnityEngine.EventSystems.PointerEventData eventData) [0x0006d] in <4184af8dbeb44635831353f4d349631c>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerUpHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00008] in <689405fdf241479fa6250af7e4b0368a>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00070] in <689405fdf241479fa6250af7e4b0368a>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32)
UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent()
UnityEngine.EventSystems.StandaloneInputModule:Process()
UnityEngine.EventSystems.EventSystem:Update()
IceRaptor commented 4 years ago

User report:

Salvage screen offered nothing but three mech parts that I could not select But I could go on to the Argo screen with no issue I had selected full salvage and was expecting 3/15 (if it helps=)

IceRaptor commented 4 years ago

Fixed in 5.4.0