Space Engineers

Space Engineers

Water Mod
ogrimdooh Jun 8, 2023 @ 10:53am
"WaterModAPI.RunCommand" not executing the commands.
I love your mod, and I always integrate it with mine hahaha

My mod uses this API method to execute commands by the user, but they have no effect, but the same commands entered directly by the user are working.
Looking at the code of the "WaterAPIComponent" class, the "LoadData" method:

_commandComponent = Session.Instance.TryGet<WaterCommandComponent>();

And then in the "RunCommand" method

if (_commandComponent != null)

Perhaps when the component is loaded the other one has not yet been, and so it will always be null, perhaps fetching the component when it is null in the "RunCommand" method call solves the problem.


I hope my review helps resolve the issue.
Thank you very much.