Page MenuHomeFeedback Tracker

Restore entity instance to default prefabs is not undo-ing creation of new base container
Closed, ResolvedPublic

Description

When one places a prefab onto the map only coords are changed as seen below.

Vehicle BTR1 : "{C012BB3488BEA0C2}Prefabs/Vehicles/Wheeled/BTR70/BTR70.et" {
 coords 101.97 0.001 150.739
}

When you then change any component property it saves it like this

Vehicle BTR1 : "{C012BB3488BEA0C2}Prefabs/Vehicles/Wheeled/BTR70/BTR70.et" {
 components {
  ControllersManagerComponent "{3524A75DA7DAC1AD}" {
   Enabled 0
  }
 }
 coords 101.97 0.001 150.739
}

But if you then undo it in the workbench by using reset to default button


you get this:

Vehicle BTR1 : "{C012BB3488BEA0C2}Prefabs/Vehicles/Wheeled/BTR70/BTR70.et" {
 components {
  ControllersManagerComponent "{3524A75DA7DAC1AD}" {
  }
 }
 coords 101.97 0.001 150.739
}

This is a problem because if there is a component override even if it does nothing, the engine will add an additional BaseContainer layer to the entity source, even though it's fully prefabbed again. So it is impossible to detect if any entity is fully prefabbed or if the map layer might have any overrides on it.

The fix is simple, if there is a component override that does nothing aka is empty then remove it. And if the components array has 0 component overrides then it too should be deleted. That way the original form of the map layer is restored again.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.May 6 2023, 5:57 PM
Geez changed the task status from New to Assigned.May 10 2023, 11:06 AM
Geez closed this task as Resolved.Jun 27 2023, 1:59 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Resolved for the 0.9.9. version