1.193.020 - IMySafeZoneBlock toggles SafeZoneCreate(bool))

Jouster500 shared this bug 2 years ago

Missing edge case check on that method. Calling this method with true will rapidly switch the switch between true and false, whereas setting false will just keep it setting false. Big thanks to Digi for isolating the issue.

The code where this issue occurs can be found here;

private void OnSafezoneCreateRemove(bool turnOnSafeZone) {
if (turnOnSafeZone && SafeZoneEntityId == 0L) { // turns on } 
else { // turns off } 

The following code allows it to be showcased its effect in action;

public void Main(string argument, UpdateType updateSource) { 
var safeZone = GridTerminalSystem.GetBlockWithName("Safe Zone"); safeZone.SetValue<bool>("SafeZoneCreate", true); 
Run this code in the PB with the appropriate block name for a safe zone to see the issue./

Replies (3)


Also the same thing happens with the modding interface's EnableSafeZone() when set to true, because both reach the same OnSafezoneCreateRemove() method.

Fixing the condition in OnSafezoneCreateRemove() will fix both the terminal property and any API method that uses it, therefore a STR for this modding one is not necessary.


Hello, Engineer!

Thank you for your feedback! Your topic has been added between considered issues.

Please keep voting for the issue as it will help us to identify the most serious bugs.

We really appreciate your patience.

Kind Regards

Keen Software House: QA Department


Hi! When a problem occurs the zone runs indefinitely and cannot be interacted with!

Leave a Comment
Attach a file