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

Commit f5fd5b4

Browse files
committed
Add save/load support for MO gold value, HUDVisible and PlayerControllable
1 parent 0d7e996 commit f5fd5b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Entities/Scene.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,12 +1510,14 @@ void Scene::SaveSceneObject(Writer &writer, const SceneObject *sceneObjectToSave
15101510
if (!isChildAttachable) {
15111511
writer.NewPropertyWithValue("PlacedByPlayer", sceneObjectToSave->GetPlacedByPlayer());
15121512
}
1513+
writer.NewPropertyWithValue("GoldValue", sceneObjectToSave->GetGoldValue());
15131514

15141515
if (const Deployment *deploymentToSave = dynamic_cast<const Deployment *>(sceneObjectToSave); deploymentToSave && deploymentToSave->GetID() != 0) {
15151516
writer.NewPropertyWithValue("ID", deploymentToSave->GetID());
15161517
}
15171518

15181519
if (const MovableObject *movableObjectToSave = dynamic_cast<const MovableObject *>(sceneObjectToSave)) {
1520+
writer.NewPropertyWithValue("HUDVisible", movableObjectToSave->GetHUDVisible());
15191521
writer.NewPropertyWithValue("Velocity", movableObjectToSave->GetVel());
15201522
writer.NewPropertyWithValue("LifeTime", movableObjectToSave->GetLifetime());
15211523
writer.NewPropertyWithValue("Age", movableObjectToSave->GetAge());
@@ -1630,6 +1632,7 @@ void Scene::SaveSceneObject(Writer &writer, const SceneObject *sceneObjectToSave
16301632
writer.NewPropertyWithValue("Status", actorToSave->GetStatus());
16311633
writer.NewPropertyWithValue("Health", actorToSave->GetHealth());
16321634
writer.NewPropertyWithValue("MaxHealth", actorToSave->GetMaxHealth());
1635+
writer.NewPropertyWithValue("PlayerControllable", actorToSave->IsPlayerControllable());
16331636
int aiModeToSave = actorToSave->GetAIMode() == Actor::AIMode::AIMODE_SQUAD ? Actor::AIMode::AIMODE_GOTO : actorToSave->GetAIMode();
16341637
if (aiModeToSave == Actor::AIMode::AIMODE_GOTO && (!actorToSave->GetMOMoveTarget() && g_SceneMan.ShortestDistance(actorToSave->GetMovePathEnd(), actorToSave->GetPos(), g_SceneMan.SceneWrapsX()).MagnitudeIsLessThan(1.0F))) {
16351638
aiModeToSave = Actor::AIMode::AIMODE_SENTRY;

0 commit comments

Comments
 (0)