Cube  Diff

Differences From Artifact [476557dd41]:

To Artifact [11f87c82e6]:


170
171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
				if (mapchanged)
					setspawn(n, true);
			break;
		}
		// server requests next map
		case SV_MAPRELOAD: {
			getint(&p);
			OFString *nextmapalias = [OFString
			    stringWithFormat:@"nextmap_%@", getclientmap()];

			OFString *map =
			    getalias(nextmapalias); // look up map in the cycle
			changemap(map != nil ? map : getclientmap());
			break;
		}

		// another client either connected or changed name/team
		case SV_INITC2S: {
			Player *d_ = (Player *)d;
			sgetstr();
			if (d_.name.length > 0) {
				// already connected
				if (![d_.name isEqual:@(text)])
					conoutf(@"%@ is now known as %s",
					    d_.name, text);
			} else {
				// new client

				// send new players my info again
				c2sinit = false;







|
|
>
|
<










|







170
171
172
173
174
175
176
177
178
179
180

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
				if (mapchanged)
					setspawn(n, true);
			break;
		}
		// server requests next map
		case SV_MAPRELOAD: {
			getint(&p);
			OFString *nextmapalias = [OFString stringWithFormat:
			    @"nextmap_%@", getclientmap()];
			// look up map in the cycle
			OFString *map = getalias(nextmapalias);

			changemap(map != nil ? map : getclientmap());
			break;
		}

		// another client either connected or changed name/team
		case SV_INITC2S: {
			Player *d_ = (Player *)d;
			sgetstr();
			if (d_.name.length > 0) {
				// already connected
				if (![d_.name isEqual: @(text)])
					conoutf(@"%@ is now known as %s",
					    d_.name, text);
			} else {
				// new client

				// send new players my info again
				c2sinit = false;
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
			OFVector3D loc = d_.origin;
			playsound(S_DIE1 + rnd(2), &loc);
			d_.lifeSequence++;
			break;
		}

		case SV_FRAGS:
			OFAssert([players[cn] isKindOfClass:Player.class]);
			((Player *)players[cn]).frags = getint(&p);
			break;

		case SV_ITEMPICKUP:
			setspawn(getint(&p), false);
			getint(&p);
			break;







|







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
			OFVector3D loc = d_.origin;
			playsound(S_DIE1 + rnd(2), &loc);
			d_.lifeSequence++;
			break;
		}

		case SV_FRAGS:
			OFAssert([players[cn] isKindOfClass: Player.class]);
			((Player *)players[cn]).frags = getint(&p);
			break;

		case SV_ITEMPICKUP:
			setspawn(getint(&p), false);
			getint(&p);
			break;
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
		case SV_EDITENT: // coop edit of ent
		{
			unsigned int i = getint(&p);

			while (ents.count <= i) {
				Entity *e = [Entity entity];
				e.type = NOTUSED;
				[ents addObject:e];
			}

			int to = ents[i].type;
			ents[i].type = getint(&p);
			ents[i].x = getint(&p);
			ents[i].y = getint(&p);
			ents[i].z = getint(&p);







|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
		case SV_EDITENT: // coop edit of ent
		{
			unsigned int i = getint(&p);

			while (ents.count <= i) {
				Entity *e = [Entity entity];
				e.type = NOTUSED;
				[ents addObject: e];
			}

			int to = ents[i].type;
			ents[i].type = getint(&p);
			ents[i].x = getint(&p);
			ents[i].y = getint(&p);
			ents[i].z = getint(&p);
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
			addmsg(0, 2, SV_CLIENTPING,
			    Player.player1.ping = (Player.player1.ping * 5 +
			                              lastmillis - getint(&p)) /
			        6);
			break;

		case SV_CLIENTPING:
			OFAssert([players[cn] isKindOfClass:Player.class]);
			((Player *)players[cn]).ping = getint(&p);
			break;

		case SV_GAMEMODE:
			nextmode = getint(&p);
			break;








|







368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
			addmsg(0, 2, SV_CLIENTPING,
			    Player.player1.ping = (Player.player1.ping * 5 +
			                              lastmillis - getint(&p)) /
			        6);
			break;

		case SV_CLIENTPING:
			OFAssert([players[cn] isKindOfClass: Player.class]);
			((Player *)players[cn]).ping = getint(&p);
			break;

		case SV_GAMEMODE:
			nextmode = getint(&p);
			break;