[nexuiz-commits] r7063 - in trunk/data: . gfx/hud qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Jun 20 16:33:40 EDT 2009
Author: div0
Date: 2009-06-20 16:33:40 -0400 (Sat, 20 Jun 2009)
New Revision: 7063
Modified:
trunk/data/bots.txt
trunk/data/defaultNexuiz.cfg
trunk/data/gfx/hud/sb_timerbg.tga
trunk/data/gfx/hud/sbar.tga
trunk/data/qcsrc/server/miscfunctions.qc
Log:
new cvar bot_sound_monopoly allows only bots to make noise; new sbar background
Modified: trunk/data/bots.txt
===================================================================
--- trunk/data/bots.txt 2009-06-20 17:59:51 UTC (rev 7062)
+++ trunk/data/bots.txt 2009-06-20 20:33:40 UTC (rev 7063)
@@ -1,21 +1,33 @@
-//bot configuration: name model skin shirt-color pants-color team-override
-//default team values (team-override): 1 = red, 2 = blue, 3 = yellow, 4 = pink
-//use -1 for shirt-color or pants-color to get random colors
-Hellfire carni 0 4 0 0
-Toxic carni 1 14 7 0
-Discovery crash 0 2 6 0
-Pegasus grunt 0 13 11 0
-Eureka headhunter 0 12 7 0
-Airhead insurrectionist 0 11 1 0
-Gator lurk 0 3 10 0
-Delirium lurk 1 8 12 0
-Death lycanthrope 0 4 11 0
-Scorcher marine 0 13 13 0
-Necrotic nexus 0 12 14 0
-Dominator nexus 1 3 9 0
-Thunderstorm nexus 2 13 6 0
-Mystery pyria 0 9 14 0
-Lion shock 0 0 4 0
-Sensible skadi 0 9 9 0
-Shadow specop 0 4 8 0
-Resurrection visitant 0 1 1 0
\ No newline at end of file
+Megumi Hayashibara leilei 0 13 13 0
+Atsuko "Nuku Nuku" Natsume felicia 0 9 9 0
+Ryunosuke Natsume marine 0 0 0 0
+[Mishima]Akiko Natsume pyria 0 12 12 0
+[Mishima]Eimi angelyss 1 1 1 0
+Duke Nukem nexus 2 4 4 0
+Duke Nukum nexus 2 4 4 0
+LeChuck lycanthrope 0 15 15 0
+Guybrush Threepwood marine 0 4 4 0
+Rene Rottingham insurrectionist 0 12 12 0
+Elaine Threepwood specop 0 4 4 0
+Stan marine 0 13 13 0
+Voodoo Lady jeandarc 1 1 1 0
+Murray The Invincible Demonic Skull headhunter 0 0 0 0
+Haggis McMutton shock 0 2 2 0
+Cutthroat Bill shock 0 2 2 0
+Edward van Helgen shock 0 2 2 0
+El Pollo Diablo carni 0 2 2 0
+Herman Toothrot insurrectionist 0 3 3 0
+Wally B. Feed marine 0 8 8 0
+Minni Stronnie Goodsoup skadi 0 11 11 0
+Charles DeGoulash marine 0 11 11 0
+King Andre shock 0 14 14 0
+Cruff nexus 1 14 14 0
+[BS]Ozzy Osbourne soldier 0 5 5 0
+[BS]Tony Iommi soldier 0 5 5 0
+[BS]Geezer Butler soldier 0 5 5 0
+[BS]Bill Ward soldier 0 5 5 0
+Wario spy 0 4 4 0
+Mario spy 0 4 4 0
+Bomberman spy 0 13 13 0
+Richard Paul Astley marine 0 15 15 0
+Florence Foster Jenkins angelyss 1 4 4 0
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-06-20 17:59:51 UTC (rev 7062)
+++ trunk/data/defaultNexuiz.cfg 2009-06-20 20:33:40 UTC (rev 7063)
@@ -1576,3 +1576,4 @@
set menu_updatecheck 1
set bot_navigation_ignoreplayers 0 // FIXME remove this once the issue is solved
+set bot_sound_monopoly 0 "when enabled, only bots can make any noise"
Modified: trunk/data/gfx/hud/sb_timerbg.tga
===================================================================
(Binary files differ)
Modified: trunk/data/gfx/hud/sbar.tga
===================================================================
(Binary files differ)
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2009-06-20 17:59:51 UTC (rev 7062)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2009-06-20 20:33:40 UTC (rev 7063)
@@ -1116,7 +1116,7 @@
// Sound functions
string precache_sound (string s) = #19;
-void(entity e, float chan, string samp, float vol, float atten) sound = #8;
+void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
float precache_sound_index (string s) = #19;
#define SND_VOLUME 1
@@ -1124,9 +1124,46 @@
#define SND_LARGEENTITY 8
#define SND_LARGESOUND 16
+float sound_allowed(float dest, entity e)
+{
+ // sounds from world may always pass
+ if(!e)
+ {
+ return TRUE;
+ }
+ // sounds to self may always pass
+ if(dest == MSG_ONE)
+ {
+ if(e == msg_entity)
+ return TRUE;
+ if(e.owner == msg_entity)
+ return TRUE;
+ }
+ // sounds by players can be removed
+ if(cvar("bot_sound_monopoly"))
+ {
+ if(clienttype(e) == CLIENTTYPE_REAL)
+ return FALSE;
+ if(clienttype(e.owner) == CLIENTTYPE_REAL)
+ return FALSE;
+ }
+ // anything else may pass
+ return TRUE;
+}
+
+void sound(entity e, float chan, string samp, float vol, float atten)
+{
+ if(!sound_allowed(MSG_BROADCAST, e))
+ return;
+ sound_builtin(e, chan, samp, vol, atten);
+}
void soundtoat(float dest, entity e, vector o, float chan, string samp, float vol, float atten)
{
float entno, idx;
+
+ if(!sound_allowed(dest, e))
+ return;
+
entno = num_for_edict(e);
idx = precache_sound_index(samp);
@@ -1172,6 +1209,10 @@
void soundto(float dest, entity e, float chan, string samp, float vol, float atten)
{
vector o;
+
+ if(!sound_allowed(dest, e))
+ return;
+
o = e.origin + 0.5 * (e.mins + e.maxs);
soundtoat(dest, e, o, chan, samp, vol, atten);
}
@@ -1182,6 +1223,10 @@
void stopsoundto(float dest, entity e, float chan)
{
float entno;
+
+ if(!sound_allowed(dest, e))
+ return;
+
entno = num_for_edict(e);
if(entno >= 8192)
@@ -1211,6 +1256,9 @@
}
void stopsound(entity e, float chan)
{
+ if(!sound_allowed(MSG_BROADCAST, e))
+ return;
+
stopsoundto(MSG_BROADCAST, e, chan); // unreliable, gets there fast
stopsoundto(MSG_ALL, e, chan); // in case of packet loss
}
@@ -1237,6 +1285,9 @@
// use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
float spamsound(entity e, float chan, string samp, float vol, float atten)
{
+ if(!sound_allowed(MSG_BROADCAST, e))
+ return FALSE;
+
if(time > e.announcetime)
{
e.announcetime = time;
@@ -1249,6 +1300,10 @@
void play2team(float t, string filename)
{
local entity head;
+
+ if(cvar("bot_sound_monopoly"))
+ return;
+
FOR_EACH_REALPLAYER(head)
{
if (head.team == t)
@@ -1258,6 +1313,9 @@
void play2all(string samp)
{
+ if(cvar("bot_sound_monopoly"))
+ return;
+
sound(world, CHAN_AUTO, samp, VOL_BASE, ATTN_NONE);
}
More information about the nexuiz-commits
mailing list