From fb43b11b577e36b2b61b5f61a6e6d697001e6e61 Mon Sep 17 00:00:00 2001 From: Axtel Sturnclaw Date: Thu, 9 Jan 2025 01:14:08 -0500 Subject: [PATCH 1/3] Increment savefile version to v91 --- src/SaveGameManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SaveGameManager.cpp b/src/SaveGameManager.cpp index 6d9e264835..505c93dfc3 100644 --- a/src/SaveGameManager.cpp +++ b/src/SaveGameManager.cpp @@ -15,7 +15,8 @@ static const char s_saveDirName[] = "savefiles"; -static const int s_saveVersion = 90; +// Last incremented: 01/2025 prior to 02-03-2025 release +static const int s_saveVersion = 91; // A simple job to load a savegame into a Json object class LoadGameToJsonJob : public Job @@ -181,4 +182,3 @@ std::vector SaveGameManager::ListSaves() } return saves; } - From ce84640727668d9ed5ee77b5fef859c25f986088 Mon Sep 17 00:00:00 2001 From: Axtel Sturnclaw Date: Thu, 9 Jan 2025 01:16:48 -0500 Subject: [PATCH 2/3] Address savebump tasks - Remove std::isnan() check in DynamicBody.cpp. - Shields only serializes data into the provided JSON object and doesn't create its own subobject. --- SAVEBUMP.txt | 1 - src/DynamicBody.cpp | 6 ------ src/Shields.cpp | 10 +++------- src/Ship.cpp | 4 ++-- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/SAVEBUMP.txt b/SAVEBUMP.txt index 927d128bae..6641191416 100644 --- a/SAVEBUMP.txt +++ b/SAVEBUMP.txt @@ -13,5 +13,4 @@ Regular tasks - data/libs/NameGen.lua: Add new authors to name generator One-time tasks -- DynamicBody.cpp: the std::isnan() check in constructor should be removed - add your one-time tasks here diff --git a/src/DynamicBody.cpp b/src/DynamicBody.cpp index fa95c81fc0..28b48b78ea 100644 --- a/src/DynamicBody.cpp +++ b/src/DynamicBody.cpp @@ -66,12 +66,6 @@ DynamicBody::DynamicBody(const Json &jsonObj, Space *space) : throw SavedGameCorruptException(); } - // fix saves with nans - // SAVEBUMP: This can be removed starting with save version 91 - if (std::isnan(m_angVel.x) || std::isnan(m_angVel.y) || std::isnan(m_angVel.z)) { - m_angVel = vector3d(0.0); - } - m_aiMessage = AIError::AIERROR_NONE; m_decelerating = false; } diff --git a/src/Shields.cpp b/src/Shields.cpp index ec27365918..1bcd6b0e0f 100644 --- a/src/Shields.cpp +++ b/src/Shields.cpp @@ -157,9 +157,9 @@ void Shields::ClearModel() m_shieldMaterial.Reset(); } -void Shields::SaveToJson(Json &jsonObj) +void Shields::SaveToJson(Json &shieldsObj) { - Json shieldsObj({}); // Create JSON object to contain shields data. + shieldsObj = Json::object(); // Create JSON object to contain shields data. shieldsObj["enabled"] = m_enabled; shieldsObj["num_shields"] = m_shields.size(); @@ -172,15 +172,11 @@ void Shields::SaveToJson(Json &jsonObj) shieldArray.push_back(shieldArrayEl); // Append shield object to array. } shieldsObj["shield_array"] = shieldArray; // Add shield array to shields object. - - jsonObj["shields"] = shieldsObj; // Add shields object to supplied object. } -void Shields::LoadFromJson(const Json &jsonObj) +void Shields::LoadFromJson(const Json &shieldsObj) { try { - Json shieldsObj = jsonObj["shields"]; - m_enabled = shieldsObj["enabled"]; assert(shieldsObj["num_shields"].get() == m_shields.size()); diff --git a/src/Ship.cpp b/src/Ship.cpp index 3c44daa526..d3c25fb175 100644 --- a/src/Ship.cpp +++ b/src/Ship.cpp @@ -190,7 +190,7 @@ Ship::Ship(const Json &jsonObj, Space *space) : m_navLights->LoadFromJson(shipObj); - m_shields->LoadFromJson(shipObj); + m_shields->LoadFromJson(shipObj["shields"]); m_shipName = shipObj["name"].get(); Properties().Set("shipName", m_shipName); @@ -300,7 +300,7 @@ void Ship::SaveToJson(Json &jsonObj, Space *space) m_navLights->SaveToJson(shipObj); - m_shields->SaveToJson(shipObj); + m_shields->SaveToJson(shipObj["shields"]); shipObj["name"] = m_shipName; From a58d0bddbad89063fa46e01c9934b824aead4ba6 Mon Sep 17 00:00:00 2001 From: Axtel Sturnclaw Date: Thu, 9 Jan 2025 01:28:22 -0500 Subject: [PATCH 3/3] NameGen: update surname list with contributors - Only english-seeming surnames updated at current; adds 27 additional surnames. --- data/culture/en.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/data/culture/en.lua b/data/culture/en.lua index 8d6c178326..7798f25d56 100644 --- a/data/culture/en.lua +++ b/data/culture/en.lua @@ -629,16 +629,20 @@ local surname = { "Allen", "Anderson", "Armstrong", + "Ashworth", "Atkinson", "Bailey", "Baker", "Ball", + "Bailey", "Barker", "Barnes", + "Bartholomew", "Bell", "Bennett", "Booth", "Bradley", + "Briggs", "Brooks", "Brown", "Burton", @@ -651,11 +655,13 @@ local surname = { "Collins", "Cook", "Cooper", + "Copland", "Corbyn", "Cox", "Davidson", "Davies", "Dawson", + "Dennett", "Dixon", "Edwards", "Elliott", @@ -676,10 +682,15 @@ local surname = { "Harris", "Harrison", "Harvey", + "Hemingway", "Henderson", "Hill", + "Hills", + "Hindle", + "Hodgetts", "Holmes", "Howard", + "Howlett", "Hughes", "Hunt", "Hunter", @@ -689,6 +700,7 @@ local surname = { "Johnson", "Johnston", "Jones", + "Jordan", "Kelly", "Kennedy", "King", @@ -697,6 +709,7 @@ local surname = { "Lee", "Lewis", "Lloyd", + "List", "Marshall", "Martin", "Mason", @@ -705,11 +718,15 @@ local surname = { "Miller", "Mitchell", "Moore", + "Morales", "Morgan", "Morris", "Morrison", + "Morton", + "Mueller", "Murphy", "Murray", + "Norris", "Owen", "Palmer", "Parker", @@ -717,10 +734,12 @@ local surname = { "Pearce", "Pearson", "Perry", + "Peterson", "Phillips", "Powell", "Price", "Reid", + "Reilly", "Reynolds", "Richards", "Richardson", @@ -728,22 +747,28 @@ local surname = { "Robertson", "Robinson", "Rogers", + "Ronald", "Rose", "Ross", "Russell", + "Salt", "Saunders", "Scott", + "Schmidt", "Shaw", + "Sheets", "Simpson", "Smith", "Spencer", "Stevens", "Stewart", + "Talkington", "Taylor", "Thomas", "Thompson", "Thomson", "Turner", + "Tyler", "Walker", "Walsh", "Ward", @@ -751,7 +776,9 @@ local surname = { "Watts", "Webb", "Webster", + "Werle", "West", + "Westerhoff", "White", "Wilkinson", "Williams",