1.193.020 - IMySafeZoneBlock toggles SafeZoneCreate(bool))

Jouster500 shared this bug 2 years ago
Outdated

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;

//SpaceEngineers.Game.Entities.Blocks.SafeZone.MySafeZoneComponent 
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)

photo
1

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.

photo
1

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

photo
1

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

Leave a Comment
 
Attach a file