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;
}