6cd5790ea8
Renamed module to simply "ns". Module is mostly untested until NS beta 5 is release.
46 lines
713 B
C++
Executable File
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);
|
|
} |