amxmodx/dlls/ns/ns/CSpawn.cpp
Steve Dudenhoeffer 6cd5790ea8 Initial import of mostly re-written NS module (also synced with ns2amx).
Renamed module to simply "ns".

Module is mostly untested until NS beta 5 is release.
2004-07-22 12:46:35 +00:00

46 lines
713 B
C++
Executable File

#include "ns.h"
void CSpawn::clear()
{
while (spawnpointinfo)
{
spawnpointInfo* a = spawnpointinfo->next;
delete spawnpointinfo;
spawnpointinfo = a;
}
}
void CSpawn::put(int type, vec3_t location)
{
spawnpointinfo = new spawnpointInfo(type, location, spawnpointinfo);
}
float CSpawn::getnum(int type)
{
float iTemp=0.0;
spawnpointInfo *a = spawnpointinfo;
while (a)
{
if (a->type == type)
iTemp+=1.0;
a = a->next;
}
return iTemp;
}
vec3_t CSpawn::getpoint(int type, int num)
{
int iTemp=0;
spawnpointInfo *a = spawnpointinfo;
while (a)
{
if (a->type == type)
{
iTemp++;
if (iTemp == num)
{
return a->location;
}
}
a=a->next;
}
return Vector(0.0,0.0,0.0);
}