Cube  Diff

Differences From Artifact [0afcae2b92]:

To Artifact [e9d197474b]:


334
335
336
337
338
339
340
341

342
343
344
345
346
347




348
349
350
351
352
353
354
355
356
357
358
359
360





361
362
363
364
365
366
367
368
369
334
335
336
337
338
339
340

341
342
343
344
345


346
347
348
349
350
351
352
353
354
355
356
357
358
359
360


361
362
363
364
365
366

367
368
369
370
371
372
373







-
+




-
-
+
+
+
+











-
-
+
+
+
+
+

-








		if (completeidx >= idx)
			completeidx = 0;
	}
}

bool
execfile(OFString *cfgfile)
execfile(OFIRI *cfgfile)
{
	@autoreleasepool {
		OFString *command;
		@try {
			command = [OFString stringWithContentsOfFile:cfgfile];
		} @catch (id e) {
			command = [OFString stringWithContentsOfIRI:cfgfile];
		} @catch (OFOpenItemFailedException *e) {
			return false;
		} @catch (OFReadFailedException *e) {
			return false;
		}

		execute(command);
		return true;
	}
}

void
exec(OFString *cfgfile)
{
	if (!execfile(cfgfile)) {
		@autoreleasepool {
	@autoreleasepool {
		if (!execfile([Cube.sharedInstance.userDataIRI
		        IRIByAppendingPathComponent:cfgfile]) &&
		    !execfile([Cube.sharedInstance.gameDataIRI
		        IRIByAppendingPathComponent:cfgfile]))
			conoutf(@"could not read \"%@\"", cfgfile);
		}
	}
}

void
writecfg()
{
	OFStream *stream;