Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit bc4555b

Browse files
committed
Cutting out a few extraneous saved values from the scene editor
1 parent b72fdb3 commit bc4555b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Entities/Scene.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,15 +1490,17 @@ void Scene::SaveSceneObject(Writer &writer, const SceneObject *sceneObjectToSave
14901490
}
14911491

14921492
writer.NewPropertyWithValue("Position", sceneObjectToSave->GetPos());
1493-
writer.NewPropertyWithValue("Team", sceneObjectToSave->GetTeam());
1494-
if (!isChildAttachable) {
1493+
if (saveFullData || sceneObjectToSave->GetTeam() != Activity::Teams::NoTeam) {
1494+
writer.NewPropertyWithValue("Team", sceneObjectToSave->GetTeam());
1495+
}
1496+
if (!isChildAttachable && (saveFullData || sceneObjectToSave->GetPlacedByPlayer() != Players::NoPlayer)) {
14951497
writer.NewPropertyWithValue("PlacedByPlayer", sceneObjectToSave->GetPlacedByPlayer());
14961498
}
14971499
if (saveFullData) {
14981500
writer.NewPropertyWithValue("GoldValue", sceneObjectToSave->GetGoldValue());
14991501
}
15001502

1501-
if (const Deployment *deploymentToSave = dynamic_cast<const Deployment *>(sceneObjectToSave); deploymentToSave && deploymentToSave->GetID() != 0) {
1503+
if (const Deployment *deploymentToSave = dynamic_cast<const Deployment *>(sceneObjectToSave); saveFullData && deploymentToSave && deploymentToSave->GetID() != 0) {
15021504
writer.NewPropertyWithValue("ID", deploymentToSave->GetID());
15031505
}
15041506

@@ -1622,9 +1624,9 @@ void Scene::SaveSceneObject(Writer &writer, const SceneObject *sceneObjectToSave
16221624
}
16231625

16241626
if (const Actor *actorToSave = dynamic_cast<const Actor *>(sceneObjectToSave)) {
1625-
writer.NewPropertyWithValue("Health", actorToSave->GetHealth());
1626-
writer.NewPropertyWithValue("MaxHealth", actorToSave->GetMaxHealth());
16271627
if (saveFullData) {
1628+
writer.NewPropertyWithValue("Health", actorToSave->GetHealth());
1629+
writer.NewPropertyWithValue("MaxHealth", actorToSave->GetMaxHealth());
16281630
writer.NewPropertyWithValue("Status", actorToSave->GetStatus());
16291631
writer.NewPropertyWithValue("PlayerControllable", actorToSave->IsPlayerControllable());
16301632

0 commit comments

Comments
 (0)