mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-07 02:43:22 +03:00
Fixed system link updating on FSDTarget
FSDTarget contains the target system under `SystemAddress`, meaning that any time you selected a star other than the current one, plugins' `this.system_address` was updated to that target, rather than the current system. Said updating causes the links provided from system_url to reflect that update (for providers that support ID64s). This changes the journal_entry behaviour to only update `this.system_address` when the event is any of Location, Docked, or FSDJump, all of which contain only the current system.
This commit is contained in:
parent
a862fc0860
commit
d635bd8469
@ -77,7 +77,9 @@ def prefs_changed(cmdr, is_beta):
|
|||||||
|
|
||||||
|
|
||||||
def journal_entry(cmdr, is_beta, system, station, entry, state):
|
def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||||
# Always update, even if we're not the *current* system or station provider.
|
# Always update our system address even if we're not currently the provider for system or station, but dont update
|
||||||
|
# on events that contain "future" data, such as FSDTarget
|
||||||
|
if entry['event'] in ('Location', 'Docked', 'CarrierJump', 'FSDJump'):
|
||||||
this.system_address = entry.get('SystemAddress') or this.system_address
|
this.system_address = entry.get('SystemAddress') or this.system_address
|
||||||
this.system = entry.get('StarSystem') or this.system
|
this.system = entry.get('StarSystem') or this.system
|
||||||
|
|
||||||
|
@ -217,7 +217,9 @@ def credentials(cmdr):
|
|||||||
|
|
||||||
|
|
||||||
def journal_entry(cmdr, is_beta, system, station, entry, state):
|
def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||||
# Always update, even if we're not the *current* system or station provider.
|
# Always update our system address even if we're not currently the provider for system or station, but dont update
|
||||||
|
# on events that contain "future" data, such as FSDTarget
|
||||||
|
if entry['event'] in ('Location', 'Docked', 'CarrierJump', 'FSDJump'):
|
||||||
this.system_address = entry.get('SystemAddress') or this.system_address
|
this.system_address = entry.get('SystemAddress') or this.system_address
|
||||||
this.system = entry.get('StarSystem') or this.system
|
this.system = entry.get('StarSystem') or this.system
|
||||||
|
|
||||||
|
@ -231,7 +231,9 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
|||||||
elif entry['event'] in ['ShipyardNew', 'ShipyardSwap'] or (entry['event'] == 'Location' and entry['Docked']):
|
elif entry['event'] in ['ShipyardNew', 'ShipyardSwap'] or (entry['event'] == 'Location' and entry['Docked']):
|
||||||
this.suppress_docked = True
|
this.suppress_docked = True
|
||||||
|
|
||||||
# Always update, even if we're not the *current* system or station provider.
|
# Always update our system address even if we're not currently the provider for system or station, but dont update
|
||||||
|
# on events that contain "future" data, such as FSDTarget
|
||||||
|
if entry['event'] in ('Location', 'Docked', 'CarrierJump', 'FSDJump'):
|
||||||
this.system_address = entry.get('SystemAddress') or this.system_address
|
this.system_address = entry.get('SystemAddress') or this.system_address
|
||||||
this.system = entry.get('StarSystem') or this.system
|
this.system = entry.get('StarSystem') or this.system
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user