BattletechModders / CBTBehaviorsEnhanced

Applies Classic BattleTech behaviors to the HBS BattleTech Game
MIT License
5 stars 6 forks source link

NRE when calculating fall damage #132

Open IceRaptor opened 1 year ago

IceRaptor commented 1 year ago

From rogueticket-9273:

FallDamage resolution doesn't happen due to an NRE. This leaves an AttackSequence on the stack, that breaks stratops.

03:17:22.5709708 CombatLog.MechFallSequence [LOG] Create MechFallSequence for: Flea
03:17:22.5711036 CombatLog.MechFallSequence [LOG] MechFallSequence OnAdded for: Flea
03:17:22.5711083 CombatLog.MechFallSequence [LOG] MechFallSequence: Begin
03:17:22.5711197 CombatLog.MechFallSequence [LOG] Flea Begin Knockdown!
03:17:22.7415475 CombatLog.ActorActivation [LOG] Actor Flea (b7eb8d4e-6b3d-4670-a48a-baf2757e024a.0) - ends activation due to Done
03:17:22.8152416 CombatLog.Heat [LOG] Mech Flea final heat = 0 out of 150
03:17:23.1247632 CombatLog.Attacking [DEBUG] [OnActivationEnd] Flea b7eb8d4e-6b3d-4670-a48a-baf2757e024a.0 HasActivatedThisRound False
03:17:23.1247724 CombatLog.ActorActivation [LOG] Actor Flea (b7eb8d4e-6b3d-4670-a48a-baf2757e024a.0) - ends activation
03:17:23.1303050 CombatLog.RoundSequence [DEBUG] [ShouldCompleteActivationSequence] 'this is AITeam' true
03:17:23.1303119 CombatLog.RoundSequence [DEBUG] [CompleteActivation] ActivationSequence.ForceComplete = true
03:17:23.1337716 CombatLog.MechFallSequence [LOG] MechFallSequence: Falling
03:17:27.0036054 CombatLog.MechFallSequence [LOG] MechFallSequence: Finished
03:17:27.0262956 <CBTBE> [WARNING] 07:17:27.026 <CBTBE> DOING IMAGINARY ATTACK FOR: Flea_Pilot_68F0C967 USING: Melee_CBTBE_FAKE_MELEE
03:17:27.0264613 CombatLog.AttackSequence [WARNING] AttackSequence: Weapon Melee is firing at target Flea, but technically cannot fire at that target.
03:17:27.0273781 CombatLog.AttackDirector [LOG] [CreateAttackSequence] ID 41595858
03:17:27.0275246 <CBTBE> [WARNING] 07:17:27.027 <CBTBE> Object reference not set to an instance of an object
03:17:27.0275264 <CBTBE> [WARNING] 07:17:27.027 <CBTBE>Stacktrace available in mod logs
03:17:27.0275280 CombatLog.MechFallSequence [LOG] MechFallSequence OnComplete for: Flea
03:17:27.0654111 CombatLog.MechFallSequence [LOG] Flea ApplyKnockdown!
IceRaptor commented 1 year ago

07:16:45.058 FAILED TO APPLY FALL DAMAGE 07:16:45.058 Object reference not set to an instance of an object 07:16:45.058 at CBTBehaviorsEnhanced.Helper.AttackHelper.CreateImaginaryAttack (BattleTech.Mech attacker, BattleTech.Weapon attackWeapon, BattleTech.ICombatant target, System.Int32 weaponHitInfoStackItemUID, System.Single[] damageClusters, BattleTech.DamageType damageType, BattleTech.MeleeAttackType meleeAttackType) [0x00469] in <537876be2dcf4266a956951e703a3dc6>:0 at CBTBehaviorsEnhanced.Piloting.MechFallSequence_OnComplete.Prefix (System.Boolean& runOriginal, BattleTech.MechFallSequence instance) [0x001d3] in <537876be2dcf4266a956951e703a3dc6>:0 07:16:45.058FAILED TO APPLY FALL DAMAGE

IceRaptor commented 1 year ago

Added more logging, but not sure what could be NRE'ing here except the struct. That's always been filled out before - so not clear what's going on.