Cube  Diff

Differences From Artifact [861b8a0f13]:

To Artifact [16c30b946f]:


125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
			loopi(MAXTYPE) nums[i] = 0;
			loopj(4) nums[o[j]->type]++;
			// cube contains both solid and space, treated
			// specially in the renderer
			r->type = SEMISOLID;
			loopk(MAXTYPE) if (nums[k] == 4) r->type = k;
			if (!SOLID(r)) {
				int floor = 127, ceil = -128, num = 0;
				loopi(4) if (!SOLID(o[i]))
				{
					num++;
					int fh = o[i]->floor;
					int ch = o[i]->ceil;
					if (r->type == SEMISOLID) {
						if (o[i]->type == FHF)
							// crap hack, needed
							// for rendering large
							// mips next to hfs






|


<







125
126
127
128
129
130
131
132
133
134

135
136
137
138
139
140
141
			loopi(MAXTYPE) nums[i] = 0;
			loopj(4) nums[o[j]->type]++;
			// cube contains both solid and space, treated
			// specially in the renderer
			r->type = SEMISOLID;
			loopk(MAXTYPE) if (nums[k] == 4) r->type = k;
			if (!SOLID(r)) {
				int floor = 127, ceil = -128;
				loopi(4) if (!SOLID(o[i]))
				{

					int fh = o[i]->floor;
					int ch = o[i]->ceil;
					if (r->type == SEMISOLID) {
						if (o[i]->type == FHF)
							// crap hack, needed
							// for rendering large
							// mips next to hfs
328
329
330
331
332
333
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
374
375
}

Entity *
newentity(int x, int y, int z, OFString *what, int v1, int v2, int v3, int v4)
{
	int type = findtype(what);

	PersistentEntity *e = [PersistentEntity entity];
	e.x = x;
	e.y = y;
	e.z = z;
	e.attr1 = v1;
	e.type = type;
	e.attr2 = v2;
	e.attr3 = v3;
	e.attr4 = v4;

	switch (type) {
	case LIGHT:
		if (v1 > 32)
			v1 = 32;
		if (!v1)
			e.attr1 = 16;
		if (!v2 && !v3 && !v4)
			e.attr2 = 255;
		break;

	case MAPMODEL:
		e.attr4 = e.attr3;
		e.attr3 = e.attr2;
	case MONSTER:
	case TELEDEST:
		e.attr2 = (uchar)e.attr1;
	case PLAYERSTART:
		e.attr1 = (int)player1.yaw;
		break;
	}
	addmsg(1, 10, SV_EDITENT, ents.count, type, e.x, e.y, e.z, e.attr1,
	    e.attr2, e.attr3, e.attr4);

	[ents addObject:e]; // unsafe!

	if (type == LIGHT)
		calclight();

	return e;
}







|


















<













|







327
328
329
330
331
332
333
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
}

Entity *
newentity(int x, int y, int z, OFString *what, int v1, int v2, int v3, int v4)
{
	int type = findtype(what);

	Entity *e = [Entity entity];
	e.x = x;
	e.y = y;
	e.z = z;
	e.attr1 = v1;
	e.type = type;
	e.attr2 = v2;
	e.attr3 = v3;
	e.attr4 = v4;

	switch (type) {
	case LIGHT:
		if (v1 > 32)
			v1 = 32;
		if (!v1)
			e.attr1 = 16;
		if (!v2 && !v3 && !v4)
			e.attr2 = 255;
		break;

	case MAPMODEL:
		e.attr4 = e.attr3;
		e.attr3 = e.attr2;
	case MONSTER:
	case TELEDEST:
		e.attr2 = (uchar)e.attr1;
	case PLAYERSTART:
		e.attr1 = (int)player1.yaw;
		break;
	}
	addmsg(1, 10, SV_EDITENT, ents.count, type, e.x, e.y, e.z, e.attr1,
	    e.attr2, e.attr3, e.attr4);

	[ents addObject:e];

	if (type == LIGHT)
		calclight();

	return e;
}