Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6382 from Goober5000/cargo_title_initi…
Browse files Browse the repository at this point in the history
…alization

properly initialize cargo titles
  • Loading branch information
Goober5000 authored Oct 5, 2024
2 parents da9ae0d + 349a992 commit b734d60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions code/mission/missionparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3775,7 +3775,6 @@ void parse_common_object_data(p_object *p_objp)
if (optional_string("$Damage:"))
stuff_float(&Subsys_status[i].percent);

Subsys_status[i].subsys_cargo_name = 0;
if (optional_string("+Cargo Name:")) {
char cargo_name[NAME_LENGTH];
stuff_string(cargo_name, F_NAME, NAME_LENGTH);
Expand All @@ -3793,7 +3792,6 @@ void parse_common_object_data(p_object *p_objp)
Subsys_status[i].subsys_cargo_name = index;
}

Subsys_status[i].subsys_cargo_title[0] = '\0';
if (optional_string("+Cargo Title:")) {
stuff_string(Subsys_status[i].subsys_cargo_title, F_NAME, NAME_LENGTH);
}
Expand Down Expand Up @@ -8266,6 +8264,7 @@ int allocate_subsys_status()
Subsys_status[Subsys_index].ai_class = SUBSYS_STATUS_NO_CHANGE;

Subsys_status[Subsys_index].subsys_cargo_name = 0; // "Nothing"
Subsys_status[Subsys_index].subsys_cargo_title[0] = '\0';

return Subsys_index++;
}
Expand Down
2 changes: 2 additions & 0 deletions code/ship/ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6702,6 +6702,7 @@ void ship::clear()
pre_death_explosion_happened = 0;
wash_killed = 0; // serenity lies
cargo1 = 0; // "Nothing"
cargo_title[0] = '\0';

wing_status_wing_index = -1;
wing_status_wing_pos = -1;
Expand Down Expand Up @@ -7730,6 +7731,7 @@ static int subsys_set(int objnum, int ignore_subsys_info)
ship_system->optimum_range = model_system->optimum_range;
ship_system->favor_current_facing = model_system->favor_current_facing;
ship_system->subsys_cargo_name = 0;
ship_system->subsys_cargo_title[0] = '\0';
ship_system->time_subsys_cargo_revealed = 0;

j = 0;
Expand Down

0 comments on commit b734d60

Please sign in to comment.