Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/mission/missionparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ SCP_vector<SCP_string> Parse_names;

SCP_vector<SCP_string> Mission_parse_warnings;

// true while a mission is being parsed and post-processed
bool Parsing_mission = false;

// Routes a parse-time auto-correction notice to the right surface for the app:
// outside QtFRED, the existing Warning(LOCATION, ...) popup; inside QtFRED, the
// Mission_parse_warnings queue so the ErrorChecker can present it without a popup.
Expand Down Expand Up @@ -7552,6 +7555,8 @@ bool parse_main(const char *mission_name, int flags)

Assert(Ship_info.size() <= MAX_SHIP_CLASSES);

Parsing_mission = true;

do {
// don't do this for imports
if (!(flags & MPF_IMPORT_FSM)) {
Expand Down Expand Up @@ -7603,6 +7608,8 @@ bool parse_main(const char *mission_name, int flags)
}
} while (0);

Parsing_mission = false;

if (!Fred_running)
strcpy_s(Mission_filename, mission_name);

Expand Down
3 changes: 3 additions & 0 deletions code/mission/missionparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ extern SCP_vector<SCP_string> Parse_names;
// silently buried. Outside of QtFRED these sites still call Warning(LOCATION, ...).
extern SCP_vector<SCP_string> Mission_parse_warnings;

// true while a mission is being parsed and post-processed
extern bool Parsing_mission;

extern char Player_start_shipname[NAME_LENGTH];
extern int Player_start_shipnum;
extern p_object *Player_start_pobject;
Expand Down
5 changes: 2 additions & 3 deletions code/missionui/redalert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,9 +969,8 @@ void red_alert_bash_ship_status()
// give the ship its name from the latest wave
// (this will make the ship match to the correct red-alert data)
wing_bash_ship_name(shipp, wingp, ((rws->latest_wave - 1) * wingp->wave_count) + 1 + pos_in_wing);
// need to update the ship registry too
strcpy_s(Ship_registry[ship_entry_index].name, shipp->ship_name);
Ship_registry_map[shipp->ship_name] = ship_entry_index;
// need to update the ship registry too; keep the old key because the previous name was a real ship name that may still be referenced
ship_registry_rename(ship_entry_index, shipp->ship_name, false);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions code/network/multi_ingame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,12 @@ void process_ingame_wings_packet( ubyte *data, header *hinfo )
// kind of stupid, but bash the name since it won't get recreated properly from
// the parse_wing_create_ships call.
shipp = &Ships[shipnum];
int ship_entry_index = ship_registry_get_index(shipp->ship_name);
Assertion(ship_entry_index >= 0, "Ship %s must be in the ship registry!", shipp->ship_name);
wing_bash_ship_name(shipp, wingp, which_one + 1);
// need to update the ship registry too
if (ship_entry_index >= 0)
ship_registry_rename(ship_entry_index, shipp->ship_name, true);
nprintf(("Network", "Created %s\n", shipp->ship_name));

objp = &Objects[shipp->objnum];
Expand Down
Loading
Loading