fixed player hud during spectate
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2090 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -76,9 +76,9 @@ void pickupeffects(int n, playerent *d)
|
||||
entity &e = ents[n];
|
||||
e.spawned = false;
|
||||
if(!d) return;
|
||||
if(d!=player1 && d->type!=ENT_BOT) return;
|
||||
d->pickup(e.type);
|
||||
itemstat &is = d->itemstats(e.type);
|
||||
if(d!=player1 && d->type!=ENT_BOT) return;
|
||||
if(&is)
|
||||
{
|
||||
if(d==player1) playsoundc(is.sound);
|
||||
|
||||
@@ -375,7 +375,7 @@ void drawteamicons(int w, int h)
|
||||
void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater)
|
||||
{
|
||||
playerent *p = camera1->type==ENT_PLAYER ? (playerent *)camera1 : player1;
|
||||
bool spectating = p->isspectating();
|
||||
bool spectating = player1->isspectating();
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include "vorbis/vorbisfile.h"
|
||||
#endif
|
||||
|
||||
bool nosound = true;
|
||||
static bool nosound = true;
|
||||
static bool sourcesavail = true;
|
||||
ALCdevice *device = NULL;
|
||||
ALCcontext *context = NULL;
|
||||
|
||||
@@ -718,6 +719,7 @@ void soundcleanup()
|
||||
gamesounds.setsizenodelete(0);
|
||||
mapsounds.setsizenodelete(0);
|
||||
locations.setsizenodelete(0);
|
||||
sourcesavail = true;
|
||||
|
||||
gamemusic.reset();
|
||||
|
||||
@@ -731,6 +733,7 @@ void clearsounds()
|
||||
mapsounds.setsizenodelete(0);
|
||||
loopv(locations) locations[i].reset();
|
||||
locations.setsizenodelete(0);
|
||||
sourcesavail = true;
|
||||
}
|
||||
|
||||
void checkmapsounds()
|
||||
@@ -887,7 +890,6 @@ void playsound(int n, physent *p, entity *ent, const vec *v, int priority)
|
||||
if(ent && s.maxuses && s.uses >= s.maxuses) return;
|
||||
|
||||
// AC sound scheduler
|
||||
static bool sourcesavail = true;
|
||||
location *loc = NULL;
|
||||
loopv(locations) if(!locations[i].inuse) loc = &locations[i]; // get free item
|
||||
if(!loc && sourcesavail) // create new and try generating a source
|
||||
|
||||
Reference in New Issue
Block a user