BahamutoD / BDArmory

Gun turrets and other weapon systems for KSP
38 stars 112 forks source link

Issue with SmartFindTarget when all wheels are broken #44

Open BahamutoD opened 8 years ago

BahamutoD commented 8 years ago

This one puzzles me. I noticed that a patriot launcher vessel wasn't firing at me, and checked the log to find an NRE in SmartFindTarget(). All of the wheels on the vessel were broken, but it was landed. I EVA'd a kerbal to repair one of the wheels, and the issue was gone. My first instinct was that there's a bug in the new wheel code that would cause a vessel to be not LandedOrSplashed if only broken wheels were touching the ground, causing the guard code to NRE when trying to access the AI Pilot here: https://github.com/BahamutoD/BDArmory/blob/master/BahaTurret/MissileFire.cs#L3221. However, I did some debug, and the vessel indeed was flagged as landed, even with the broken wheels.