bot & sound cleanups
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1829 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -28,9 +28,7 @@ CBotManager BotManager;
|
||||
CBotManager::~CBotManager(void)
|
||||
{
|
||||
EndMap();
|
||||
|
||||
while(m_StoredBots.Empty() == false)
|
||||
delete m_StoredBots.Pop();
|
||||
ClearStoredBots();
|
||||
}
|
||||
|
||||
void CBotManager::Init()
|
||||
|
||||
@@ -151,9 +151,10 @@ void disconnect(int onlyclean, int async)
|
||||
player1->clientnum = -1;
|
||||
player1->lifesequence = 0;
|
||||
player1->clientrole = CR_DEFAULT;
|
||||
if(m_botmode) BotManager.EndMap();
|
||||
kickallbots();
|
||||
loopv(players) zapplayer(players[i]);
|
||||
clearvote();
|
||||
clearsounds();
|
||||
localdisconnect();
|
||||
}
|
||||
if(!connpeer && clienthost)
|
||||
|
||||
@@ -195,6 +195,7 @@ void freebotent(botent *d)
|
||||
loopv(players) if(players[i]==d)
|
||||
{
|
||||
DELETEP(players[i]);
|
||||
players.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -419,6 +419,7 @@ struct botent : playerent
|
||||
float targetyaw; // monster wants to look in this direction
|
||||
|
||||
botent() : pBot(NULL), enemy(NULL) { type = ENT_BOT; }
|
||||
~botent() { }
|
||||
|
||||
int deaths() { return lifesequence; }
|
||||
};
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ void cleanup(char *msg) // single program exit point;
|
||||
{
|
||||
abortconnect();
|
||||
disconnect(1);
|
||||
cleansound();
|
||||
soundcleanup();
|
||||
cleanupserver();
|
||||
}
|
||||
SDL_ShowCursor(1);
|
||||
|
||||
+2
-2
@@ -434,11 +434,11 @@ extern void playsound(int n, entity *e, int priority = SP_NORMAL);
|
||||
extern void playsound(int n, const vec *v, int priority = SP_NORMAL);
|
||||
extern void playsoundc(int n);
|
||||
extern void initsound();
|
||||
extern void cleansound();
|
||||
extern void soundcleanup();
|
||||
extern void checkmapsounds();
|
||||
extern void checkplayerloopsounds();
|
||||
extern void music(char *name, char *cmd);
|
||||
extern void clearmapsounds();
|
||||
extern void clearsounds();
|
||||
|
||||
// rendermodel
|
||||
extern void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, float yaw, float pitch, float speed = 0, int basetime = 0, playerent *d = NULL, modelattach *a = NULL, float scale = 1.0f);
|
||||
|
||||
@@ -537,7 +537,7 @@ COMMAND(registersound, ARG_4STR);
|
||||
void mapsound(char *name, char *vol, char *maxuses, char *loop) { addsound(name, atoi(vol), atoi(maxuses), atoi(loop) != 0, mapsounds); }
|
||||
COMMAND(mapsound, ARG_4STR);
|
||||
|
||||
void cleansound()
|
||||
void soundcleanup()
|
||||
{
|
||||
if(nosound) return;
|
||||
stopsound();
|
||||
@@ -549,13 +549,10 @@ void cleansound()
|
||||
alutExit();
|
||||
}
|
||||
|
||||
void clearmapsounds()
|
||||
void clearsounds()
|
||||
{
|
||||
loopv(locations) if(locations[i].e && locations[i].inuse)
|
||||
{
|
||||
locations[i].reset();
|
||||
}
|
||||
mapsounds.setsizenodelete(0);
|
||||
locations.setsizenodelete(0);
|
||||
}
|
||||
|
||||
void checkmapsounds()
|
||||
|
||||
@@ -271,7 +271,7 @@ void empty_world(int factor, bool force) // main empty world creation routine
|
||||
if(!force && noteditmode()) return;
|
||||
cleardlights();
|
||||
pruneundos();
|
||||
clearmapsounds();
|
||||
clearsounds();
|
||||
sqr *oldworld = world;
|
||||
bool copy = false;
|
||||
if(oldworld && factor<0) { factor = sfactor+1; copy = true; }
|
||||
|
||||
@@ -233,7 +233,7 @@ bool load_world(char *mname) // still supports all map formats that have
|
||||
preparectf(true);
|
||||
cleardlights();
|
||||
pruneundos();
|
||||
clearmapsounds();
|
||||
clearsounds();
|
||||
setnames(mname);
|
||||
gzFile f = opengzfile(cgzname, "rb9");
|
||||
if(!f) { conoutf("\f3could not read map %s", cgzname); return false; }
|
||||
|
||||
Reference in New Issue
Block a user