Cube  Diff

Differences From Artifact [823b65f982]:

To Artifact [402ec6ee8c]:


258
259
260
261
262
263
264
265

266
267
268
269
270
271
272
258
259
260
261
262
263
264

265
266
267
268
269
270
271
272







-
+








void
load_world(OFString *mname) // still supports all map formats that have existed
                            // since the earliest cube betas!
{
	stopifrecording();
	cleardlights();
	pruneundos();
	pruneundos(0);
	setnames(mname);
	gzFile f =
	    gzopen([cgzname cStringWithEncoding:OFLocale.encoding], "rb9");
	if (!f) {
		conoutf(@"could not read map %@", cgzname);
		return;
	}
346
347
348
349
350
351
352
353

354
355
356
357
358



359
360
361
362
363
364
365
366
346
347
348
349
350
351
352

353





354
355
356

357
358
359
360
361
362
363







-
+
-
-
-
-
-
+
+
+
-







			s->utex = s->wtex;
			s->tag = 0;
			s->floor = 0;
			s->ceil = 16;
			break;
		}
		default: {
			if (type < 0 || type >= MAXTYPE) {
			if (type < 0 || type >= MAXTYPE)
				OFString *t = [OFString
				    stringWithFormat:@"%d @ %d", type, k];
				fatal(@"while reading map: type out of "
				      @"range: ",
				    t);
				fatal(@"while reading map: type out of range: "
				      @"%d @ %d",
				    type, k);
			}
			s->type = type;
			s->floor = gzgetc(f);
			s->ceil = gzgetc(f);
			if (s->floor >= s->ceil)
				s->floor = s->ceil - 1; // for pre 12_13
			s->wtex = gzgetc(f);
			s->ftex = gzgetc(f);