Skip to content

Commit 1037357

Browse files
past-duepull[bot]
authored andcommitted
Fix: Savegame queued droid orders
The `index` and `rtrType` properties were not being saved or loaded.
1 parent 27106ac commit 1037357

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/game.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2387,6 +2387,8 @@ static void getIniDroidOrder(WzConfig &ini, WzString const &key, DroidOrder &ord
23872387
order.pos = ini.vector2i(key + "/pos");
23882388
order.pos2 = ini.vector2i(key + "/pos2");
23892389
order.direction = ini.value(key + "/direction").toInt();
2390+
order.index = ini.value(key + "/index").toUInt();
2391+
order.rtrType = (RTR_DATA_TYPE)ini.value(key + "/rtrType", RTR_TYPE_NO_RESULT).toInt();
23902392
getIniBaseObject(ini, key + "/obj", order.psObj);
23912393
getIniStructureStats(ini, key + "/stats", order.psStats);
23922394
}
@@ -2421,6 +2423,8 @@ static inline void setIniDroidOrder(nlohmann::json &jsonObj, WzString const &key
24212423
jsonObj[keyStr + "/pos"] = order.pos;
24222424
jsonObj[keyStr + "/pos2"] = order.pos2;
24232425
jsonObj[keyStr + "/direction"] = order.direction;
2426+
jsonObj[keyStr + "/index"] = order.index;
2427+
jsonObj[keyStr + "/rtrType"] = order.rtrType;
24242428
setIniBaseObject(jsonObj, key + "/obj", order.psObj);
24252429
setIniStructureStats(jsonObj, key + "/stats", order.psStats);
24262430
}

src/orderdef.h

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ enum RTR_DATA_TYPE
158158
RTR_TYPE_REPAIR_FACILITY,
159159
RTR_TYPE_DROID,
160160
RTR_TYPE_HQ,
161+
// If modifying, only *add* entries at end! (or savegame loading will break)
161162
};
162163

163164
/** Struct that stores data of an order.

0 commit comments

Comments
 (0)