Skip to content

Commit 328e7d3

Browse files
committed
update detection of save version
Looking at the log of missionsave.cpp, the presence of a ship or subsystem cargo title will necessitate a minimum version of 24.1.
1 parent 39565d3 commit 328e7d3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

code/mission/missionparse.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8966,11 +8966,11 @@ bool check_for_23_3_data()
89668966
return true;
89678967
}
89688968

8969-
if (The_mission.custom_data.size() > 0) {
8969+
if (!The_mission.custom_data.empty()) {
89708970
return true;
89718971
}
89728972

8973-
if (The_mission.custom_strings.size() > 0) {
8973+
if (!The_mission.custom_strings.empty()) {
89748974
return true;
89758975
}
89768976

@@ -9014,6 +9014,14 @@ bool check_for_24_1_data()
90149014
if (shipp->arrival_location == ArrivalLocation::IN_BACK_OF_SHIP || shipp->arrival_location == ArrivalLocation::ABOVE_SHIP || shipp->arrival_location == ArrivalLocation::BELOW_SHIP
90159015
|| shipp->arrival_location == ArrivalLocation::TO_LEFT_OF_SHIP || shipp->arrival_location == ArrivalLocation::TO_RIGHT_OF_SHIP)
90169016
return true;
9017+
9018+
if (shipp->cargo_title[0] != '\0')
9019+
return true;
9020+
for (const auto& ss : list_range(&shipp->subsys_list))
9021+
{
9022+
if (ss->subsys_cargo_title[0] != '\0')
9023+
return true;
9024+
}
90179025
}
90189026

90199027
if ((Asteroid_field.debris_genre == DG_DEBRIS && !Asteroid_field.field_debris_type.empty()) ||

0 commit comments

Comments
 (0)