Be more tolerant of invalid arguments

FossilOrigin-Name: d2f07d884a4f4319ff687e085c3233e210ee05b46a2675ecd757a261e6f19e6e
This commit is contained in:
Jonathan Schleifer 2025-03-12 00:16:05 +00:00
parent f1968ce5af
commit 38747afbb5
12 changed files with 112 additions and 88 deletions

View file

@ -88,6 +88,8 @@ music(OFString *name)
stopsound();
if (soundvol && musicvol) {
@autoreleasepool {
name = [name stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"];
OFString *path =
[OFString stringWithFormat:@"packages/%@", name];
OFIRI *IRI = [Cube.sharedInstance.gameDataIRI
@ -148,7 +150,8 @@ registersound(OFString *name)
if (snames == nil)
snames = [[OFMutableArray alloc] init];
[snames addObject:name];
[snames addObject:[name stringByReplacingOccurrencesOfString:@"\\"
withString:@"/"]];
samples.add(NULL);
return samples.length() - 1;