Jump to content

Code error - LogicValueChanged


boiledDupe
  • Branch: Live Branch Version: Windows Pending

I was looking through the decompiled game code (for a mod I'm writing) and if I'm not mistaken I encountered a coding bug.

I noticed that the `LogicValueChanged` event args is really a global event, even though subscribers are expecting them to be an instance event.

Essentially anywhere where code is consuming `LogicValueChanged.newValue` is not getting what it thinks it's getting (because it could come from another building instance).  This can cause other buildings acting on the event fired from another, or running animation cycles that are unnecessary.

An example `RocketControlStation.OnLogicValueChanged` only gates the rest of the method if the port id matches.  Since the port Id is shared across all instances, the rest of this method will execute for all `RocketControlStations` on the map.


Steps to Reproduce

N/A

  • Like 1



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...