A wrong defined 'titleKey' for missionscreens will now log a warning instead of logging an internal error.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4597 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
8e4fb08cf7
commit
4f73fe2b4c
@ -361,10 +361,17 @@ static JSBool MissionRunScreen(JSContext *context, uintN argc, jsval *vp)
|
||||
NSString *titleKey = GetParameterString(context, params, "titleKey");
|
||||
if (titleKey != nil)
|
||||
{
|
||||
titleKey = [[UNIVERSE missiontext] oo_stringForKey:titleKey];
|
||||
titleKey = ExpandDescriptionForCurrentSystem(titleKey);
|
||||
titleKey = [player replaceVariablesInString:titleKey];
|
||||
[player setMissionTitle:titleKey];
|
||||
NSString *message = [[UNIVERSE missiontext] oo_stringForKey:titleKey];
|
||||
if (message != nil)
|
||||
{
|
||||
message = ExpandDescriptionForCurrentSystem(message);
|
||||
message = [player replaceVariablesInString:message];
|
||||
[player setMissionTitle:message];
|
||||
}
|
||||
else
|
||||
{
|
||||
OOJSReportWarning(context, @"Mission.runScreen: titleKey '%@' has no entry in missiontext.plist.", titleKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user