Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Recovery not attempted due to timewarp #47

Description

@PaletzTheWise

Hello,
I have found an issue with timewarp. Chance of recovery goes down as timewarp factor goes up, sometimes x50 is enough to prevent recovery. I have added some logs and it looks like VesselDestroyEvent is firing but v.altitude is reported negative, thus the condition for recovering is not fulfilled.

private void VesselDestroyEvent(Vessel v)
...
if (v != null && !RecoverAttemptLog.ContainsKey(v.id) && !(HighLogic.LoadedSceneIsFlight && v.isActiveVessel) && (v.mainBody == Planetarium.fetch.Home) && (!v.loaded || v.packed) && (v.altitude < v.mainBody.atmosphereDepth) &&
               (v.situation == Vessel.Situations.FLYING || v.situation == Vessel.Situations.SUB_ORBITAL || v.situation == Vessel.Situations.ORBITING) && !v.isEVA && v.altitude > 100)
{
    RecoverVessel(v, false);
}

Is the altitude check required? I'd imagine for other events it would be dangerous to recover vessels near ground since it could be a fully functional rover or submarine. But the vessel is being destroyed here, perhaps even a rover deserves a chance if it flies and crashes :)

[LOG 21:43:22.848] [SR] VesselDestroyEvent() vessel=Fuel Tank Heavy 2 Probe (unloaded)
[LOG 21:43:22.848] [SR] Controlling mod is null
[LOG 21:43:22.848] [SR] VesselDestroyEvent() not recovering isFirstTry=True, isObserved=False, isHome=True, isLoaded=True, isWithinAtmosphere=True, isFlyingOrOrbiting=True, isEva=False, altitude=81.7866229285719
[LOG 21:43:22.849] [Vessel Fuel Tank Heavy 2 Probe]: Vessel was destroyed.
[WRN 21:43:22.849] [F: 67135]: Vessel Fuel Tank Heavy 2 Probe crashed through terrain on Kerbin.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions