All pastes #791555 Raw Edit

Meins

public text v1 · immutable
·published 2007-11-20 23:15 UTC
rendered paste body
			case NETMSG_KILLALLUNITS: {
				const int player = inbuf[3];
				if ((player < 0) || (player >= MAX_PLAYERS)) {
					logOutput.Print("Got invalid player num %i in KillAllUnits message", player);
				}
				CUnitSet* tu = &gs->Team(player)->units;
				for(CUnitSet::iterator ui = tu->begin(); ui != tu->end(); ++ui) {
					if ((*ui) != NULL)
					{
						if ((*ui)->beingBuilt) {
							(*ui)->KillUnit(false, true, NULL); // kill units under construction without explosion
						}
						else {
							(*ui)->KillUnit(true, false, NULL);
						}
					}
				}
				AddTraffic(player, packetCode, dataLength);
				break;
			}