- fixed: Bug #17193 - Inline expand{Description|MissionText}() subst. priority.
Substitution priority for expandDescription() & expandMissionText(): local, inline overrides now take precedence over mission variables and description.plist entries. This includes a fix for the corresponding leqacy script bug: local variables now take precedence over description.plist entries! ( maintenance & trunk ) git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3690 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
d1bc46dceb
commit
1716d54ac2
@ -345,6 +345,9 @@ NSString *ExpandDescriptionsWithLocalsForSystemSeedName(NSString *text, Random_S
|
|||||||
after = [partial substringWithRange:NSMakeRange(p2,[partial length] - p2)];
|
after = [partial substringWithRange:NSMakeRange(p2,[partial length] - p2)];
|
||||||
middle = [partial substringWithRange:NSMakeRange(p1 + 1 , p2 - p1 - 2)];
|
middle = [partial substringWithRange:NSMakeRange(p1 + 1 , p2 - p1 - 2)];
|
||||||
|
|
||||||
|
// replace all local variables first!
|
||||||
|
part = ReplaceVariables(middle, NULL, locals);
|
||||||
|
|
||||||
// check all_descriptions for an array that's keyed to middle
|
// check all_descriptions for an array that's keyed to middle
|
||||||
value = [all_descriptions objectForKey:middle];
|
value = [all_descriptions objectForKey:middle];
|
||||||
if ([value isKindOfClass:[NSArray class]] && [value count] > 0)
|
if ([value isKindOfClass:[NSArray class]] && [value count] > 0)
|
||||||
@ -399,11 +402,6 @@ NSString *ExpandDescriptionsWithLocalsForSystemSeedName(NSString *text, Random_S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// do replacement of mission and local variables here instead
|
|
||||||
part = ReplaceVariables(middle, NULL, locals);
|
|
||||||
}
|
|
||||||
|
|
||||||
partial = [NSMutableString stringWithFormat:@"%@%@%@",before,part,after];
|
partial = [NSMutableString stringWithFormat:@"%@%@%@",before,part,after];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user