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