Starstrider42 / Custom-Asteroids

A KSP mod that lets users control where asteroids appear
http://starstrider42.github.io/Custom-Asteroids/
MIT License
13 stars 10 forks source link

Ore drills do not work in Custom Asteroids without Community Resource Pack #46

Closed Starstrider42 closed 4 years ago

Starstrider42 commented 4 years ago

Description

dprostock reported that ore drills do not work if Custom Asteroids is installed. Attempts to reproduce led to the discovery that the drilling code (and only the drilling code) crashes if the asteroid has a ModuleAsteroidResource block with unknown resources.

To Reproduce Steps to reproduce the behavior:

  1. Start a sandbox game of KSP
  2. Run time forward until asteroids spawn
  3. Create a ship equipped with an Advanced Grabbing Unit, a stock ore drill, and an ore storage tank
  4. Launch the ship, press Alt+F12, select "Cheats/Set Orbit" from the menu, and select a rendezvous with an asteroid
  5. Dock with the asteroid, deploy the drill, and tell it to start harvesting.
  6. The drill runs, but no ore is mined, nor does the drill heat up. The log is filled with messages like:

    [ERR 14:06:12.749] [RESOURCES] - Error in - BaseConverter_GetDeltaTime - System.NullReferenceException: Object reference not set to an instance of an object
      at ModuleAsteroidDrill.PrepareRecipe (System.Double deltaTime) [0x0038d] in <55ba45dc3a43403382024deac8dcd0be>:0 
      at BaseConverter.GetBestDeltaTime (System.Double deltaTime) [0x00000] in <55ba45dc3a43403382024deac8dcd0be>:0 
      at BaseConverter.GetDeltaTime () [0x000d5] in <55ba45dc3a43403382024deac8dcd0be>:0 

Background Info