Skip to content

Conversation

@mibac138
Copy link

Fixes #798

Tested with: Pod launcher, Passenger shuttle, Large/Small chemfuel tank (so everything that has configurable target fuel levels)

@SokyranTheDragon
Copy link
Member

I did take a quick look at the in-game code. Isn't CompRefuelable.TargetFuelLevel a property, rather than a field?

Using sync fields for this will work... But I think it'll be better to handle it as a sync method instead.

Switching to a sync method would mean we won't need to begin/end watching the value (which is done automatically in that specific class), as well as watching the value itself, which means that it'll be more compatible with other mods. For example, this setter is called from Vanilla Quests Expanded - The Generator. And a quick search points to there possibly being more mods this could affect.

Side note - even if syncing the setter itself, keep the sync method to the lambda in Command_SetTargetFuelLevel, as it'll minimize amount of data synced (1 call with all comps + 1 value vs however many calls with 1 comp and 1 value each time).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants