properly use Docked entry

This commit is contained in:
Florian Stinglmayr 2021-11-17 21:01:35 +01:00
parent e721d96d67
commit 2cf21f159d

View File

@ -66,9 +66,12 @@ namespace EliteBGS.BGS {
bool collate = false; bool collate = false;
if (e.Is(Events.Docked)) { if (e.Is(Events.Docked)) {
DockedEntry docked = e as DockedEntry;
/* gleem the current station from this message /* gleem the current station from this message
*/ */
current_station = (e as DockedEntry).StationName; current_station = docked.StationName;
current_system = docked.StarSystem;
controlling_faction = docked.StationFaction;
} else if (e.Is(Events.FSDJump)) { } else if (e.Is(Events.FSDJump)) {
/* Gleem current system and controlling faction from this message. /* Gleem current system and controlling faction from this message.
*/ */
@ -88,7 +91,10 @@ namespace EliteBGS.BGS {
} }
} else if (e.Is(Events.MissionCompleted)) { } else if (e.Is(Events.MissionCompleted)) {
var completed = e as MissionCompletedEntry; var completed = e as MissionCompletedEntry;
entry = new MissionCompleted(completed) { System = current_system, Station = current_station }; entry = new MissionCompleted(completed) {
System = current_system,
Station = current_station
};
if (completed.HumanReadableNameWasGenerated) { if (completed.HumanReadableNameWasGenerated) {
/* If the human readable name was generated, we send a log message. Because the /* If the human readable name was generated, we send a log message. Because the
* generated names all sort of suck, we should have more human readable names in * generated names all sort of suck, we should have more human readable names in