Project

General

Profile

Bug #1760

GameObject.audio reference is not updated after reverting flight. (maybe related to FlightGlobals)

Added by velusip over 10 years ago. Updated over 7 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Plugins/Add-Ons
Target version:
-
Start date:
11/12/2013
% Done:

100%

Version:
Platform:
Linux
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

  • When launching a new vessel each part as found from FlightGlobals.ActiveVessel.parts has an .audio attribute referencing it's <AudioSource>.
  • After reverting the flight, those attributes are all null, but obviously all sounds are still functioning normally.

I'm not sure if this is directly related to updating the reference in the GameObject.audio attribute, or has to do with how FlightGlobals.ActiveVessel is updated.

History

#1 Updated by velusip over 10 years ago

I get around this by finding all AudioSources directly, and then deriving which part they are attached to and rebuilding a parts list with correct audio references. Seems like code duplication. :)

#2 Updated by velusip over 10 years ago

Relevant info:

FlightGlobals.ActiveVessel.parts is empty upon the first run of Update() on my MonoBehavior component (attached to the FLIGHT scene) as per attribute [KSPAddon(KSPAddon.Startup.Flight, false)].

The above bug report already accounts for this behavior by checking the parts list every frame.

#3 Updated by TriggerAu over 7 years ago

  • Status changed from New to Needs Clarification

#4 Updated by TriggerAu over 7 years ago

  • Status changed from Needs Clarification to Closed
  • % Done changed from 0 to 100

Closing this report out for now. If you find it is still occuring in the latest version of KSP please open a new report (and this one can be linked to it.) For best results, the wiki contains really useful info for when creating a report http://bugs.kerbalspaceprogram.com/projects/ksp/wiki.

You can also ask questions about the bug cleanup in the forum here: http://forum.kerbalspaceprogram.com/index.php?/topic/143980-time-to-clean-up-the-bug-tracker/ and tag @TriggerAu to get my attention

Also available in: Atom PDF