Added ability to pass parameters using sendScriptMessage:
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1766 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
9ed1b38567
commit
16fa3fb94b
@ -1785,7 +1785,17 @@ WormholeEntity* whole;
|
||||
// Send own ship script a message.
|
||||
- (void) sendScriptMessage:(NSString *)message
|
||||
{
|
||||
NSArray *components = ScanTokensFromString(message);
|
||||
if ([components count] == 1)
|
||||
{
|
||||
[self doScriptEvent:message];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *function = [components objectAtIndex:1];
|
||||
components = [components subarrayWithRange:NSMakeRange(1, [components count] - 1)];
|
||||
[self doScriptEvent:function withArgument:components];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user