From a5a4a5ae14a7e44e5c4b325c36dbb1722d82a3e1 Mon Sep 17 00:00:00 2001 From: driAn Date: Fri, 23 May 2008 19:54:06 +0000 Subject: [PATCH] fixed player hud during spectate git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2090 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 2 +- source/src/renderhud.cpp | 2 +- source/src/sound.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index f7086111..e15e4b49 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -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); diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 6efaf5dd..bd9c9034 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -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); diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 39ad91fd..7bbad89e 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -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