[Change] Try to load as FleetGroup first.
This commit is contained in:
parent
0a28634b1a
commit
d23b722ef7
34
src/space.c
34
src/space.c
@ -1111,9 +1111,28 @@ static StarSystem* system_parse(StarSystem* sys, const xmlNodePtr parent) {
|
||||
cur = node->children;
|
||||
do {
|
||||
if(xml_isNode(cur, "fleet")) {
|
||||
/* Load the fleet. */
|
||||
/* Try to load it as a FleetGroup. */
|
||||
fltgrp = fleet_getGroup(xml_get(cur));
|
||||
if(fltgrp != NULL) {
|
||||
/* Try to load it as a FleetGroup. */
|
||||
fltgrp = fleet_getGroup(xml_get(cur));
|
||||
if(fltgrp == NULL) {
|
||||
WARN("Fleet '%s' for Star System '%s' not found",
|
||||
xml_get(cur), sys->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Add the fleetgroup. */
|
||||
system_addFleetGroup(sys, fltgrp);
|
||||
} else {
|
||||
/* Try to load it as a fleet. */
|
||||
flt = fleet_get(xml_get(cur));
|
||||
if(flt != NULL) {
|
||||
if(flt == NULL) {
|
||||
WARN("Fleet '%s' for Star System '%s' not found",
|
||||
xml_get(cur), sys->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the fleet. */
|
||||
fleet.fleet = flt;
|
||||
|
||||
@ -1129,17 +1148,6 @@ static StarSystem* system_parse(StarSystem* sys, const xmlNodePtr parent) {
|
||||
|
||||
/* Add the fleet. */
|
||||
system_addFleet(sys, &fleet);
|
||||
} else {
|
||||
/* Try to load it as a FleetGroup. */
|
||||
fltgrp = fleet_getGroup(xml_get(cur));
|
||||
if(fltgrp == NULL) {
|
||||
WARN("Fleet '%s' for Star System '%s' not found",
|
||||
xml_get(cur), sys->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Add the fleetgroup. */
|
||||
system_addFleetGroup(sys, fltgrp);
|
||||
}
|
||||
}
|
||||
} while(xml_nextNode(cur));
|
||||
|
Loading…
Reference in New Issue
Block a user