Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: BT (calcastor/mame) <[email protected]>
  • Loading branch information
calcastor committed Aug 26, 2024
1 parent 60b984c commit 48a01ff
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions core/src/main/java/tc/oc/pgm/map/MapInfoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,16 @@ public Component getStyledName(MapNameStyle style) {
private Component parseGamemode(Element root) throws InvalidXMLException {
Component gamemode = XMLUtils.parseFormattedText(Node.fromLastChildOrAttr(root, "game"));

if (gamemode == null) {
final Element blitz = root.getChild("blitz");
if (blitz != null) {
final Element title = blitz.getChild("title");
if (title != null) {
if (this.getProto().isNoOlderThan(MapProtos.REMOVE_BLITZ_TITLE)) {
throw new InvalidXMLException(
"<title> inside <blitz> is no longer supported, use <map game=\"...\">", title);
}
gamemode = XMLUtils.parseFormattedText(Node.fromNullable(title));
}
for (Element blitzTitle : XMLUtils.flattenElements(root, "blitz", "title")) {
if (this.getProto().isNoOlderThan(MapProtos.REMOVE_BLITZ_TITLE)) {
throw new InvalidXMLException(
"<title> inside <blitz> is no longer supported, use <map game=\"...\"> or <game>",
blitzTitle);
} else if (gamemode != null && blitzTitle != null) {
throw new InvalidXMLException(
"<title> inside <blitz> is overriden by <map game=\"...\"> or <game>", blitzTitle);
} else if (gamemode == null) {
gamemode = XMLUtils.parseFormattedText(Node.fromNullable(blitzTitle));
}
}

Expand Down

0 comments on commit 48a01ff

Please sign in to comment.