Skip to content

Commit f326b27

Browse files
committed
Revert "Added saved/loaded values to MovableObject"
Not necessary and better to remove the memory overhead This reverts commit eece89a.
1 parent 44385ab commit f326b27

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6666
`tracy.Message(text)` to send a tracy message.
6767
Lua scripts without any tracy documentation are still profiled by tracy, however only at a granularity of how long the entire script takes to execute.
6868

69-
- New `MovableObject` Lua functions `SaveNumber(stringKey, floatValue)`, `LoadNumber(stringKey)`, `SaveString(stringKey, stringValue)` and `SaveString(stringKey)`.
70-
These work in the same manner as the likewise named functions on `Activity`.
71-
7269
- New `HeldDevice` Lua function `IsBeingHeld`, which returns whether or not the `HeldDevice` is currently being held.
7370

7471
- New `HeldDevice` INI and Lua (R/W) property `GetsHitByMOsWhenHeld`, which defines whether this `HeldDevice` can be hit by MOs while equipped and held by an actor. Defaults to true.

Entities/MovableObject.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ void MovableObject::Clear()
124124

125125
m_SimUpdatesBetweenScriptedUpdates = 1;
126126
m_SimUpdatesSinceLastScriptedUpdate = 0;
127-
m_SavedValues.Reset();
128127
}
129128

130129
LuaStateWrapper & MovableObject::GetAndLockStateForScript(const std::string &scriptPath, const LuaFunction *function) {
@@ -295,8 +294,6 @@ int MovableObject::Create(const MovableObject &reference)
295294
m_UniqueID = MovableObject::GetNextUniqueID();
296295
g_MovableMan.RegisterObject(this);
297296

298-
m_SavedValues = reference.m_SavedValues;
299-
300297
return 0;
301298
}
302299

@@ -407,7 +404,6 @@ int MovableObject::ReadProperty(const std::string_view &propName, Reader &reader
407404
MatchProperty("IgnoreTerrain", { reader >> m_IgnoreTerrain; });
408405
MatchProperty("SimUpdatesBetweenScriptedUpdates", { reader >> m_SimUpdatesBetweenScriptedUpdates; });
409406
MatchProperty("AddCustomValue", { ReadCustomValueProperty(reader); });
410-
MatchProperty("GenericSavedValues", { reader >> m_SavedValues; });
411407

412408
EndPropertyList;
413409
}
@@ -526,9 +522,6 @@ int MovableObject::Save(Writer &writer) const
526522
writer.NewPropertyWithValue(key, value);
527523
}
528524

529-
writer.NewProperty("GenericSavedValues");
530-
writer << m_SavedValues;
531-
532525
return 0;
533526
}
534527

Entities/MovableObject.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,32 +1614,6 @@ enum MOType
16141614
/// <returns>Whether or not there is an associated value for this key.</returns>
16151615
bool ObjectValueExists(const std::string &key) const;
16161616

1617-
/// <summary>
1618-
/// Saves a string which will be stored in our ini.
1619-
/// </summary>
1620-
/// <param name="key">The key of the saved string.</param>
1621-
/// <param name="value">The string to save.</param>
1622-
void SaveScriptString(const std::string& key, const std::string& value) { m_SavedValues.SaveString(key, value); };
1623-
1624-
/// <summary>
1625-
/// Loads and returns a previously saved string.
1626-
/// </summary>
1627-
/// <param name="key">The key of the string to load.</param>
1628-
const std::string& LoadScriptString(const std::string& key) { return m_SavedValues.LoadString(key); };
1629-
1630-
/// <summary>
1631-
/// Saves a number which will be stored in our ini.
1632-
/// </summary>
1633-
/// <param name="key">The key of the saved number.</param>
1634-
/// <param name="value">The number to save.</param>
1635-
void SaveScriptNumber(const std::string& key, float value) { m_SavedValues.SaveNumber(key, value); };
1636-
1637-
/// <summary>
1638-
/// Loads and returns a previously saved number.
1639-
/// </summary>
1640-
/// <param name="key">The key of the string to load.</param>
1641-
float LoadScriptNumber(const std::string& key) { return m_SavedValues.LoadNumber(key); };
1642-
16431617
/// <summary>
16441618
/// Event listener to be run while this MovableObject's PieMenu is opened.
16451619
/// </summary>
@@ -2141,11 +2115,6 @@ enum MOType
21412115
int m_SimUpdatesBetweenScriptedUpdates; //!< The number of Sim updates between each scripted update for this MovableObject.
21422116
int m_SimUpdatesSinceLastScriptedUpdate; //!< The counter for the current number of Sim updates since this MovableObject last ran a scripted update.
21432117

2144-
/// <summary>
2145-
/// Generic additional saved strings/numbers, which are used for scripts primarily.
2146-
/// </summary>
2147-
GenericSavedData m_SavedValues;
2148-
21492118
//////////////////////////////////////////////////////////////////////////////////////////
21502119
// Private member variable and method declarations
21512120

Lua/LuaBindingsEntities.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,6 @@ namespace RTE {
10831083
.def("IsAtRest", &MovableObject::IsAtRest)
10841084
.def("MoveOutOfTerrain", &MovableObject::MoveOutOfTerrain)
10851085
.def("RotateOffset", &MovableObject::RotateOffset)
1086-
.def("SaveString", &MovableObject::SaveScriptString)
1087-
.def("LoadString", &MovableObject::LoadScriptString)
1088-
.def("SaveNumber", &MovableObject::SaveScriptNumber)
1089-
.def("LoadNumber", &MovableObject::LoadScriptNumber)
10901086
.def("SendMessage", &LuaAdaptersMovableObject::SendMessage1)
10911087
.def("SendMessage", &LuaAdaptersMovableObject::SendMessage2);
10921088
}

0 commit comments

Comments
 (0)