All pastes #339303 Raw Edit

Mine

public cpp v1 · immutable
·published 2007-02-04 00:13 UTC
rendered paste body
const char* EChannel::FindEntityName(ECPlayer* pl){	static Entity_ID num;	if(sizeof num != 3)		throw ECExcept(VIName(sizeof num), "La taille de Entity_ID n'est pas celle supportée par cette fonction");	num[0] = 'A';	num[1] = 'A';	num[2] = '\0';	bool unchecked = false;	BEntityVector ev = pl ? pl->Entities()->List() : Map()->Neutres()->List();	do	{		BEntityVector::iterator it;		for(it = ev.begin(); it != ev.end() && strcmp((*it)->ID(), num); it++);		if(it == ev.end())			unchecked = true;		else		{			ev.erase(it);			if(num[1] < 'Z') num[1]++;			else if(num[0] >= 'Z') break;			else			{				num[0]++;				num[1] = 'A';			}		}	} while(!unchecked);	if(!unchecked)		throw ECExcept(VBName(unchecked), "Il y a trop d'unités !!");	return num;}