fixed a runtime error

This commit is contained in:
Seaswimmer 2024-11-07 19:54:14 -05:00
parent 981d59e934
commit 10f930d20d
Signed by: cswimr
GPG key ID: D68E1EAD0F97196D

View file

@ -172,11 +172,10 @@ namespace IngameScript
} }
} }
public void Save(bool isDocked) public void Save()
{ {
_isDocked = isDocked;
_storageIni.Clear(); _storageIni.Clear();
_storageIni.Set("AutomaticConnectorActions", "Is_Docked", isDocked); _storageIni.Set("AutomaticConnectorActions", "Is_Docked", _isDocked);
Storage = _storageIni.ToString(); Storage = _storageIni.ToString();
} }
@ -260,7 +259,8 @@ namespace IngameScript
Echo("Set grid batteries to recharge."); Echo("Set grid batteries to recharge.");
} }
Save(true); _isDocked = true;
Save();
} }
private void Undock() private void Undock()
@ -367,7 +367,8 @@ namespace IngameScript
Echo("Turned on grid thrusters."); Echo("Turned on grid thrusters.");
} }
Save(false); _isDocked = false;
Save();
} }
public void Main(string argument, UpdateType updateSource) public void Main(string argument, UpdateType updateSource)