Added map name support to Launch.Map command line parameter
Fixed code based on feedback Replaced try/catch block with a null check and exception throw Fixed code based on feedback Fixed code based on feedback Simplified Launch.Map parameter to use map name directly
This commit is contained in:
committed by
Matthias Mailänder
parent
a537346580
commit
e00efbf53d
@@ -953,12 +953,9 @@ namespace OpenRA
|
|||||||
Order.Command($"state {Session.ClientState.Ready}")
|
Order.Command($"state {Session.ClientState.Ready}")
|
||||||
};
|
};
|
||||||
|
|
||||||
var path = Platform.ResolvePath(launchMap);
|
var map = ModData.MapCache.SingleOrDefault(m => m.Uid == launchMap || Path.GetFileName(m.Package.Name) == launchMap);
|
||||||
var map = ModData.MapCache.SingleOrDefault(m => m.Uid == launchMap) ??
|
|
||||||
ModData.MapCache.SingleOrDefault(m => m.Package.Name == path);
|
|
||||||
|
|
||||||
if (map == null)
|
if (map == null)
|
||||||
throw new InvalidOperationException($"Could not find map '{launchMap}'.");
|
throw new ArgumentException($"Could not find map '{launchMap}'.");
|
||||||
|
|
||||||
CreateAndStartLocalServer(map.Uid, orders);
|
CreateAndStartLocalServer(map.Uid, orders);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user