]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
gmqcc has vector bit operations now. Switch to using them.
authorRudolf Polzer <divverent@xonotic.org>
Fri, 30 Aug 2013 07:40:22 +0000 (09:40 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 30 Aug 2013 07:40:22 +0000 (09:40 +0200)
This also gets rid of the ugly WEPSET macros.

New design limit of weapon count: 72 weapons (currently set to 24 to use
less bandwidth, though).

142 files changed:
qcsrc/Makefile
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/announcer.qc
qcsrc/client/casings.qc
qcsrc/client/csqc_constants.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/gibs.qc
qcsrc/client/hook.qc
qcsrc/client/hud.qc
qcsrc/client/laser.qc
qcsrc/client/mapvoting.qc
qcsrc/client/movetypes.qc
qcsrc/client/movetypes.qh
qcsrc/client/projectile.qc
qcsrc/client/scoreboard.qc
qcsrc/client/sys-post.qh
qcsrc/client/sys-pre.qh
qcsrc/client/target_music.qc
qcsrc/client/tturrets.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/constants.qh
qcsrc/common/deathtypes.qh
qcsrc/common/items.qc
qcsrc/common/items.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/notifications.qh
qcsrc/common/urllib.qh
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/csqcmodellib/cl_model.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/csqcmodellib/interpolate.qc
qcsrc/csqcmodellib/sv_model.qc
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/keycodes.qc
qcsrc/dpdefs/menudefs.qc
qcsrc/dpdefs/progsdefs.qc
qcsrc/menu/draw.qh
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/colorbutton.c
qcsrc/menu/xonotic/dialog.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/menu/xonotic/keybinder.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/navigation.qh
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qh
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/radarmap.qh
qcsrc/server/command/vote.qc
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/func_breakable.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_hook.qh
qcsrc/server/g_lights.qc
qcsrc/server/g_models.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator_dodging.qc
qcsrc/server/mutators/mutator_melee_only.qc
qcsrc/server/mutators/mutator_minstagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/mutators/mutator_pinata.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/mutators/mutator_touchexplode.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/playerstats.qh
qcsrc/server/portals.qc
qcsrc/server/scores.qc
qcsrc/server/sv_main.qc
qcsrc/server/sys-post.qh
qcsrc/server/sys-pre.qh
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/target_music.qc
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/include/turrets_early.qh
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_phaser.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/vehicles/vehicles_def.qh
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rifle.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_uzi.qc
qcsrc/server/waypointsprites.qc
qcsrc/warpzonelib/common.qc

index 3c90dd1664c841e384d77fa2d5cdbd6071179961..a10ccd2fd11f5ed318068b0c60e18807f0c14495 100644 (file)
@@ -5,36 +5,17 @@ QCC ?= gmqcc
 
 QCCVERSIONFILE := qccversion.$(shell $(QCC) --version > qccversion.txt && git hash-object qccversion.txt)
 
-QCCFLAGS ?= \
-       -std=fteqcc \
-       -Werror -Wall \
-       -Wcpp \
+# We eventually need to get rid of these.
+QCCFLAGS_WTFS ?= \
        -Wno-field-redeclared \
        -Wno-double-declaration \
-       -Wno-uninitialized-global \
-       -Wno-parenthesis \
-       -O3 \
-       -fadjust-vector-fields \
-       -fftepp \
-       -fftepp-predefs \
-       -frelaxed-switch \
-       -fshort-logic \
-       -fno-perl-logic \
-       -ftranslatable-strings \
-       -fno-initialized-nonconstants \
-       -fno-assign-function-types \
-       -flno \
-       -fcorrect-ternary \
-       -fno-single-vector-defs \
-       -fcorrect-logic \
-       -ftrue-empty-strings \
-       -fno-false-empty-strings \
-       -futf8 \
-       -fno-bail-on-werror \
-       -floop-labels \
-       -funtyped-nil \
-       -fno-permissive \
-       -fvariadic-args \
+
+QCCFLAGS ?= \
+       -std=gmqcc \
+       -O3 -flno \
+       -Werror -fno-bail-on-werror -Wall \
+       -fftepp -fftepp-predefs -Wcpp -futf8 \
+       $(QCCFLAGS_WTFS) \
        $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
 
 # xonotic build system overrides this by command line argument to turn off the update-cvarcount step
index 42fadc0c18a86b0cc0cec1eb145409adebe08efb..8e36cc9b549a85873c0ea2ecca3c0bb4ee69eddc 100644 (file)
@@ -720,7 +720,7 @@ void Ent_ReadSpawnEvent(float is_new)
                        }
                        if(autocvar_cl_spawn_event_sound)
                        {
-                               sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTEN_NORM);
                        }
                }
        }
index 44f8236f2f55cb859b9a04e3b5eff1d58567c433..55329d46443449f7224875dd1ca0c626829b909b 100644 (file)
@@ -1,10 +1,5 @@
 entity porto;
 vector polyline[16];
-float Q3SURFACEFLAG_SLICK = 2; // low friction surface
-float DPCONTENTS_SOLID = 1; // blocks player movement
-float DPCONTENTS_BODY = 32; // blocks player movement
-float DPCONTENTS_CORPSE = 64; // blocks player movement
-float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
 void Porto_Draw()
 {
        vector p, dir, ang, q, nextdir;
@@ -350,8 +345,8 @@ void PostInit(void);
 void CSQC_Demo_Camera();
 float HUD_WouldDrawScoreboard();
 float camera_mode;
-float CAMERA_FREE = 1;
-float CAMERA_CHASE = 2;
+const float CAMERA_FREE = 1;
+const float CAMERA_CHASE = 2;
 float reticle_type;
 string NextFrameCommand;
 void CSQC_SPIDER_HUD();
@@ -480,7 +475,7 @@ void CSQC_UpdateView(float w, float h)
        // event chase camera
        if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
        {
-               if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead) || intermission)
+               if((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission)
                {
                        // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
                        vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
@@ -805,11 +800,11 @@ void CSQC_UpdateView(float w, float h)
        // the view to go back to normal, so reticle_type would become 0 as we fade out)
        if(spectatee_status || is_dead || hud != HUD_NORMAL)
                reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
-       else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_RIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
+       else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_MINSTANEX) && (button_zoom || zoomscript_caught))
                reticle_type = 2; // nex zoom
        else if(button_zoom || zoomscript_caught)
                reticle_type = 1; // normal zoom
-       else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_RIFLE && button_attack2)
+       else if((activeweapon == WEP_NEX) && button_attack2)
                reticle_type = 2; // nex zoom
     
        if(reticle_type && autocvar_cl_reticle)
@@ -1072,7 +1067,7 @@ void CSQC_UpdateView(float w, float h)
        if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
        {
                if(time - hit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
-                       sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+                       sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTEN_NONE);
                        
                nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
        }
@@ -1080,7 +1075,7 @@ void CSQC_UpdateView(float w, float h)
        if(typehit_time > nextsound_typehit_time) 
        {
                if(time - typehit_time < MAX_TIME_DIFF) // don't play the sound if it's too old.
-                       sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+                       sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTEN_NONE);
                        
                nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
        }
index 7a4ed9223ad090d0549c5453e3e930819e9281c7..d335af3dd979a17a053885ab03deeb5f3f3577d1 100644 (file)
@@ -2,7 +2,7 @@ void Announcer_Play(string announcement)
 {
        /*if((announcement != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam)))
        {
-               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announcement, ".wav"), VOL_BASEVOICE, ATTEN_NONE);
 
                if(previous_announcement) { strunzone(previous_announcement); }
                
index 70ed9f4b07d74b597a39d67968bf99bdba7cd807..2225c0f35260d6ac88320cc2027939d4ba5d528e 100644 (file)
@@ -11,7 +11,7 @@ void Casing_Draw()
        {
                self.move_angles_x = 0;
                self.move_angles_z = 0;
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
        }
 
        Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
@@ -57,7 +57,7 @@ void Casing_Touch()
                                                break;
                                }
 
-                               sound (self, CH_SHOTS, s, VOL_BASE, ATTN_LARGE);
+                               sound (self, CH_SHOTS, s, VOL_BASE, ATTEN_LARGE);
                        }
                }
        }
@@ -70,7 +70,7 @@ void Casing_Damage(float thisdmg, float hittype, vector org, vector thisforce)
        if(thisforce_z < 0)
                thisforce_z = 0;
        self.move_velocity = self.move_velocity + thisforce + '0 0 100';
-       self.move_flags &~= FL_ONGROUND;
+       self.move_flags &= ~FL_ONGROUND;
 }
 
 void Ent_Casing(float isNew)
index 1cd7d1f3ba2af45f40d605a2371ff98a267b162d..0016196bac4f615bb0df44c5893d771ec95f0d49 100644 (file)
@@ -159,13 +159,13 @@ const float BUTTON_16 = 262144;
 #define        SOLID_BSP                               4               // bsp clip, touch on edge, block
 #define        SOLID_CORPSE                    5               // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
 
-float MOVE_NORMAL = 0; // same as FALSE
-float MOVE_NOMONSTERS = 1; // same as TRUE
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-float MOVE_HITMODEL = 4;
-float MOVE_WORLDONLY = 3;
+const float MOVE_NORMAL = 0; // same as FALSE
+const float MOVE_NOMONSTERS = 1; // same as TRUE
+const float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+const float MOVE_HITMODEL = 4;
+const float MOVE_WORLDONLY = 3;
 
-float CAMERA_FREE = 1;
-float CAMERA_CHASE = 2;
+const float CAMERA_FREE = 1;
+const float CAMERA_CHASE = 2;
 
-float EF_NOMODELFLAGS = 8388608;
+const float EF_NOMODELFLAGS = 8388608;
index 264f4797e58915db809e3154ddfbf73a97305c83..b2c98e4ed4aab27040de2b888c0a6ef1a5f3431c 100644 (file)
@@ -452,22 +452,22 @@ void CSQCModel_AutoTagIndex_Apply(void)
 }
 
 // FEATURE: EF_NODRAW workalike
-float EF_BRIGHTFIELD   = 1;
-float EF_BRIGHTLIGHT   = 4;
-float EF_DIMLIGHT      = 8;
-float EF_DOUBLESIDED = 32768;
-float EF_NOSELFSHADOW = 65536;
-float EF_DYNAMICMODELLIGHT = 131072;
-float EF_RESTARTANIM_BIT = 1048576;
-float EF_TELEPORT_BIT = 2097152;
-float MF_ROCKET  =   1; // leave a trail
-float MF_GRENADE =   2; // leave a trail
-float MF_GIB     =   4; // leave a trail
-float MF_ROTATE  =   8; // rotate (bonus items)
-float MF_TRACER  =  16; // green split trail
-float MF_ZOMGIB  =  32; // small blood trail
-float MF_TRACER2 =  64; // orange split trail
-float MF_TRACER3 = 128; // purple trail
+const float EF_BRIGHTFIELD     = 1;
+const float EF_BRIGHTLIGHT     = 4;
+const float EF_DIMLIGHT        = 8;
+const float EF_DOUBLESIDED = 32768;
+const float EF_NOSELFSHADOW = 65536;
+const float EF_DYNAMICMODELLIGHT = 131072;
+const float EF_RESTARTANIM_BIT = 1048576;
+const float EF_TELEPORT_BIT = 2097152;
+const float MF_ROCKET  =   1; // leave a trail
+const float MF_GRENADE =   2; // leave a trail
+const float MF_GIB     =   4; // leave a trail
+const float MF_ROTATE  =   8; // rotate (bonus items)
+const float MF_TRACER  =  16; // green split trail
+const float MF_ZOMGIB  =  32; // small blood trail
+const float MF_TRACER2 =  64; // orange split trail
+const float MF_TRACER3 = 128; // purple trail
 .float csqcmodel_effects;
 .float csqcmodel_modelflags;
 void CSQCModel_Effects_PreUpdate(void)
@@ -488,9 +488,9 @@ void CSQCModel_Effects_PostUpdate(void)
 void CSQCModel_Effects_Apply(void)
 {
        float eff = self.csqcmodel_effects;
-       eff &~= CSQCMODEL_EF_RESPAWNGHOST;
+       eff &= ~CSQCMODEL_EF_RESPAWNGHOST;
 
-       self.renderflags &~= (RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
+       self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
        self.effects = 0;
        self.traileffect = 0;
                        
index bbc8f88043453a3e0338b02fccbfef6d00955ba2..cd7ac7bfa468a1e8422ddb7c131bc9784a0e6436 100644 (file)
@@ -182,7 +182,7 @@ void Ent_DamageInfo(float isNew)
                        if(vlen(thisforce))
                        {
                                self.move_velocity = self.move_velocity + damage_explosion_calcpush(self.damageforcescale * thisforce, self.move_velocity, autocvar_g_balance_damagepush_speedfactor);
-                               self.move_flags &~= FL_ONGROUND;
+                               self.move_flags &= ~FL_ONGROUND;
                        }
 
                if(w_issilent)
@@ -218,33 +218,33 @@ void Ent_DamageInfo(float isNew)
                        case DEATH_VH_SPID_MINIGUN:
                                string _snd;
                                _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
-                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_ROCKET:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_DEATH:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
             
                        case DEATH_VH_WAKI_GUN:
-                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_ROCKET:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_DEATH:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
                                
                        case DEATH_VH_RAPT_CANNON:
-                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_FRAGMENT:
@@ -256,19 +256,19 @@ void Ent_DamageInfo(float isNew)
                                        ang = vectoangles(vel);
                                        RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
                                }
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_BOMB:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_DEATH:
-                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_BUMB_GUN:
-                               sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                }
@@ -289,38 +289,38 @@ void Ent_DamageInfo(float isNew)
                switch(w_deathtype)
                {   
                         case DEATH_TURRET_EWHEEL:
-                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                         
                         case DEATH_TURRET_FLAC:
                                pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
                                _snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw");
-                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                break;
                                
                         case DEATH_TURRET_MLRS:
                         case DEATH_TURRET_HK:
                         case DEATH_TURRET_WALK_ROCKET:
                         case DEATH_TURRET_HELLION:
-                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
                         
                         case DEATH_TURRET_MACHINEGUN:
                         case DEATH_TURRET_WALK_GUN:
                                _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
-                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                                                  
                         case DEATH_TURRET_PLASMA:
-                               sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
                                break;
                                                  
                         case DEATH_TURRET_WALK_MEELE:
-                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_MIN);
+                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN);
                                pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
                                break;
 
index 9e1c6e7a1395faf93d89ca7234aad0d031bdbbf2..afd61edab20461e3c61d67efcb0d819ccf4e6f89 100644 (file)
@@ -73,7 +73,7 @@ void Gib_Touch()
        }
 
        if(!self.silent)
-               sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTN_NORM);
+               sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM);
        pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
 
        Gib_Delete();
@@ -205,7 +205,7 @@ void Ent_GibSplash(float isNew)
        {
                case 0x01:
                        if(!issilent)
-                               sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);
+                               sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTEN_NORM);
 
                        if(prandom() < amount)
                                TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
index 11070bae5cfe4c10500e36db2b5b3c7bb6607ffb..ab489153011cb2303905e28d04f3ce16d90be8ee 100644 (file)
@@ -59,7 +59,7 @@ void Draw_GrapplingHook()
        if(self.teleport_time)
        if(time > self.teleport_time)
        {
-               sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM); // safeguard
+               sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); // safeguard
                self.teleport_time = 0;
        }
 
@@ -215,7 +215,7 @@ void Draw_GrapplingHook()
 
 void Remove_GrapplingHook()
 {
-       sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
 }
 
 void Ent_ReadHook(float bIsNew, float type)
@@ -275,10 +275,10 @@ void Ent_ReadHook(float bIsNew, float type)
                                self.drawmask = MASK_NORMAL;
                                break;
                        case ENT_CLIENT_LGBEAM:
-                               sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTN_NORM);
+                               sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM);
                                break;
                        case ENT_CLIENT_GAUNTLET:
-                               sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTN_NORM);
+                               sound (self, CH_SHOTS_SINGLE, "weapons/gauntletbeam_fly.wav", VOL_BASE, ATTEN_NORM);
                                break;
                }
        }
index 5444c8ab086193bad827851da43384766a1c5835..d151a535678400ace2f7465b2a802b3bbdfb3bd6 100644 (file)
@@ -447,8 +447,7 @@ float GetAmmoTypeForWep(float i)
 void HUD_Weapons(void)
 {
        // declarations
-       WEPSET_DECLARE_A(weapons_stat);
-       WEPSET_COPY_AS(weapons_stat);
+       WepSet weapons_stat = WepSet_GetFromStat();
        float i, f, a;
        float screen_ar, center_x = 0, center_y;
        float weapon_count, weapon_id;
@@ -532,9 +531,9 @@ void HUD_Weapons(void)
        {
                if(autocvar__hud_configure)
                {
-                       if (WEPSET_EMPTY_A(weapons_stat))
+                       if (!weapons_stat)
                                for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                                       WEPSET_OR_AW(weapons_stat, i);
+                                       weapons_stat |= WepSet_FromWeapon(i);
 
                        if(menu_enabled != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
@@ -543,7 +542,7 @@ void HUD_Weapons(void)
                // do we own this weapon?
                weapon_count = 0;
                for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-                       if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon))
+                       if(weapons_stat & WepSet_FromWeapon(weaponorder[i].weapon))
                                ++weapon_count;
 
                // add it anyway if weaponcomplain is shown
@@ -735,7 +734,7 @@ void HUD_Weapons(void)
 
                // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
                if(autocvar_hud_panel_weapons_onlyowned)
-               if not(WEPSET_CONTAINS_AW(weapons_stat, self.weapon) || (self.weapon == complain_weapon))
+               if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
                        continue;
 
                // figure out the drawing position of weapon
@@ -759,7 +758,7 @@ void HUD_Weapons(void)
                }
 
                // drawing all the weapon items
-               if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon))
+               if(weapons_stat & WepSet_FromWeapon(self.weapon))
                {
                        // draw the weapon image
                        drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -3140,7 +3139,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
                if(autocvar_cl_autodemo_delete_keeprecords)
                {
                        f = autocvar_cl_autodemo_delete;
-                       f &~= 1;
+                       f &= ~1;
                        cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
                }
        }
index 03ea99303297efc1605599b11fe622017fe60334..49aa033c17ae3092f4acd65adbe9b151d424c98c 100644 (file)
 .float scale; // scaling factor of the thickness
 .float modelscale; // scaling factor of the dlight
 
-// TODO move these into a heade file
-float trace_dphitq3surfaceflags;
-float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-
 void Draw_Laser()
 {
        if(!self.state)
index 9feb6e826d500a5e5bad8129cd9e099f393fed89..107b25d712ad523caeeb3002f122fa18b1c0c2b4 100644 (file)
@@ -464,9 +464,9 @@ void MapVote_UpdateMask()
        else
                mv_maps_mask = ReadShort();
 
-       if(oldmask & mv_maps_mask != oldmask)
-               if(oldmask & mv_maps_mask == mv_maps_mask)
-                        sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
+       if((oldmask & mv_maps_mask) != oldmask)
+               if((oldmask & mv_maps_mask) == mv_maps_mask)
+                        sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTEN_NONE);
 
        // remove votes that no longer apply
        for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
index 49f35d891260d8a9b229a8561165b7055b58166a..0622aafe31903e567870fc064d63fb8eb6256fe8 100644 (file)
@@ -1,5 +1,5 @@
-float STAT_MOVEFLAGS = 225;
-float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
+const float STAT_MOVEFLAGS = 225;
+const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
 #define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
 
 .entity move_groundentity; // FIXME add move_groundnetworkentity?
@@ -220,7 +220,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
        if(self.move_flags & FL_ONGROUND)
        {
                if(self.move_velocity_z >= 1/32)
-                       self.move_flags &~= FL_ONGROUND;
+                       self.move_flags &= ~FL_ONGROUND;
                else if(!self.move_groundentity)
                        return;
                else if(self.move_suspendedinair && wasfreed(self.move_groundentity))
@@ -281,7 +281,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
                if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
                {
                        self.move_velocity = _Movetype_ClipVelocity(self.move_velocity, trace_plane_normal, 2.0);
-                       self.move_flags &~= FL_ONGROUND;
+                       self.move_flags &= ~FL_ONGROUND;
                }
                else if(self.move_movetype == MOVETYPE_BOUNCE)
                {
@@ -305,7 +305,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
                                self.move_avelocity = '0 0 0';
                        }
                        else
-                               self.move_flags &~= FL_ONGROUND;
+                               self.move_flags &= ~FL_ONGROUND;
                }
                else
                {
@@ -320,7 +320,7 @@ void _Movetype_Physics_Toss(float dt) // SV_Physics_Toss
                                self.move_avelocity = '0 0 0';
                        }
                        else
-                               self.move_flags &~= FL_ONGROUND;
+                               self.move_flags &= ~FL_ONGROUND;
                }
 
                // DP revision 8905 (just, WHY...)
index c6ab6543cb347efe7825c07c18cea339d25bb03a..9f39ffc7bc846f94eecd0ba3e85e3f27e9293a4c 100644 (file)
@@ -14,21 +14,21 @@ void Movetype_Physics_MatchTicrate(float tr, float sloppy);
 void Movetype_Physics_MatchServer(float sloppy);
 void Movetype_Physics_NoMatchServer();
 
-float  MOVETYPE_NONE                           = 0;
-float  MOVETYPE_ANGLENOCLIP                    = 1;
-float  MOVETYPE_ANGLECLIP                      = 2;
-float  MOVETYPE_WALK                           = 3;
-float  MOVETYPE_STEP                           = 4;
-float  MOVETYPE_FLY                            = 5;
-float  MOVETYPE_TOSS                           = 6;
-float  MOVETYPE_PUSH                           = 7;
-float  MOVETYPE_NOCLIP                         = 8;
-float  MOVETYPE_FLYMISSILE                     = 9;
-float  MOVETYPE_BOUNCE                         = 10;
-float  MOVETYPE_BOUNCEMISSILE  = 11;   // Like bounce but doesn't lose speed on bouncing
-float MOVETYPE_FOLLOW = 12;
-float MOVETYPE_FAKEPUSH = 13;
-float MOVETYPE_FLY_WORLDONLY = 33;
+const float    MOVETYPE_NONE                           = 0;
+const float    MOVETYPE_ANGLENOCLIP                    = 1;
+const float    MOVETYPE_ANGLECLIP                      = 2;
+const float    MOVETYPE_WALK                           = 3;
+const float    MOVETYPE_STEP                           = 4;
+const float    MOVETYPE_FLY                            = 5;
+const float    MOVETYPE_TOSS                           = 6;
+const float    MOVETYPE_PUSH                           = 7;
+const float    MOVETYPE_NOCLIP                         = 8;
+const float    MOVETYPE_FLYMISSILE                     = 9;
+const float    MOVETYPE_BOUNCE                         = 10;
+const float    MOVETYPE_BOUNCEMISSILE  = 11;   // Like bounce but doesn't lose speed on bouncing
+const float MOVETYPE_FOLLOW = 12;
+const float MOVETYPE_FAKEPUSH = 13;
+const float MOVETYPE_FLY_WORLDONLY = 33;
 
-float   FL_ITEM                 = 256;
-float  FL_ONGROUND                             = 512;
+const float   FL_ITEM                 = 256;
+const float    FL_ONGROUND                             = 512;
index de45141a136c1bb71aba06fafa4de21ad7fa027b..b86c234bdbba9062e6b121cb745efc96050a6351 100644 (file)
@@ -58,7 +58,7 @@ void Projectile_Draw()
 
        if(self.count & 0x80)
        {
-               //self.move_flags &~= FL_ONGROUND;
+               //self.move_flags &= ~FL_ONGROUND;
                if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
                        Movetype_Physics_NoMatchServer();
                        // the trivial movetypes do not have to match the
@@ -226,7 +226,7 @@ void Ent_Projectile()
        if(f & 0x40)
                self.move_flags |= FL_ONGROUND;
        else
-               self.move_flags &~= FL_ONGROUND;
+               self.move_flags &= ~FL_ONGROUND;
 
        if(!self.move_time)
        {
@@ -352,7 +352,7 @@ void Ent_Projectile()
                {
                        case PROJECTILE_ELECTRO:
                                // only new engines support sound moving with object
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
                                self.mins = '0 0 -4';
                                self.maxs = '0 0 -4';
                                self.move_movetype = MOVETYPE_BOUNCE;
@@ -361,7 +361,7 @@ void Ent_Projectile()
                                self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
                                break;
                        case PROJECTILE_ROCKET:
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTEN_NORM);
                                self.mins = '-3 -3 -3';
                                self.maxs = '3 3 3';
                                break;
@@ -430,12 +430,12 @@ void Ent_Projectile()
                                self.move_touch = func_null;
                                break;
                        case PROJECTILE_FIREBALL:
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTEN_NORM);
                                self.mins = '-16 -16 -16';
                                self.maxs = '16 16 16';
                                break;
                        case PROJECTILE_FIREMINE:
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTEN_NORM);
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = func_null;
                                self.mins = '-4 -4 -4';
@@ -450,7 +450,7 @@ void Ent_Projectile()
                                self.maxs = '2 2 2';
                                break;
                        case PROJECTILE_SEEKER:
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
                                self.mins = '-4 -4 -4';
                                self.maxs = '4 4 4';
                                break;
@@ -463,17 +463,17 @@ void Ent_Projectile()
             case PROJECTILE_RAPTORCANNON:
                                break;
             case PROJECTILE_SPIDERROCKET:
-                loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+                loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
                                break;
             case PROJECTILE_WAKIROCKET:
-                loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+                loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM);
                                break;            
             /*
             case PROJECTILE_WAKICANNON:
                                break;
                        case PROJECTILE_BUMBLE_GUN:
                                // only new engines support sound moving with object
-                               loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
+                               loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM);
                                self.mins = '0 0 -4';
                                self.maxs = '0 0 -4';
                                self.move_movetype = MOVETYPE_BOUNCE;
index 743e4b76d7bd9af97d949eab7a6027174b0c918b..6544c738bbc344a36f6959335316d4815194a642 100644 (file)
@@ -9,7 +9,7 @@ float scoreboard_alpha_name_self;
 void drawstringright(vector, string, vector, vector, float, float);
 void drawstringcenter(vector, string, vector, vector, float, float);
 
-float SCOREBOARD_OFFSET = 50;
+const float SCOREBOARD_OFFSET = 50;
 
 // wrapper to put all possible scores titles through gettext
 string TranslateScoresLabel(string l)
index 4fee9fec0572fb9d3cc4d10c4e5b990adc6e3e59..a883039fed0366b574c9acfe4e4bb7df093c95d2 100644 (file)
@@ -1,6 +1,6 @@
 #pragma noref 0
 
-#undef ATTN_NORM
+#undef ATTEN_NORM
 
 #ifdef COMPAT_050_ENGINE
 // WORKAROUND for 0.5.0 engine
index 1dac05bc1618592848eaf97ddc88e4b914400ce5..8ebe91903bcd4c6df2e935d7ce8a30a9217acd1a 100644 (file)
@@ -4,7 +4,7 @@
 
 #define CSQC
 
-#define ATTN_NORM builtin_ATTN_NORM
+#define ATTEN_NORM builtin_ATTEN_NORM
 
 #ifdef COMPAT_050_ENGINE
 // WORKAROUND for 0.5.0 engine
index 4bbbf03bc574582bb9981296d334e6ccc6998b9c..f30e77af424007e8aebd4d8805c1fea2e19359f8 100644 (file)
@@ -44,9 +44,9 @@ void TargetMusic_Advance()
                if(vol != vol0)
                {
                        if(vol0 < 0)
-                               sound(e, CH_BGM_SINGLE, e.noise, vol, ATTN_NONE); // restart
+                               sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart
                        else
-                               sound(e, CH_BGM_SINGLE, "", vol, ATTN_NONE);
+                               sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE);
                        e.lastvol = vol;
                }
        }
@@ -88,7 +88,7 @@ void Net_TargetMusic()
                        strunzone(e.noise);
                e.noise = strzone(noi);
                precache_sound(e.noise);
-               sound(e, CH_BGM_SINGLE, e.noise, 0, ATTN_NONE);
+               sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
                if(getsoundtime(e, CH_BGM_SINGLE) < 0)
                {
                        print(sprintf(_("Cannot initialize sound %s\n"), e.noise));
@@ -177,7 +177,7 @@ void Ent_ReadTriggerMusic()
                if(self.noise != s)
                {
                        precache_sound(self.noise);
-                       sound(self, CH_BGM_SINGLE, self.noise, 0, ATTN_NONE);
+                       sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
                        if(getsoundtime(self, CH_BGM_SINGLE) < 0)
                        {
                                print(sprintf(_("Cannot initialize sound %s\n"), self.noise));
index 24deed681f68447507443dd458d69a9dab249a2f..161bfa385a1b3f1c32690429fbdecbdb231d93e1 100644 (file)
@@ -509,7 +509,7 @@ void turret_gibboom()
 {
     float i;
     
-    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
 
     for (i = 1; i < 5; i = i + 1)
@@ -556,7 +556,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
 void turret_die()
 {    
     
-    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
     turret_tid2info(self.turret_type);
     if (!autocvar_cl_nogibs)
index a6dbcef10305d55c3c7ca9f299067d0f3a8ba4ee..c95185d74cd6340efd98fca485cefac781f9cf2a 100644 (file)
@@ -131,8 +131,8 @@ void Net_VehicleSetup()
     // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
     if(hud_id == 0)
     {
-        sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
-        sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);    
+        sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
+        sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);    
         return;
     }
     
@@ -272,7 +272,7 @@ void CSQC_BUMBLE_HUD()
         if(alarm1time < time)
         {
             alarm1time = time + 2;
-            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
@@ -282,7 +282,7 @@ void CSQC_BUMBLE_HUD()
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm1time)
         {
-            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm1time = 0;
         }        
     }
@@ -301,7 +301,7 @@ void CSQC_BUMBLE_HUD()
         if(alarm2time < time)
         {
             alarm2time = time + 1;
-            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }
@@ -310,7 +310,7 @@ void CSQC_BUMBLE_HUD()
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm2time)
         {            
-            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm2time = 0;
         }
     }
@@ -422,7 +422,7 @@ void CSQC_BUMBLE_GUN_HUD()
         if(alarm1time < time)
         {
             alarm1time = time + 2;
-            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
@@ -432,7 +432,7 @@ void CSQC_BUMBLE_GUN_HUD()
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm1time)
         {
-            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm1time = 0;
         }        
     }
@@ -451,7 +451,7 @@ void CSQC_BUMBLE_GUN_HUD()
         if(alarm2time < time)
         {
             alarm2time = time + 1;
-            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }
@@ -460,7 +460,7 @@ void CSQC_BUMBLE_GUN_HUD()
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm2time)
         {            
-            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm2time = 0;
         }
     }
@@ -543,7 +543,7 @@ void CSQC_SPIDER_HUD()
         if(alarm1time < time)
         {
             alarm1time = time + 2;
-            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
         }        
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }        
@@ -552,7 +552,7 @@ void CSQC_SPIDER_HUD()
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm1time)
         {
-            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm1time = 0;
         }        
     }
@@ -570,7 +570,7 @@ void CSQC_SPIDER_HUD()
         if(alarm2time < time)
         {
             alarm2time = time + 1;
-            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }
@@ -579,7 +579,7 @@ void CSQC_SPIDER_HUD()
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm2time)
         {            
-            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm2time = 0;
         }
     }
@@ -708,7 +708,7 @@ void CSQC_RAPTOR_HUD()
         if(alarm1time < time)
         {
             alarm1time = time + 2;
-            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
@@ -718,7 +718,7 @@ void CSQC_RAPTOR_HUD()
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm1time)
         {
-            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm1time = 0;
         }
     }
@@ -737,7 +737,7 @@ void CSQC_RAPTOR_HUD()
         if(alarm2time < time)
         {
             alarm2time = time + 1;
-            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }
@@ -746,7 +746,7 @@ void CSQC_RAPTOR_HUD()
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm2time)
         {            
-            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm2time = 0;
         }
     }
@@ -900,7 +900,7 @@ void CSQC_WAKIZASHI_HUD()
         if(alarm1time < time)
         {
             alarm1time = time + 2;
-            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
@@ -910,7 +910,7 @@ void CSQC_WAKIZASHI_HUD()
         drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm1time)
         {
-            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm1time = 0;
         }        
     }
@@ -930,7 +930,7 @@ void CSQC_WAKIZASHI_HUD()
         if(alarm2time < time)
         {
             alarm2time = time + 1;
-            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE);
         }
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL);
     }
@@ -939,7 +939,7 @@ void CSQC_WAKIZASHI_HUD()
         drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
         if(alarm2time)
         {            
-            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTN_NONE);
+            sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
             alarm2time = 0;
         }
     }
index 2066aec68c7dd189bfcd8c30e48f27b8f94f4ce9..a2ace4f46aa95059399d89a0667c74b44dcd8e5b 100644 (file)
@@ -38,14 +38,14 @@ float waypointsprite_alpha;
 .float build_starthealth;
 .float build_finished;
 
-float SPRITE_HEALTHBAR_WIDTH = 144;
-float SPRITE_HEALTHBAR_HEIGHT = 9;
-float SPRITE_HEALTHBAR_MARGIN = 6;
-float SPRITE_HEALTHBAR_BORDER = 2;
-float SPRITE_HEALTHBAR_BORDERALPHA = 1;
-float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
-float SPRITE_ARROW_SCALE = 1.0;
-float SPRITE_HELPME_BLINK = 2;
+const float SPRITE_HEALTHBAR_WIDTH = 144;
+const float SPRITE_HEALTHBAR_HEIGHT = 9;
+const float SPRITE_HEALTHBAR_MARGIN = 6;
+const float SPRITE_HEALTHBAR_BORDER = 2;
+const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
+const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
+const float SPRITE_ARROW_SCALE = 1.0;
+const float SPRITE_HELPME_BLINK = 2;
 
 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
 {
index 1a70b341d3d8118aef7ecff219d5c8bb13e445d0..b3dafaaf7ba7293813715bb1d1ae0aa673af8f14 100644 (file)
 // Revision 22: hook shot origin
 #define CSQC_REVISION 22
 
-const float AS_STRING          = 1;
-const float AS_INT             = 2;
-const float AS_FLOAT_TRUNCATED = 2;
-const float AS_FLOAT           = 8;
+const float AS_STRING = 1;
+const float AS_INT = 2;
+const float AS_FLOAT_TRUNCATED = 2;
+const float AS_FLOAT = 8;
 
 const float TE_CSQC_PICTURE = 100;
 const float TE_CSQC_RACE = 101;
@@ -121,21 +121,21 @@ const float RADARICON_TAGGED = 1;
 
 ///////////////////////////
 // keys pressed
-const float KEY_FORWARD                =       1;
-const float KEY_BACKWARD       =       2;
-const float KEY_LEFT           =       4;
-const float KEY_RIGHT          =       8;
-const float KEY_JUMP           =       16;
-const float KEY_CROUCH         =       32;
-const float KEY_ATCK           =       64;
-const float KEY_ATCK2          =       128;
+const float KEY_FORWARD = 1;
+const float KEY_BACKWARD = 2;
+const float KEY_LEFT = 4;
+const float KEY_RIGHT = 8;
+const float KEY_JUMP = 16;
+const float KEY_CROUCH = 32;
+const float KEY_ATCK = 64;
+const float KEY_ATCK2 = 128;
 
 ///////////////////////////
 // cvar constants
 
-float CVAR_SAVE        = 1;
-float CVAR_NOTIFY      = 2;
-float CVAR_READONLY    = 4;
+const float CVAR_SAVE = 1;
+const float CVAR_NOTIFY = 2;
+const float CVAR_READONLY = 4;
 
 ///////////////////////////
 // csqc communication stuff
@@ -166,12 +166,12 @@ const float STAT_HAGAR_LOAD = 57;
 const float STAT_SWITCHINGWEAPON = 58;
 const float STAT_SUPERWEAPONS_FINISHED = 59;
 
-const float STAT_VEHICLESTAT_HEALTH  = 60;
-const float STAT_VEHICLESTAT_SHIELD  = 61;
-const float STAT_VEHICLESTAT_ENERGY  = 62;
-const float STAT_VEHICLESTAT_AMMO1   = 63;
+const float STAT_VEHICLESTAT_HEALTH = 60;
+const float STAT_VEHICLESTAT_SHIELD = 61;
+const float STAT_VEHICLESTAT_ENERGY = 62;
+const float STAT_VEHICLESTAT_AMMO1 = 63;
 const float STAT_VEHICLESTAT_RELOAD1 = 64;
-const float STAT_VEHICLESTAT_AMMO2   = 65;
+const float STAT_VEHICLESTAT_AMMO2 = 65;
 const float STAT_VEHICLESTAT_RELOAD2 = 66;
 
 const float STAT_SECRETS_TOTAL = 70;
@@ -180,6 +180,9 @@ const float STAT_SECRETS_FOUND = 71;
 const float STAT_RESPAWN_TIME = 72;
 const float STAT_ROUNDSTARTTIME = 73;
 
+const float STAT_WEAPONS2 = 74;
+const float STAT_WEAPONS3 = 75;
+
 // mod stats (1xx)
 const float STAT_REDALIVE = 100;
 const float STAT_BLUEALIVE = 101;
@@ -197,8 +200,8 @@ const float STAT_DOM_PPS_BLUE = 102;
 const float STAT_DOM_PPS_PINK = 103;
 const float STAT_DOM_PPS_YELLOW = 104;
 
-//const float STAT_SPIDERBOT_AIM     53 // compressShotOrigin
-//const float STAT_SPIDERBOT_TARGET  54 // compressShotOrigin
+//const float STAT_SPIDERBOT_AIM 53 // compressShotOrigin
+//const float STAT_SPIDERBOT_TARGET 54 // compressShotOrigin
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
@@ -211,13 +214,13 @@ const float CTF_STATE_DEFEND = 2;
 const float CTF_STATE_COMMANDER = 3;
 
 const float HUD_NORMAL = 0;
-const float HUD_VEHICLE_FIRST   = 10;
-const float HUD_SPIDERBOT       = 10;
-const float HUD_WAKIZASHI       = 11;
-const float HUD_RAPTOR          = 12;
-const float HUD_BUMBLEBEE       = 13;
-const float HUD_BUMBLEBEE_GUN   = 14;
-const float HUD_VEHICLE_LAST    = 14;
+const float HUD_VEHICLE_FIRST = 10;
+const float HUD_SPIDERBOT = 10;
+const float HUD_WAKIZASHI = 11;
+const float HUD_RAPTOR = 12;
+const float HUD_BUMBLEBEE = 13;
+const float HUD_BUMBLEBEE_GUN = 14;
+const float HUD_VEHICLE_LAST = 14;
 
 const vector eX = '1 0 0';
 const vector eY = '0 1 0';
@@ -230,27 +233,27 @@ const vector eZ = '0 0 1';
 /**
  * Lower scores are better (e.g. suicides)
  */
-#define SFL_LOWER_IS_BETTER     1
+#define SFL_LOWER_IS_BETTER 1
 
 /**
  * Don't show zero values as scores
  */
-#define SFL_HIDE_ZERO           2
+#define SFL_HIDE_ZERO 2
 
 /**
  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
  */
-#define SFL_ALLOW_HIDE         16
+#define SFL_ALLOW_HIDE 16
 
 /**
  * Display as a rank (with st, nd, rd, th suffix)
  */
-#define SFL_RANK               32
+#define SFL_RANK 32
 
 /**
  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
  */
-#define SFL_TIME               64
+#define SFL_TIME 64
 
 // not an extra constant yet
 #define SFL_ZERO_IS_WORST SFL_TIME
@@ -259,8 +262,8 @@ const vector eZ = '0 0 1';
  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
  */
 #define SFL_SORT_PRIO_SECONDARY 4
-#define SFL_SORT_PRIO_PRIMARY   8
-#define SFL_SORT_PRIO_MASK     12
+#define SFL_SORT_PRIO_PRIMARY 8
+#define SFL_SORT_PRIO_MASK 12
 
 /**
  * Score indices
@@ -276,103 +279,103 @@ const vector eZ = '0 0 1';
 // game mode specific indices are not in common/, but in server/scores_rules.qc!
 
 #ifdef COMPAT_XON010_CHANNELS
-float CH_INFO = 0; // only on world and csqc
-float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info"
-float CH_WEAPON_A = 1; // only on players and entities
-float CH_WEAPON_SINGLE = 5; // only on players and entities
-float CH_VOICE = 2; // only on players
-float CH_BGM_SINGLE = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
-float CH_AMBIENT = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
-float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc
-float CH_SHOTS = 4; // only on players, entities, csqc
-float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc
-float CH_WEAPON_B = 5; // only on players and entities
-float CH_PAIN = 6; // only on players and csqc
-float CH_PAIN_SINGLE = 6; // only on players and csqc
-float CH_PLAYER = 7; // only on players and entities
-float CH_TUBA = 5; // only on csqc
+const float CH_INFO = 0; // only on world and csqc
+const float CH_TRIGGER = 0; // only on players; compat: FALSELY CONTROLLED BY "Info"
+const float CH_WEAPON_A = 1; // only on players and entities
+const float CH_WEAPON_SINGLE = 5; // only on players and entities
+const float CH_VOICE = 2; // only on players
+const float CH_BGM_SINGLE = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
+const float CH_AMBIENT = 2; // only on csqc; compat: FALSELY CONTROLLED BY "Voice"
+const float CH_TRIGGER_SINGLE = 3; // only on players, entities, csqc
+const float CH_SHOTS = 4; // only on players, entities, csqc
+const float CH_SHOTS_SINGLE = 4; // only on players, entities, csqc
+const float CH_WEAPON_B = 5; // only on players and entities
+const float CH_PAIN = 6; // only on players and csqc
+const float CH_PAIN_SINGLE = 6; // only on players and csqc
+const float CH_PLAYER = 7; // only on players and entities
+const float CH_TUBA = 5; // only on csqc
 #else
-float CH_INFO = 0;
-float CH_TRIGGER = -3;
-float CH_WEAPON_A = -1;
-float CH_WEAPON_SINGLE = 1;
-float CH_VOICE = -2;
-float CH_BGM_SINGLE = 8;
-float CH_AMBIENT = -9;
-float CH_TRIGGER_SINGLE = 3;
-float CH_SHOTS = -4;
-float CH_SHOTS_SINGLE = 4;
-float CH_WEAPON_B = -1;
-float CH_PAIN = -6;
-float CH_PAIN_SINGLE = 6;
-float CH_PLAYER = -7;
-float CH_TUBA = 5;
+const float CH_INFO = 0;
+const float CH_TRIGGER = -3;
+const float CH_WEAPON_A = -1;
+const float CH_WEAPON_SINGLE = 1;
+const float CH_VOICE = -2;
+const float CH_BGM_SINGLE = 8;
+const float CH_AMBIENT = -9;
+const float CH_TRIGGER_SINGLE = 3;
+const float CH_SHOTS = -4;
+const float CH_SHOTS_SINGLE = 4;
+const float CH_WEAPON_B = -1;
+const float CH_PAIN = -6;
+const float CH_PAIN_SINGLE = 6;
+const float CH_PLAYER = -7;
+const float CH_TUBA = 5;
 #endif
 
-float  ATTN_NONE                               = 0;
-float  ATTN_MIN                                = 0.015625;
-float  ATTN_NORM                               = 0.5;
-float  ATTN_LARGE                              = 1;
-float  ATTN_IDLE                               = 2;
-float  ATTN_STATIC                             = 3;
-float  ATTN_MAX                                = 3.984375;
+const float ATTEN_NONE = 0;
+const float ATTEN_MIN = 0.015625;
+const float ATTEN_NORM = 0.5;
+const float ATTEN_LARGE = 1;
+const float ATTEN_IDLE = 2;
+const float ATTEN_STATIC = 3;
+const float ATTEN_MAX = 3.984375;
 
 #define VOL_BASE 0.7
 #define VOL_BASEVOICE 1.0
 
 // this sets sounds and other properties of the projectiles in csqc
-float PROJECTILE_ELECTRO = 1;
-float PROJECTILE_ROCKET = 2;
-float PROJECTILE_TAG = 3;
-float PROJECTILE_BULLET = 4;
-float PROJECTILE_CRYLINK = 5;
-float PROJECTILE_ELECTRO_BEAM = 6;
-float PROJECTILE_GRENADE = 7;
-float PROJECTILE_GRENADE_BOUNCING = 8;
-float PROJECTILE_MINE = 9;
-float PROJECTILE_LASER = 10;
-float PROJECTILE_HLAC = 11;
-float PROJECTILE_SEEKER = 12;
-float PROJECTILE_FLAC = 13;
-float PROJECTILE_PORTO_RED = 14;
-float PROJECTILE_PORTO_BLUE = 15;
-float PROJECTILE_HOOKBOMB = 16;
-float PROJECTILE_HAGAR = 17;
-float PROJECTILE_HAGAR_BOUNCING = 18;
-float PROJECTILE_BULLET_GLOWING = 19;
-float PROJECTILE_CRYLINK_BOUNCING = 20;
-float PROJECTILE_FIREBALL = 21;
-float PROJECTILE_FIREMINE = 22;
-float PROJECTILE_BULLET_GLOWING_TRACER = 23;
-
-float PROJECTILE_RAPTORCANNON   = 24;
-float PROJECTILE_RAPTORBOMB     = 25;
-float PROJECTILE_RAPTORBOMBLET  = 26;
-float PROJECTILE_SPIDERROCKET   = 27;
-float PROJECTILE_WAKIROCKET     = 28;
-float PROJECTILE_WAKICANNON     = 29;
-
-float PROJECTILE_BUMBLE_GUN     = 30;
-float PROJECTILE_BUMBLE_BEAM    = 31;
-
-float PROJECTILE_NADE_RED              = 50;
-float PROJECTILE_NADE_RED_BURN         = 51;
-float PROJECTILE_NADE_BLUE             = 52;
-float PROJECTILE_NADE_BLUE_BURN        = 53;
-float PROJECTILE_NADE_YELLOW           = 54;
-float PROJECTILE_NADE_YELLOW_BURN      = 55;
-float PROJECTILE_NADE_PINK             = 56;
-float PROJECTILE_NADE_PINK_BURN        = 57;
-float PROJECTILE_NADE                          = 58;
-float PROJECTILE_NADE_BURN                     = 59;
-
-float SPECIES_HUMAN        =  0;
-float SPECIES_ROBOT_SOLID  =  1;
-float SPECIES_ALIEN        =  2;
-float SPECIES_ANIMAL       =  3;
-float SPECIES_ROBOT_RUSTY  =  4;
-float SPECIES_ROBOT_SHINY  =  5;
-float SPECIES_RESERVED     = 15;
+const float PROJECTILE_ELECTRO = 1;
+const float PROJECTILE_ROCKET = 2;
+const float PROJECTILE_TAG = 3;
+const float PROJECTILE_BULLET = 4;
+const float PROJECTILE_CRYLINK = 5;
+const float PROJECTILE_ELECTRO_BEAM = 6;
+const float PROJECTILE_GRENADE = 7;
+const float PROJECTILE_GRENADE_BOUNCING = 8;
+const float PROJECTILE_MINE = 9;
+const float PROJECTILE_LASER = 10;
+const float PROJECTILE_HLAC = 11;
+const float PROJECTILE_SEEKER = 12;
+const float PROJECTILE_FLAC = 13;
+const float PROJECTILE_PORTO_RED = 14;
+const float PROJECTILE_PORTO_BLUE = 15;
+const float PROJECTILE_HOOKBOMB = 16;
+const float PROJECTILE_HAGAR = 17;
+const float PROJECTILE_HAGAR_BOUNCING = 18;
+const float PROJECTILE_BULLET_GLOWING = 19;
+const float PROJECTILE_CRYLINK_BOUNCING = 20;
+const float PROJECTILE_FIREBALL = 21;
+const float PROJECTILE_FIREMINE = 22;
+const float PROJECTILE_BULLET_GLOWING_TRACER = 23;
+
+const float PROJECTILE_RAPTORCANNON = 24;
+const float PROJECTILE_RAPTORBOMB = 25;
+const float PROJECTILE_RAPTORBOMBLET = 26;
+const float PROJECTILE_SPIDERROCKET = 27;
+const float PROJECTILE_WAKIROCKET = 28;
+const float PROJECTILE_WAKICANNON = 29;
+
+const float PROJECTILE_BUMBLE_GUN = 30;
+const float PROJECTILE_BUMBLE_BEAM = 31;
+
+const float PROJECTILE_NADE_RED = 50;
+const float PROJECTILE_NADE_RED_BURN = 51;
+const float PROJECTILE_NADE_BLUE = 52;
+const float PROJECTILE_NADE_BLUE_BURN = 53;
+const float PROJECTILE_NADE_YELLOW = 54;
+const float PROJECTILE_NADE_YELLOW_BURN = 55;
+const float PROJECTILE_NADE_PINK = 56;
+const float PROJECTILE_NADE_PINK_BURN = 57;
+const float PROJECTILE_NADE = 58;
+const float PROJECTILE_NADE_BURN = 59;
+
+const float SPECIES_HUMAN = 0;
+const float SPECIES_ROBOT_SOLID = 1;
+const float SPECIES_ALIEN = 2;
+const float SPECIES_ANIMAL = 3;
+const float SPECIES_ROBOT_RUSTY = 4;
+const float SPECIES_ROBOT_SHINY = 5;
+const float SPECIES_RESERVED = 15;
 
 #define FRAGS_PLAYER 0
 #define FRAGS_SPECTATOR -666
@@ -381,28 +384,28 @@ float SPECIES_RESERVED     = 15;
 // we can use this frags value for both
 
 // water levels
-float WATERLEVEL_NONE = 0;
-float WATERLEVEL_WETFEET = 1;
-float WATERLEVEL_SWIMMING = 2;
-float WATERLEVEL_SUBMERGED = 3;
+const float WATERLEVEL_NONE = 0;
+const float WATERLEVEL_WETFEET = 1;
+const float WATERLEVEL_SWIMMING = 2;
+const float WATERLEVEL_SUBMERGED = 3;
 
-float MAX_SHOT_DISTANCE = 32768;
+const float MAX_SHOT_DISTANCE = 32768;
 
 // weapon requests
-float WR_SETUP         = 1; // (SVQC) setup weapon data
-float WR_THINK         = 2; // (SVQC) logic to run every frame
-float WR_CHECKAMMO1    = 3; // (SVQC) checks ammo for weapon
-float WR_CHECKAMMO2    = 4; // (SVQC) checks ammo for weapon
-float WR_AIM           = 5; // (SVQC) runs bot aiming code for this weapon
-float WR_PRECACHE      = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
-float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
-float WR_KILLMESSAGE    = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
-float WR_RELOAD         = 9; // (SVQC) does not need to do anything
-float WR_RESETPLAYER    = 10; // (SVQC) does not need to do anything
-float WR_IMPACTEFFECT  = 11; // (CSQC) impact effect
-float WR_SWITCHABLE    = 12; // (CSQC) impact effect
-float WR_PLAYERDEATH    = 13; // (SVQC) does not need to do anything
-float WR_GONETHINK     = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
+const float WR_SETUP = 1; // (SVQC) setup weapon data
+const float WR_THINK = 2; // (SVQC) logic to run every frame
+const float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
+const float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
+const float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
+const float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+const float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
+const float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
+const float WR_RELOAD = 9; // (SVQC) does not need to do anything
+const float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
+const float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
+const float WR_SWITCHABLE = 12; // (CSQC) impact effect
+const float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
+const float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
 
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
 #define SERVERFLAG_TEAMPLAY 2
@@ -436,17 +439,17 @@ noref var vector autocvar_sv_player_headsize = '24 24 12';
 #define PL_HEAD_z autocvar_sv_player_headsize_z
 
 // spawnpoint prios
-#define SPAWN_PRIO_NEAR_TEAMMATE_FOUND    200
+#define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
 #define SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM 100
-#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN     50
-#define SPAWN_PRIO_GOOD_DISTANCE           10
+#define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
+#define SPAWN_PRIO_GOOD_DISTANCE 10
 
 // URI handles
-#define URI_GET_DISCARD              0
-#define URI_GET_IPBAN                1
-#define URI_GET_IPBAN_END           16
-#define URI_GET_CURL                17
-#define URI_GET_CURL_END            32
-#define URI_GET_UPDATENOTIFICATION  33
-#define URI_GET_URLLIB             128
-#define URI_GET_URLLIB_END         191
+#define URI_GET_DISCARD 0
+#define URI_GET_IPBAN 1
+#define URI_GET_IPBAN_END 16
+#define URI_GET_CURL 17
+#define URI_GET_CURL_END 32
+#define URI_GET_UPDATENOTIFICATION 33
+#define URI_GET_URLLIB 128
+#define URI_GET_URLLIB_END 191
index 48a269b1a3937271f6e4b10c297d20adac78f629..e17cd330e643f16b5e5a720b75c56d5d3f4250ec 100644 (file)
@@ -104,10 +104,10 @@ string Deathtype_Name(float deathtype)
        else { return ftos(deathtype); }
 }
 
-float DEATH_WEAPONMASK = 0xFF;
-float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
-float HITTYPE_SECONDARY = 0x100;
-float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
-float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_RESERVED2 = 0x800;
-float HITTYPE_RESERVED = 0x1000; // unused yet
+const float DEATH_WEAPONMASK = 0xFF;
+const float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
+const float HITTYPE_SECONDARY = 0x100;
+const float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
+const float HITTYPE_BOUNCE = 0x400;
+const float HITTYPE_RESERVED2 = 0x800;
+const float HITTYPE_RESERVED = 0x1000; // unused yet
index c961895d95c157aac7ad2439541f9babbd82f557..19173079fa0f1b1b198323c3d6a1b1f7c61e8b7f 100644 (file)
@@ -2,13 +2,80 @@
 entity weapon_info[WEP_MAXCOUNT];
 entity dummy_weapon_info;
 
-void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
+#if WEP_MAXCOUNT > 72
+# error Kein Weltraum links auf dem Gerät
+#endif
+
+WepSet WepSet_FromWeapon(float a) {
+       a -= WEP_FIRST;
+#if WEP_MAXCOUNT > 24
+       if(a >= 24) {
+               a -= 24;
+#if WEP_MAXCOUNT > 48
+               if(a >= 24) {
+                       a -= 24;
+                       return '0 0 1' * power2of(a);
+               }
+#endif
+               return '0 1 0' * power2of(a);
+       }
+#endif
+       return '1 0 0' * power2of(a);
+}
+#ifdef SVQC
+void WepSet_AddStat()
+{
+       addstat(STAT_WEAPONS, AS_INT, weapons_x);
+#if WEP_MAXCOUNT > 24
+       addstat(STAT_WEAPONS2, AS_INT, weapons_y);
+#if WEP_MAXCOUNT > 48
+       addstat(STAT_WEAPONS3, AS_INT, weapons_z);
+#endif
+#endif
+}
+void WriteWepSet(float dst, WepSet w)
+{
+#if WEP_MAXCOUNT > 48
+       WriteInt72_t(dst, w);
+#elif WEP_MAXCOUNT > 24
+       WriteInt48_t(dst, w);
+#else
+       WriteInt24_t(dst, w_x);
+#endif
+}
+#endif
+#ifdef CSQC
+WepSet WepSet_GetFromStat()
+{
+       WepSet w = '0 0 0';
+       w_x = getstati(STAT_WEAPONS);
+#if WEP_MAXCOUNT > 24
+       w_y = getstati(STAT_WEAPONS2);
+#if WEP_MAXCOUNT > 48
+       w_z = getstati(STAT_WEAPONS3);
+#endif
+#endif
+       return w;
+}
+WepSet ReadWepSet()
+{
+#if WEP_MAXCOUNT > 48
+       return ReadInt72_t();
+#elif WEP_MAXCOUNT > 24
+       return ReadInt48_t();
+#else
+       return ReadInt24_t() * '1 0 0';
+#endif
+}
+#endif
+
+void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
 {
        entity e;
        weapon_info[id - 1] = e = spawn();
        e.classname = "weapon_info";
        e.weapon = id;
-       WEPSET_COPY_EW(e, id);
+       e.weapons = bit;
        e.netname = shortname;
        e.message = wname;
        e.items = ammotype;
@@ -41,7 +108,7 @@ void register_weapons_done()
        dummy_weapon_info = spawn();
        dummy_weapon_info.classname = "weapon_info";
        dummy_weapon_info.weapon = 0; // you can recognize dummies by this
-       WEPSET_CLEAR_E(dummy_weapon_info);
+       dummy_weapon_info.weapons = '0 0 0';
        dummy_weapon_info.netname = "";
        dummy_weapon_info.message = "AOL CD Thrower";
        dummy_weapon_info.items = 0;
@@ -157,20 +224,20 @@ string W_FixWeaponOrder_ForceComplete(string order)
 void W_RandomWeapons(entity e, float n)
 {
        float i, j;
-       WEPSET_DECLARE_A(remaining);
-       WEPSET_DECLARE_A(result);
-       WEPSET_COPY_AE(remaining, e);
-       WEPSET_CLEAR_A(result);
+       WepSet remaining;
+       WepSet result;
+       remaining = e.weapons;
+       result = '0 0 0';
        for(i = 0; i < n; ++i)
        {
                RandomSelection_Init();
                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
-                       if(WEPSET_CONTAINS_AW(remaining, j))
+                       if(remaining & WepSet_FromWeapon(j))
                                RandomSelection_Add(world, j, string_null, 1, 1);
-               WEPSET_OR_AW(result, RandomSelection_chosen_float);
-               WEPSET_ANDNOT_AW(remaining, RandomSelection_chosen_float);
+               result |= WepSet_FromWeapon(RandomSelection_chosen_float);
+               remaining &= ~WepSet_FromWeapon(RandomSelection_chosen_float);
        }
-       WEPSET_COPY_EA(e, result);
+       e.weapons = result;
 }
 
 string W_Name(float weaponid)
index ba42d55ac62ecfffe98b046e1465055bbf607ce2..45510437fcf50e830ad97026d587040468495423 100644 (file)
@@ -1,57 +1,57 @@
-float BOT_PICKUP_RATING_LOW    = 2500;
-float BOT_PICKUP_RATING_MID    = 5000;
-float BOT_PICKUP_RATING_HIGH   = 10000;
-
-float WEP_TYPE_OTHER         =  0x00; // not for damaging people
-float WEP_TYPE_SPLASH        =  0x01; // splash damage
-float WEP_TYPE_HITSCAN       =  0x02; // hitscan
-float WEP_TYPEMASK            =  0x0F;
-float WEP_FLAG_CANCLIMB       =  0x10; // can be used for movement
-float WEP_FLAG_NORMAL         =  0x20; // in "most weapons" set
-float WEP_FLAG_HIDDEN         =  0x40; // hides from menu
-float WEP_FLAG_RELOADABLE     =  0x80; // can has reload
-float WEP_FLAG_SUPERWEAPON    = 0x100; // powerup timer
-float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
-
-float  IT_UNLIMITED_WEAPON_AMMO     = 1;
+const float BOT_PICKUP_RATING_LOW      = 2500;
+const float BOT_PICKUP_RATING_MID      = 5000;
+const float BOT_PICKUP_RATING_HIGH     = 10000;
+
+const float WEP_TYPE_OTHER           =  0x00; // not for damaging people
+const float WEP_TYPE_SPLASH          =  0x01; // splash damage
+const float WEP_TYPE_HITSCAN         =  0x02; // hitscan
+const float WEP_TYPEMASK            =  0x0F;
+const float WEP_FLAG_CANCLIMB       =  0x10; // can be used for movement
+const float WEP_FLAG_NORMAL         =  0x20; // in "most weapons" set
+const float WEP_FLAG_HIDDEN         =  0x40; // hides from menu
+const float WEP_FLAG_RELOADABLE     =  0x80; // can has reload
+const float WEP_FLAG_SUPERWEAPON    = 0x100; // powerup timer
+const float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
+
+const float    IT_UNLIMITED_WEAPON_AMMO     = 1;
 // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-float  IT_UNLIMITED_SUPERWEAPONS    = 2;
+const float    IT_UNLIMITED_SUPERWEAPONS    = 2;
 // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
-float   IT_CTF_SHIELDED              = 4; // set for the flag shield
-float   IT_USING_JETPACK             = 8; // confirmation that button is pressed
-float   IT_JETPACK                   = 16; // actual item
-float   IT_FUEL_REGEN                = 32; // fuel regeneration trigger
-float   IT_SHELLS                    = 256;
-float   IT_NAILS                     = 512;
-float   IT_ROCKETS                   = 1024;
-float   IT_CELLS                     = 2048;
-float   IT_SUPERWEAPON               = 4096;
-float   IT_FUEL                      = 128;
-float   IT_STRENGTH                  = 8192;
-float   IT_INVINCIBLE                = 16384;
-float   IT_HEALTH                    = 32768;
+const float   IT_CTF_SHIELDED              = 4; // set for the flag shield
+const float   IT_USING_JETPACK             = 8; // confirmation that button is pressed
+const float   IT_JETPACK                   = 16; // actual item
+const float   IT_FUEL_REGEN                = 32; // fuel regeneration trigger
+WANT_CONST float   IT_SHELLS                    = 256;
+WANT_CONST float   IT_NAILS                     = 512;
+WANT_CONST float   IT_ROCKETS                   = 1024;
+WANT_CONST float   IT_CELLS                     = 2048;
+const float   IT_SUPERWEAPON               = 4096;
+const float   IT_FUEL                      = 128;
+const float   IT_STRENGTH                  = 8192;
+const float   IT_INVINCIBLE                = 16384;
+const float   IT_HEALTH                    = 32768;
 // union:
        // for items:
-       float   IT_KEY1                                 = 131072;
-       float   IT_KEY2                                 = 262144;
+       WANT_CONST float        IT_KEY1                                 = 131072;
+       WANT_CONST float        IT_KEY2                                 = 262144;
        // for players:
-       float   IT_RED_FLAG_TAKEN               = 32768;
-       float   IT_RED_FLAG_LOST                = 65536;
-       float   IT_RED_FLAG_CARRYING            = 98304;
-       float   IT_BLUE_FLAG_TAKEN              = 131072;
-       float   IT_BLUE_FLAG_LOST               = 262144;
-       float   IT_BLUE_FLAG_CARRYING   = 393216;
+       const float     IT_RED_FLAG_TAKEN               = 32768;
+       const float     IT_RED_FLAG_LOST                = 65536;
+       const float     IT_RED_FLAG_CARRYING            = 98304;
+       const float     IT_BLUE_FLAG_TAKEN              = 131072;
+       const float     IT_BLUE_FLAG_LOST               = 262144;
+       const float     IT_BLUE_FLAG_CARRYING   = 393216;
 // end
-float   IT_5HP                       = 524288;
-float   IT_25HP                      = 1048576;
-float   IT_ARMOR_SHARD               = 2097152;
-float   IT_ARMOR                     = 4194304;
+const float   IT_5HP                       = 524288;
+const float   IT_25HP                      = 1048576;
+const float   IT_ARMOR_SHARD               = 2097152;
+const float   IT_ARMOR                     = 4194304;
 
-float   IT_AMMO                      = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
-float   IT_PICKUPMASK                = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-float   IT_UNLIMITED_AMMO            = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+const float   IT_AMMO                      = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
+const float   IT_PICKUPMASK                = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+const float   IT_UNLIMITED_AMMO            = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
-float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
+const float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
 // variables:
 string weaponorder_byid;
@@ -70,8 +70,29 @@ string W_NumberWeaponOrder(string order);
 .float ammo_fuel;
 .float ammo_batteries; // dummy
 
+// Weapon sets
+typedef vector WepSet;
+WepSet WepSet_FromWeapon(float a);
+#ifdef SVQC
+void WepSet_AddStat();
+void WriteWepSet(float dest, WepSet w);
+#endif
+#ifdef CSQC
+WepSet WepSet_GetFromStat();
+WepSet ReadWepSet();
+#endif
+
+// Weapon name macros
+#define WEP_FIRST 1
+#define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much.
+float WEP_COUNT;
+float WEP_LAST;
+WepSet WEPSET_ALL;
+WepSet WEPSET_SUPERWEAPONS;
+
 // entity properties of weaponinfo:
 .float weapon; // WEP_...
+.WepSet weapons; // WEPSET_...
 .string netname; // short name
 .string message; // human readable name
 .float items; // IT_...
@@ -83,149 +104,33 @@ string W_NumberWeaponOrder(string order);
 .float bot_pickupbasevalue; // bot weapon priority
 .string model2; // wpn- sprite name
 ..float ammo_field; // main ammo field
-// also, weaponinfo ents can act as a WEPSET
 
 // dynamic weapon adding
 float w_null(float dummy);
-void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
+void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
 void register_weapons_done();
 
-#define WEP_FIRST 1
-float WEP_COUNT;
-float WEP_LAST;
-
-#if 1
-# define WEP_MAXCOUNT 24
-// default storage
-.float _WS_weapons;
-# define WEPSET_BIT(a)                  power2of((a) - WEP_FIRST)
-# define WEPSET_DECLARE_A(a)            float _WS_##a
-# define WEPSET_CLEAR_E(e)              ((e)._WS_weapons = 0)
-# define WEPSET_CLEAR_A(a)              (_WS_##a = 0)
-# define WEPSET_EMPTY_E(e)              ((e)._WS_weapons == 0)
-# define WEPSET_EMPTY_A(a)              (_WS_##a == 0)
-# define WEPSET_COPY_AS(a)              (_WS_##a = getstati(STAT_WEAPONS))
-# define WEPSET_ADDSTAT()               addstat(STAT_WEAPONS, AS_INT, _WS_weapons)
-# define WEPSET_WRITE_E(dest,a)         WriteInt24_t(dest, (a)._WS_weapons)
-# define WEPSET_WRITE_A(dest,a)         WriteInt24_t(dest, _WS_##a)
-# define WEPSET_WRITE_W(dest,a)         WriteInt24_t(dest, WEPSET_BIT(a))
-# define WEPSET_READ_E(a)               (a)._WS_weapons = ReadInt24_t()
-# define WEPSET_READ_A(a)               (_WS_##a) = ReadInt24_t()
-# define WEPSET_OP1_EE(a,b,mergeop,x)   ((a)._WS_weapons x (b)._WS_weapons)
-# define WEPSET_OP2_EE(a,b,mergeop,x,y) ((a)._WS_weapons x (b)._WS_weapons y (a)._WS_weapons)
-# define WEPSET_OP1_EA(a,b,mergeop,x)   ((a)._WS_weapons x _WS_##b)
-# define WEPSET_OP2_EA(a,b,mergeop,x,y) ((a)._WS_weapons x _WS_##b y (a)._WS_weapons)
-# define WEPSET_OP1_EW(a,b,mergeop,x)   ((a)._WS_weapons x WEPSET_BIT(b))
-# define WEPSET_OP2_EW(a,b,mergeop,x,y) ((a)._WS_weapons x WEPSET_BIT(b) y (a)._WS_weapons)
-# define WEPSET_OP1_AE(a,b,mergeop,x)   (_WS_##a x (b)._WS_weapons)
-# define WEPSET_OP2_AE(a,b,mergeop,x,y) (_WS_##a x (b)._WS_weapons y _WS_##a)
-# define WEPSET_OP1_AA(a,b,mergeop,x)   (_WS_##a x _WS_##b)
-# define WEPSET_OP2_AA(a,b,mergeop,x,y) (_WS_##a x _WS_##b y _WS_##a)
-# define WEPSET_OP1_AW(a,b,mergeop,x)   (_WS_##a x WEPSET_BIT(b))
-# define WEPSET_OP2_AW(a,b,mergeop,x,y) (_WS_##a x WEPSET_BIT(b) y _WS_##a)
-#else
-# define WEP_MAXCOUNT 48
-# define WEP_FIRST2 25
-.float _WS1_weapons;
-.float _WS2_weapons;
-# define WEPSET_BIT1(a)                 (((a) < WEP_FIRST2) ? power2of((a) - WEP_FIRST) : 0)
-# define WEPSET_BIT2(a)                 (((a) >= WEP_FIRST2) ? power2of((a) - WEP_FIRST2) : 0)
-# define WEPSET_DECLARE_A(a)            float _WS1_##a, _WS2_##a
-# define WEPSET_CLEAR_E(e)              ((e)._WS1_weapons = (e)._WS2_weapons = 0)
-# define WEPSET_CLEAR_A(a)              ((_WS1_##a) = (_WS2_##a) = 0)
-# define WEPSET_EMPTY_E(e)              ((e)._WS1_weapons == 0 && (e)._WS2_weapons == 0)
-# define WEPSET_EMPTY_A(a)              ((_WS1_##a) == 0 && (_WS2_##a) == 0)
-# define WEPSET_COPY_AS(a)              ((_WS1_##a) = getstati(STAT_WEAPONS), (_WS2_##a) = getstati(STAT_WEAPONS2))
-# define WEPSET_ADDSTAT()               addstat(STAT_WEAPONS, AS_INT, _WS1_weapons); addstat(STAT_WEAPONS2, AS_INT, _WS2_weapons)
-# define WEPSET_WRITE_E(dest,a)         WriteInt24_t(dest, (a)._WS1_weapons); WriteInt24_t(dest, (a)._WS2_weapons)
-# define WEPSET_WRITE_A(dest,a)         WriteInt24_t(dest, _WS1_##a); WriteInt24_t(dest, _WS2_##a)
-# define WEPSET_WRITE_W(dest,a)         WriteInt24_t(dest, WEPSET_BIT1(a)); WriteInt24_t(dest, WEPSET_BIT2(a))
-# define WEPSET_READ_E(a)               (a)._WS1_weapons = ReadInt24_t(); (a)._WS2_weapons = ReadInt24_t()
-# define WEPSET_READ_A(a)               (_WS1_##a) = ReadInt24_t(); (_WS2_##a) = ReadInt24_t()
-# define WEPSET_OP1_EE(a,b,mergeop,x)   (((a)._WS1_weapons x (b)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons))
-# define WEPSET_OP2_EE(a,b,mergeop,x,y) (((a)._WS1_weapons x (b)._WS1_weapons y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x (b)._WS2_weapons y (a)._WS2_weapons))
-# define WEPSET_OP1_EA(a,b,mergeop,x)   (((a)._WS1_weapons x _WS1_##b) mergeop ((a)._WS2_weapons x _WS2_##b))
-# define WEPSET_OP2_EA(a,b,mergeop,x,y) (((a)._WS1_weapons x _WS1_##b y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x _WS2_##b y (a)._WS2_weapons))
-# define WEPSET_OP1_EW(a,b,mergeop,x)   (((a)._WS1_weapons x WEPSET_BIT1(b)) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b)))
-# define WEPSET_OP2_EW(a,b,mergeop,x,y) (((a)._WS1_weapons x WEPSET_BIT1(b) y (a)._WS1_weapons) mergeop ((a)._WS2_weapons x WEPSET_BIT2(b) y (a)._WS2_weapons))
-# define WEPSET_OP1_AE(a,b,mergeop,x)   ((_WS1_##a x (b)._WS1_weapons) mergeop (_WS2_##a x (b)._WS2_weapons))
-# define WEPSET_OP2_AE(a,b,mergeop,x,y) ((_WS1_##a x (b)._WS1_weapons y _WS1_##a) mergeop (_WS2_##a x (b)._WS2_weapons y _WS2_##a))
-# define WEPSET_OP1_AA(a,b,mergeop,x)   ((_WS1_##a x _WS1_##b) mergeop (_WS2_##a x _WS2_##b))
-# define WEPSET_OP2_AA(a,b,mergeop,x,y) ((_WS1_##a x _WS1_##b y _WS1_##a) mergeop (_WS2_##a x _WS2_##b y _WS2_##a))
-# define WEPSET_OP1_AW(a,b,mergeop,x)   ((_WS1_##a x WEPSET_BIT1(b)) mergeop (_WS2_##a x WEPSET_BIT2(b)))
-# define WEPSET_OP2_AW(a,b,mergeop,x,y) ((_WS1_##a x WEPSET_BIT1(b) y _WS1_##a) mergeop (_WS2_##a x WEPSET_BIT2(b) y _WS2_##a))
-#endif
-
-#define XX ,
-
-#define WEPSET_COPY_EE(a,b)            WEPSET_OP1_EE(a,b,XX,=)
-#define WEPSET_EQ_EE(a,b)              WEPSET_OP1_EE(a,b,&&,==)
-#define WEPSET_OR_EE(a,b)              WEPSET_OP1_EE(a,b,XX,|=)
-#define WEPSET_AND_EE(a,b)             WEPSET_OP2_EE(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EE(a,b)          WEPSET_OP1_EE(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_EE(a,b) !!(WEPSET_OP1_EE(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_EE(a,b)    WEPSET_OP2_EE(b,a,&&,==,&)
-
-#define WEPSET_COPY_EA(a,b)            WEPSET_OP1_EA(a,b,XX,=)
-#define WEPSET_EQ_EA(a,b)              WEPSET_OP1_EA(a,b,&&,==)
-#define WEPSET_OR_EA(a,b)              WEPSET_OP1_EA(a,b,XX,|=)
-#define WEPSET_AND_EA(a,b)             WEPSET_OP2_EA(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EA(a,b)          WEPSET_OP1_EA(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_EA(a,b) !!(WEPSET_OP1_EA(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_EA(a,b)    WEPSET_OP2_EA(b,a,&&,==,&)
-
-#define WEPSET_COPY_EW(a,b)            WEPSET_OP1_EW(a,b,XX,=)
-#define WEPSET_EQ_EW(a,b)              WEPSET_OP1_EW(a,b,&&,==)
-#define WEPSET_OR_EW(a,b)              WEPSET_OP1_EW(a,b,XX,|=)
-#define WEPSET_AND_EW(a,b)             WEPSET_OP2_EW(a,b,XX,=,&)
-#define WEPSET_ANDNOT_EW(a,b)          WEPSET_OP1_EW(a,b,XX,&~=)
-#define WEPSET_CONTAINS_EW(a,b)     !!(WEPSET_OP1_EW(a,b,||,&))
-
-#define WEPSET_COPY_AE(a,b)            WEPSET_OP1_AE(a,b,XX,=)
-#define WEPSET_EQ_AE(a,b)              WEPSET_OP1_AE(a,b,&&,==)
-#define WEPSET_OR_AE(a,b)              WEPSET_OP1_AE(a,b,XX,|=)
-#define WEPSET_AND_AE(a,b)             WEPSET_OP2_AE(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AE(a,b)          WEPSET_OP1_AE(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_AE(a,b) !!(WEPSET_OP1_AE(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_AE(a,b)    WEPSET_OP2_AE(b,a,&&,==,&)
-
-#define WEPSET_COPY_AA(a,b)            WEPSET_OP1_AA(a,b,XX,=)
-#define WEPSET_EQ_AA(a,b)              WEPSET_OP1_AA(a,b,&&,==)
-#define WEPSET_OR_AA(a,b)              WEPSET_OP1_AA(a,b,XX,|=)
-#define WEPSET_AND_AA(a,b)             WEPSET_OP2_AA(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AA(a,b)          WEPSET_OP1_AA(a,b,XX,&~=)
-#define WEPSET_CONTAINS_ANY_AA(a,b) !!(WEPSET_OP1_AA(a,b,||,&))
-#define WEPSET_CONTAINS_ALL_AA(a,b)    WEPSET_OP2_AA(b,a,&&,==,&)
-
-#define WEPSET_COPY_AW(a,b)            WEPSET_OP1_AW(a,b,XX,=)
-#define WEPSET_EQ_AW(a,b)              WEPSET_OP1_AW(a,b,&&,==)
-#define WEPSET_OR_AW(a,b)              WEPSET_OP1_AW(a,b,XX,|=)
-#define WEPSET_AND_AW(a,b)             WEPSET_OP2_AW(a,b,XX,=,&)
-#define WEPSET_ANDNOT_AW(a,b)          WEPSET_OP1_AW(a,b,XX,&~=)
-#define WEPSET_CONTAINS_AW(a,b)     !!(WEPSET_OP1_AW(a,b,||,&))
-
-WEPSET_DECLARE_A(WEPBIT_ALL);
-WEPSET_DECLARE_A(WEPBIT_SUPERWEAPONS);
-// note: the fabs call is just there to hide "if result is constant" warning
-#define REGISTER_WEAPON_2(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
+#define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
        float id; \
+       WepSet bit; \
        float func(float); \
        void RegisterWeapons_##id() \
        { \
                WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
-               WEPSET_OR_AW(WEPBIT_ALL, id); \
-               if(fabs(weapontype & WEP_FLAG_SUPERWEAPON)) \
-                       WEPSET_OR_AW(WEPBIT_SUPERWEAPONS, id); \
+               bit = WepSet_FromWeapon(id); \
+               WEPSET_ALL |= bit; \
+               if((weapontype) & WEP_FLAG_SUPERWEAPON) \
+                       WEPSET_SUPERWEAPONS |= bit; \
                ++WEP_COUNT; \
-               register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
+               register_weapon(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
        } \
        ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
 #ifdef MENUQC
 #define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
-       REGISTER_WEAPON_2(WEP_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+       REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
 #else
 #define REGISTER_WEAPON(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
-       REGISTER_WEAPON_2(WEP_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
+       REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname)
 #endif
 
 #include "../server/w_all.qc"
index 7570393f4871669d6a649b396e15777e5b5b7f2d..0319ab05fdea67ca0e5b2c86c0c90721610a88c3 100644 (file)
@@ -379,7 +379,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE)
        if(!spawnplaces)
        {
-               MapInfo_Map_supportedGametypes &~= MAPINFO_TYPE_RACE;
+               MapInfo_Map_supportedGametypes &= ~MAPINFO_TYPE_RACE;
                MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
        }
 
index 10a35ee470a7e3cfbdfc70792dcf4b628977a3da..db08fdf07c6a71116099cfa384d325ba19230ac6 100644 (file)
@@ -78,13 +78,13 @@ REGISTER_GAMETYPE(_("Freeze Tag"),ft,g_freezetag,FREEZETAG,"timelimit=20 pointli
 REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,"timelimit=20 pointlimit=30")
 #define g_keepaway IS_GAMETYPE(KEEPAWAY)
 
-float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
-float MAPINFO_FEATURE_VEHICLES      = 2;
-float MAPINFO_FEATURE_TURRETS       = 4;
+const float MAPINFO_FEATURE_WEAPONS       = 1; // not defined for minstagib-only maps
+const float MAPINFO_FEATURE_VEHICLES      = 2;
+const float MAPINFO_FEATURE_TURRETS       = 4;
 
-float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
-float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
-float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
+const float MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
+const float MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
+const float MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
 
 float MapInfo_count;
 
index 1ad03e59b64eaedf029269bdd3d6517f3eaaf1d0..ce2842ea80e7d6ad2f5d753ce976fdf5f4017140 100644 (file)
@@ -195,45 +195,45 @@ void Send_Notification_WOVA(
 */
 
 #define MSG_ANNCE_NOTIFICATIONS \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT,       CH_INFO, "airshot",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AMAZING,       CH_INFO, "amazing",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AWESOME,       CH_INFO, "awesome",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_BOTLIKE,       CH_INFO, "botlike",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_ACHIEVEMENT_ELECTROBITCH,  CH_INFO, "electrobitch",      VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_IMPRESSIVE,    CH_INFO, "impressive",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_YODA,          CH_INFO, "yoda",              VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_BEGIN,                     CH_INFO, "begin",             VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_03,             CH_INFO, "03kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_05,             CH_INFO, "05kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_10,             CH_INFO, "10kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_15,             CH_INFO, "15kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_20,             CH_INFO, "20kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_25,             CH_INFO, "25kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_30,             CH_INFO, "30kills",           VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_LASTSECOND,      CH_INFO, "lastsecond",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_NARROWLY,        CH_INFO, "narrowly",          VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_TERMINATED,      CH_INFO, "terminated",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(0, ANNCE_MULTIFRAG,                 CH_INFO, "multifrag",         VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_1,                     CH_INFO, "1",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_2,                     CH_INFO, "2",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_3,                     CH_INFO, "3",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_4,                     CH_INFO, "4",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_5,                     CH_INFO, "5",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_6,                     CH_INFO, "6",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_7,                     CH_INFO, "7",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_8,                     CH_INFO, "8",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_9,                     CH_INFO, "9",                 VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_NUM_10,                    CH_INFO, "10",                VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_PREPARE,                   CH_INFO, "prepareforbattle",  VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1,          CH_INFO, "1fragleft",         VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2,          CH_INFO, "2fragsleft",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_3,          CH_INFO, "3fragsleft",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1,           CH_INFO, "1minuteremains",    VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_5,           CH_INFO, "5minutesremain",    VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_TIMEOUT,                   CH_INFO, "timeoutcalled",     VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_ACCEPT,               CH_INFO, "voteaccept",        VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_CALL,                 CH_INFO, "votecall",          VOL_BASEVOICE, ATTN_NONE) \
-       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_FAIL,                 CH_INFO, "votefail",          VOL_BASEVOICE, ATTN_NONE)
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT,       CH_INFO, "airshot",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AMAZING,       CH_INFO, "amazing",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AWESOME,       CH_INFO, "awesome",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_BOTLIKE,       CH_INFO, "botlike",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_ACHIEVEMENT_ELECTROBITCH,  CH_INFO, "electrobitch",      VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_IMPRESSIVE,    CH_INFO, "impressive",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_YODA,          CH_INFO, "yoda",              VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_BEGIN,                     CH_INFO, "begin",             VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_03,             CH_INFO, "03kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_05,             CH_INFO, "05kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_10,             CH_INFO, "10kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_15,             CH_INFO, "15kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_20,             CH_INFO, "20kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_25,             CH_INFO, "25kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_KILLSTREAK_30,             CH_INFO, "30kills",           VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_LASTSECOND,      CH_INFO, "lastsecond",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_NARROWLY,        CH_INFO, "narrowly",          VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_MINSTAGIB_TERMINATED,      CH_INFO, "terminated",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(0, ANNCE_MULTIFRAG,                 CH_INFO, "multifrag",         VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_1,                     CH_INFO, "1",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_2,                     CH_INFO, "2",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_3,                     CH_INFO, "3",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_4,                     CH_INFO, "4",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_5,                     CH_INFO, "5",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_6,                     CH_INFO, "6",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_7,                     CH_INFO, "7",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_8,                     CH_INFO, "8",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_9,                     CH_INFO, "9",                 VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_NUM_10,                    CH_INFO, "10",                VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_PREPARE,                   CH_INFO, "prepareforbattle",  VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1,          CH_INFO, "1fragleft",         VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2,          CH_INFO, "2fragsleft",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_3,          CH_INFO, "3fragsleft",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1,           CH_INFO, "1minuteremains",    VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_5,           CH_INFO, "5minutesremain",    VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_TIMEOUT,                   CH_INFO, "timeoutcalled",     VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_ACCEPT,               CH_INFO, "voteaccept",        VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_CALL,                 CH_INFO, "votecall",          VOL_BASEVOICE, ATTEN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_VOTE_FAIL,                 CH_INFO, "votefail",          VOL_BASEVOICE, ATTEN_NONE)
 
 #define MULTITEAM_INFO(default,prefix,teams,strnum,flnum,args,hudargs,icon,normal,gentle) \
        MSG_INFO_NOTIF(default, prefix##RED, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STATIC_NAME_TEAM_1)), TCR(normal, COL_TEAM_1, strtoupper(NAME_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(NAME_TEAM_1))) \
index 8a871c6b3fdebbfefc9945aca37c2c8dccdd7ab3..6353c33fef643404c63b2dd16824c9bf9ae0a5ad 100644 (file)
@@ -1,7 +1,7 @@
-float URL_READY_ERROR    = -1;
-float URL_READY_CLOSED   =  0;
-float URL_READY_CANWRITE =  1;
-float URL_READY_CANREAD  =  2;
+const float URL_READY_ERROR    = -1;
+const float URL_READY_CLOSED   =  0;
+const float URL_READY_CANWRITE =  1;
+const float URL_READY_CANREAD  =  2;
 // errors: -1, or negative HTTP status code
 typedef void(entity handle, entity pass, float status) url_ready_func;
 
index 1c2c1cc9f266fdb2fdc16ab627e95fd46ca9be18..3912773fba3794cdb2c7c7e838f2948f2472422b 100644 (file)
@@ -16,7 +16,7 @@
 
 #ifdef FTEQCC
 #ifdef WATERMARK
-string FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES = WATERMARK();
+const string FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES = WATERMARK();
 #undef WATERMARK
 #define WATERMARK FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES
 #endif
index 7fa2f576a64649cce85982cf908b5b4b0ae2a229..3c3c6e3aec5a9e07e3ee5348217e60dfd5a53905 100644 (file)
@@ -203,7 +203,6 @@ string ftos_decimals(float number, float decimals)
        return sprintf("%.*f", decimals, number);
 }
 
-float time;
 vector colormapPaletteColor(float c, float isPants)
 {
        switch(c)
@@ -1884,6 +1883,22 @@ float ReadInt24_t()
        v += ReadByte(); // note: this is unsigned
        return v;
 }
+vector ReadInt48_t()
+{
+       vector v;
+       v_x = ReadInt24_t();
+       v_y = ReadInt24_t();
+       v_z = 0;
+       return v;
+}
+vector ReadInt72_t()
+{
+       vector v;
+       v_x = ReadInt24_t();
+       v_y = ReadInt24_t();
+       v_z = ReadInt24_t();
+       return v;
+}
 #else
 void WriteInt24_t(float dst, float val)
 {
@@ -1891,6 +1906,17 @@ void WriteInt24_t(float dst, float val)
        WriteShort(dst, (v = floor(val / 256)));
        WriteByte(dst, val - v * 256); // 0..255
 }
+void WriteInt48_t(float dst, vector val)
+{
+       WriteInt24_t(dst, val_x);
+       WriteInt24_t(dst, val_y);
+}
+void WriteInt72_t(float dst, vector val)
+{
+       WriteInt24_t(dst, val_x);
+       WriteInt24_t(dst, val_y);
+       WriteInt24_t(dst, val_z);
+}
 #endif
 #endif
 
@@ -2254,11 +2280,11 @@ float xdecode(string s)
 
 float lowestbit(float f)
 {
-       f &~= f * 2;
-       f &~= f * 4;
-       f &~= f * 16;
-       f &~= f * 256;
-       f &~= f * 65536;
+       f &= ~(f * 2);
+       f &= ~(f * 4);
+       f &= ~(f * 16);
+       f &= ~(f * 256);
+       f &= ~(f * 65536);
        return f;
 }
 
index ad612f954f459ca0aaba9e2e553dbd72b8293122..3a4dff798c83c9f947f702950bf9e85feb5b6d5c 100644 (file)
@@ -1,3 +1,8 @@
+#define WANT_CONST
+// commonly used, but better make them macros
+#define TRUE 1
+#define FALSE 0
+
 // a dummy macro that prevents the "hanging ;" warning
 #define ENDS_WITH_CURLY_BRACE
 
@@ -151,7 +156,7 @@ float almost_in_bounds(float a, float b, float c);
 float power2of(float e);
 float log2of(float x);
 
-string HEXDIGITS = "0123456789ABCDEF0123456789abcdef";
+const string HEXDIGITS = "0123456789ABCDEF0123456789abcdef";
 #define HEXDIGIT_TO_DEC_RAW(d) (strstrofs(HEXDIGITS, (d), 0))
 #define HEXDIGIT_TO_DEC(d) ((HEXDIGIT_TO_DEC_RAW(d) | 0x10) - 0x10)
 #define DEC_TO_HEXDIGIT(d) (substring(HEXDIGITS, (d), 1))
@@ -223,8 +228,12 @@ string getcurrentmod();
 #ifndef MENUQC
 #ifdef CSQC
 float ReadInt24_t();
+vector ReadInt48_t();
+vector ReadInt72_t();
 #else
 void WriteInt24_t(float dest, float val);
+void WriteInt48_t(float dest, vector val);
+void WriteInt72_t(float dest, vector val);
 #endif
 #endif
 
index c4882d8d20c0c4da5a28e87a02adf6e22d7db6c7..2c7bc2d925da89fc0c1d971ad86e2ca696cddb2c 100644 (file)
@@ -192,7 +192,7 @@ void CSQCModel_Draw()
                root = root.tag_entity;
        if(self != root)
        {
-               self.renderflags &~= RF_EXTERNALMODEL | RF_VIEWMODEL;
+               self.renderflags &= ~(RF_EXTERNALMODEL | RF_VIEWMODEL);
                self.renderflags |= (root.renderflags & (RF_EXTERNALMODEL | RF_VIEWMODEL));
        }
 
@@ -267,7 +267,7 @@ void CSQCModel_Read(float isnew)
 #endif
                self.renderflags |= RF_EXTERNALMODEL;
        else
-               self.renderflags &~= RF_EXTERNALMODEL;
+               self.renderflags &= ~RF_EXTERNALMODEL;
 
        // draw it
        self.drawmask = MASK_NORMAL;
index 2711867dbc445cb68f9930c4a81600d9d3601d14..46c312f160ec8e333bd566897cf37aabc559affd 100644 (file)
@@ -193,7 +193,7 @@ void CSQCPlayer_SetCamera()
 
                        // get crouch state from the server
                        if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
-                               self.pmove_flags &~= PMF_DUCKED;
+                               self.pmove_flags &= ~PMF_DUCKED;
                        else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
                                self.pmove_flags |= PMF_DUCKED;
 
@@ -201,7 +201,7 @@ void CSQCPlayer_SetCamera()
                        if(pmove_onground)
                                self.pmove_flags |= PMF_ONGROUND;
                        else
-                               self.pmove_flags &~= PMF_ONGROUND;
+                               self.pmove_flags &= ~PMF_ONGROUND;
 
                        CSQCPlayer_SetMinsMaxs();
 
@@ -214,7 +214,7 @@ void CSQCPlayer_SetCamera()
                else
                {
                        float flg = self.iflags;
-                       self.iflags &~= IFLAG_ORIGIN | IFLAG_ANGLES;
+                       self.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
                        InterpolateOrigin_Do();
                        self.iflags = flg;
 
@@ -231,7 +231,7 @@ void CSQCPlayer_SetCamera()
 
                                // get crouch state from the server
                                if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
-                                       self.pmove_flags &~= PMF_DUCKED;
+                                       self.pmove_flags &= ~PMF_DUCKED;
                                else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
                                        self.pmove_flags |= PMF_DUCKED;
 
@@ -239,7 +239,7 @@ void CSQCPlayer_SetCamera()
                                if(pmove_onground)
                                        self.pmove_flags |= PMF_ONGROUND;
                                else
-                                       self.pmove_flags &~= PMF_ONGROUND;
+                                       self.pmove_flags &= ~PMF_ONGROUND;
 
                                CSQCPlayer_SavePrediction();
                        }
@@ -248,7 +248,7 @@ void CSQCPlayer_SetCamera()
 #ifdef CSQCMODEL_SERVERSIDE_CROUCH
                        // get crouch state from the server (LAG)
                        if(getstati(STAT_VIEWHEIGHT) == PL_VIEW_OFS_z)
-                               self.pmove_flags &~= PMF_DUCKED;
+                               self.pmove_flags &= ~PMF_DUCKED;
                        else if(getstati(STAT_VIEWHEIGHT) == PL_CROUCH_VIEW_OFS_z)
                                self.pmove_flags |= PMF_DUCKED;
 #endif
index c1626f816e3b395cb70fa9da1c0e07737ccb1ae0..994323cfe037334bed894624c7c12089108b069d 100644 (file)
@@ -29,7 +29,7 @@
 .float itime1, itime2;
 void InterpolateOrigin_Reset()
 {
-       self.iflags &~= IFLAG_INTERNALMASK;
+       self.iflags &= ~IFLAG_INTERNALMASK;
        self.itime1 = self.itime2 = 0;
 }
 void InterpolateOrigin_Note()
@@ -106,7 +106,7 @@ void InterpolateOrigin_Note()
 
        if(self.iflags & IFLAG_TELEPORTED)
        {
-               self.iflags &~= IFLAG_TELEPORTED;
+               self.iflags &= ~IFLAG_TELEPORTED;
                self.itime1 = self.itime2 = time; // don't lerp
        }
        else if(vlen(self.iorigin2 - self.iorigin1) > 1000)
index 60c135cb9e1cff14bb51c9d3d376c453b8e4c859..1baad7b98d31e5790ff68a570c3b4e079d960470 100644 (file)
@@ -78,13 +78,13 @@ void CSQCModel_CheckUpdate()
        if(self.effects & EF_RESTARTANIM_BIT)
        {
                self.SendFlags |= CSQCMODEL_PROPERTY_FRAME | CSQCMODEL_PROPERTY_FRAME2; // full anim resend please
-               self.effects &~= EF_RESTARTANIM_BIT;
+               self.effects &= ~EF_RESTARTANIM_BIT;
        }
 
        if(self.effects & EF_TELEPORT_BIT)
        {
                self.SendFlags |= CSQCMODEL_PROPERTY_TELEPORTED; // no interpolation please
-               self.effects &~= EF_TELEPORT_BIT;
+               self.effects &= ~EF_TELEPORT_BIT;
        }
 
 #define CSQCMODEL_IF(cond) if(cond) {
index fb3ddb46a4ac4b07c40972653d37d5f90fe6dfba..f858afba2fdaa3457f8c1cc33b63dfcf336a9b3c 100644 (file)
@@ -335,7 +335,7 @@ void(entity e, vector o) setorigin = #2;
 void(entity e, string m) setmodel = #3;
 void(entity e, vector min, vector max) setsize = #4;
 
-void() break_builtin = #6;
+void() break_to_debugger = #6;
 float() random = #7;
 void(entity e, float chan, string samp) sound = #8;
 vector(vector v) normalize = #9;
@@ -1069,14 +1069,6 @@ float SOUNDFLAG_RELIABLE = 1;
 //- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
 //  the finished extension once done
 
-//DP_MOVETYPEFLYWORLDONLY
-//idea: Samual
-//darkplaces implementation: Samual
-//movetype definitions:
-float MOVETYPE_FLY_WORLDONLY = 33;
-//description:
-//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
-
 //DP_PRECACHE_PIC_FLAGS
 //idea: divVerent
 //darkplaces implementation: divVerent
index 76945736f914fbd8a67ef5dc4e6573d9907d7b80..65fe815b0001bf47080a06c3d9cb0796355b0f4f 100644 (file)
@@ -46,28 +46,28 @@ float K_CAPSLOCK    = 155;
 float K_SCROLLLOCK     = 156;
 
 float K_KP_0   =       157;
-float K_KP_INS =       K_KP_0;
+float K_KP_INS =       157; // same as K_KP_0
 float K_KP_1   =       158;
-float K_KP_END =       K_KP_1;
+float K_KP_END =       158; // same as K_KP_1
 float K_KP_2   =       159;
-float K_KP_DOWNARROW = K_KP_2;
+float K_KP_DOWNARROW = 159; // same as K_KP_2
 float K_KP_3   =       160;
-float K_KP_PGDN = K_KP_3;
+float K_KP_PGDN = 160; // same as K_KP_3
 float K_KP_4   =       161;
-float K_KP_LEFTARROW = K_KP_4;
+float K_KP_LEFTARROW = 161; // same as K_KP_4
 float K_KP_5   =       162;
 float K_KP_6   =       163;
-float K_KP_RIGHTARROW = K_KP_6;
+float K_KP_RIGHTARROW = 163; // same as K_KP_6
 float K_KP_7   =       164;
-float K_KP_HOME = K_KP_7;
+float K_KP_HOME = 164; // same as K_KP_7
 float K_KP_8   =       165;
-float K_KP_UPARROW = K_KP_8;
+float K_KP_UPARROW = 165; // same as K_KP_8
 float K_KP_9   = 166;
-float K_KP_PGUP = K_KP_9;
+float K_KP_PGUP = 166; // same as K_KP_9
 float K_KP_PERIOD = 167;
-float K_KP_DEL = K_KP_PERIOD;
+float K_KP_DEL = 167; // same as K_KP_PERIOD
 float K_KP_DIVIDE = 168;
-float K_KP_SLASH = K_KP_DIVIDE;
+float K_KP_SLASH = 168; // same as K_KP_DIVIDE
 float K_KP_MULTIPLY = 169;
 float K_KP_MINUS       = 170;
 float K_KP_PLUS                = 171;
index 8b2933a546b94e1a51439fec66bada709ba99648..4885f2916c70641ca7488b9fedd016fa7e144551 100644 (file)
@@ -96,7 +96,7 @@ float ERR_BADFILENAME                         = -4; // fopen
 float ERR_NULLSTRING                   = -1;
 float ERR_BADDRAWFLAG                  = -2;
 float ERR_BADSCALE                             = -3;
-float ERR_BADSIZE                              = ERR_BADSCALE;
+float ERR_BADSIZE                              = -3; // same as ERR_BADSCALE
 float ERR_NOTCACHED                            = -4;
 
 // server list stuff
index 00e0d31b21d450ae116c4b6412e328904c2b2686..2ccd843145b0db8807a777d9285bf2e5e60478b8 100644 (file)
@@ -402,7 +402,7 @@ void(entity e, vector o) setorigin  = #2;
 void(entity e, string m) setmodel      = #3;           // set movetype and solid first
 void(entity e, vector min, vector max) setsize = #4;
 // #5 was removed
-void() break_builtin                                           = #6;
+void() break_to_debugger                                               = #6;
 float() random                                         = #7;           // returns 0 - 1
 void(entity e, float chan, string samp, float vol, float atten) sound = #8;
 vector(vector v) normalize                     = #9;
index 7178628d8b2f6e093ecc1116e976e6343244266f..cfab348ed65862fd746eb5778058b9599d4105e0 100644 (file)
@@ -8,7 +8,6 @@ vector drawfontscale;
 vector draw_shift;
 vector draw_scale;
 float draw_alpha;
-vector draw_fontscale;
 
 void draw_reset(float cw, float ch, float ox, float oy);
 void draw_beginBoldFont();
index 78c196995d194a6060216c0843f1b31ca0ad6f22..7339e696950abb7a5de944a12eeca1acaa43a681 100644 (file)
@@ -91,8 +91,8 @@ void m_init()
        }
 }
 
-float MENU_ASPECT = 1.25; // 1280x1024
-float MENU_MINHEIGHT = 600;
+const float MENU_ASPECT = 1.25; // 1280x1024
+const float MENU_MINHEIGHT = 600;
 float conwidth_s, conheight_s, realconwidth, realconheight, screenconwidth, screenconheight;
 void draw_reset_cropped()
 {
@@ -302,11 +302,11 @@ void m_keydown(float key, float ascii)
        if(key == K_SHIFT) menuShiftState |= S_SHIFT;
 }
 
-float SCALEMODE_CROP = 0;
-float SCALEMODE_LETTERBOX = 1;
-float SCALEMODE_WIDTH = 2;
-float SCALEMODE_HEIGHT = 3;
-float SCALEMODE_STRETCH = 4;
+const float SCALEMODE_CROP = 0;
+const float SCALEMODE_LETTERBOX = 1;
+const float SCALEMODE_WIDTH = 2;
+const float SCALEMODE_HEIGHT = 3;
+const float SCALEMODE_STRETCH = 4;
 void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
 {
        vector sz, org, isz, isz_w, isz_h;
index e0f4c5b2e4c616e02ea7eca35595969d5953618a..fd19f280a4d408b51d8fa1e1fba9b68a488829ab 100644 (file)
@@ -86,9 +86,9 @@ void XonoticColorButton_saveCvars(entity me)
        if(me.checked)
        {
                if(me.cvarPart == 1)
-                       cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 15 + me.cvarValueFloat * 16));
+                       cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 15) + me.cvarValueFloat * 16));
                else
-                       cvar_set(me.cvarName, ftos(cvar(me.cvarName) & 240 + me.cvarValueFloat));
+                       cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 240) + me.cvarValueFloat));
        }
        // TODO on an apply button, read _cl_color and execute the color command for it
 }
index f18658c7154197e1f1f7d535d0e8801d619d6631..6ca90254a3eb24b70318fe5972a58e85473cdfd0 100644 (file)
@@ -29,8 +29,10 @@ CLASS(XonoticDialog) EXTENDS(Dialog)
 
        METHOD(XonoticDialog, configureDialog, void(entity))
 ENDCLASS(XonoticDialog)
+#ifndef IMPLEMENTATION
 entity currentDialog;
 #endif
+#endif
 
 #ifdef IMPLEMENTATION
 void XonoticDialog_configureDialog(entity me)
index d0a8f6bc76a199ca49e1091fd1a4351b0f38f2e2..5ba3733f012f4bcfb3d39dd3c9ee169d0da25ae3 100644 (file)
@@ -232,7 +232,7 @@ void XonoticMutatorsDialog_fill(entity me)
                w = get_weaponinfo(i);
                if(w.spawnflags & WEP_FLAG_HIDDEN)
                        continue;
-               if(j & 1 == 0)
+               if((j & 1) == 0)
                        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.8, e = makeXonoticWeaponarenaCheckBox(strzone(w.netname), strzone(w.message)));
index 739be1b056aa908da09d5ab1bfded18f3ef30708..d16e8bb26ede658e06ded51df4cf0fe5ddce36d5 100644 (file)
@@ -34,7 +34,7 @@ void KeyBinder_Bind_Edit(entity btn, entity me);
 
 #ifdef IMPLEMENTATION
 
-string KEY_NOT_BOUND_CMD = "// not bound";
+const string KEY_NOT_BOUND_CMD = "// not bound";
 
 #define MAX_KEYS_PER_FUNCTION 2
 #define MAX_KEYBINDS 256
index 9e49626023375b96651e5fa13bc4c2e50d0f6c54..86fdf1c63b0cd1ae927d144ec63f9751b15a4f24 100644 (file)
@@ -57,6 +57,7 @@ CLASS(XonoticServerList) EXTENDS(XonoticListBox)
        ATTRIB(XonoticServerList, seenIPv6, float, 0)
 ENDCLASS(XonoticServerList)
 entity makeXonoticServerList();
+
 void ServerList_Connect_Click(entity btn, entity me);
 void ServerList_ShowEmpty_Click(entity box, entity me);
 void ServerList_ShowFull_Click(entity box, entity me);
@@ -65,6 +66,7 @@ void ServerList_Favorite_Click(entity btn, entity me);
 void ServerList_Info_Click(entity btn, entity me);
 void ServerList_Update_favoriteButton(entity btn, entity me);
 
+#ifndef IMPLEMENTATION
 float SLIST_FIELD_CNAME;
 float SLIST_FIELD_PING;
 float SLIST_FIELD_GAME;
@@ -82,6 +84,8 @@ float SLIST_FIELD_QCSTATUS;
 float SLIST_FIELD_ISFAVORITE;
 #endif
 
+#endif
+
 #ifdef IMPLEMENTATION
 void ServerList_UpdateFieldIDs()
 {
index b45f35aa8fffb0d80b2e1b700f6636f7153e25ef..45c7af3b7e6449c865914ebf605c2306b2dc6252 100644 (file)
@@ -32,7 +32,7 @@ void bot_think()
        if (self.bot_nextthink > time)
                return;
 
-       self.flags &~= FL_GODMODE;
+       self.flags &= ~FL_GODMODE;
        if(autocvar_bot_god)
                self.flags |= FL_GODMODE;
 
index 6823841d9bc91aa7d998369782b884d4721f2212..043f8332c9c1fe47b2bc3b086526eb64a457a8de 100644 (file)
@@ -2,18 +2,18 @@
  * Globals and Fields
  */
 
-float AI_STATUS_ROAMING                                                = 1;    // Bot is just crawling the map. No enemies at sight
-float AI_STATUS_ATTACKING                                      = 2;    // There are enemies at sight
-float AI_STATUS_RUNNING                                                = 4;    // Bot is bunny hopping
-float AI_STATUS_DANGER_AHEAD                           = 8;    // There is lava/slime/trigger_hurt ahead
-float AI_STATUS_OUT_JUMPPAD                                    = 16;   // Trying to get out of a "vertical" jump pad
-float AI_STATUS_OUT_WATER                                      = 32;   // Trying to get out of water
-float AI_STATUS_WAYPOINT_PERSONAL_LINKING      = 64;   // Waiting for the personal waypoint to be linked
-float AI_STATUS_WAYPOINT_PERSONAL_GOING                = 128;  // Going to a personal waypoint
-float AI_STATUS_WAYPOINT_PERSONAL_REACHED      = 256;  // Personal waypoint reached
-float AI_STATUS_JETPACK_FLYING                         = 512;
-float AI_STATUS_JETPACK_LANDING                                = 1024;
-float AI_STATUS_STUCK                                          = 2048; // Cannot reach any goal
+const float AI_STATUS_ROAMING                                          = 1;    // Bot is just crawling the map. No enemies at sight
+const float AI_STATUS_ATTACKING                                        = 2;    // There are enemies at sight
+const float AI_STATUS_RUNNING                                          = 4;    // Bot is bunny hopping
+const float AI_STATUS_DANGER_AHEAD                             = 8;    // There is lava/slime/trigger_hurt ahead
+const float AI_STATUS_OUT_JUMPPAD                                      = 16;   // Trying to get out of a "vertical" jump pad
+const float AI_STATUS_OUT_WATER                                        = 32;   // Trying to get out of water
+const float AI_STATUS_WAYPOINT_PERSONAL_LINKING        = 64;   // Waiting for the personal waypoint to be linked
+const float AI_STATUS_WAYPOINT_PERSONAL_GOING          = 128;  // Going to a personal waypoint
+const float AI_STATUS_WAYPOINT_PERSONAL_REACHED        = 256;  // Personal waypoint reached
+const float AI_STATUS_JETPACK_FLYING                           = 512;
+const float AI_STATUS_JETPACK_LANDING                          = 1024;
+const float AI_STATUS_STUCK                                            = 2048; // Cannot reach any goal
 
 .float isbot; // true if this client is actually a bot
 .float aistatus;
index 5b889b8ca140f43f46f3633f3b5a924438b75788..7e23903ed27548a2c3df90d821b84fd5cfbdfb82 100644 (file)
@@ -28,7 +28,7 @@ void havocbot_ai()
                // if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
                if(self.deadflag != DEAD_NO)
                if(self.goalcurrent==world)
-               if(self.waterlevel==WATERLEVEL_SWIMMING || self.aistatus & AI_STATUS_OUT_WATER)
+               if(self.waterlevel==WATERLEVEL_SWIMMING || (self.aistatus & AI_STATUS_OUT_WATER))
                {
                        // Look for the closest waypoint out of water
                        entity newgoal, head;
@@ -88,9 +88,9 @@ void havocbot_ai()
        if (self.bot_aimtarg)
        {
                self.aistatus |= AI_STATUS_ATTACKING;
-               self.aistatus &~= AI_STATUS_ROAMING;
+               self.aistatus &= ~AI_STATUS_ROAMING;
 
-               if(!WEPSET_EMPTY_E(self))
+               if(self.weapons)
                {
                        weapon_action(self.weapon, WR_AIM);
                        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
@@ -113,7 +113,7 @@ void havocbot_ai()
        else if (self.goalcurrent)
        {
                self.aistatus |= AI_STATUS_ROAMING;
-               self.aistatus &~= AI_STATUS_ATTACKING;
+               self.aistatus &= ~AI_STATUS_ATTACKING;
 
                vector now,v,next;//,heading;
                float aimdistance,skillblend,distanceblend,blend;
@@ -122,7 +122,7 @@ void havocbot_ai()
                //heading = self.velocity;
                //dprint(self.goalstack01.classname,etos(self.goalstack01),"\n");
                if(
-                       self.goalstack01 != self && self.goalstack01 != world && self.aistatus & AI_STATUS_RUNNING == 0 &&
+                       self.goalstack01 != self && self.goalstack01 != world && ((self.aistatus & AI_STATUS_RUNNING) == 0) &&
                        !(self.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
                )
                        next = ((self.goalstack01.absmin + self.goalstack01.absmax) * 0.5) - (self.origin + self.view_ofs);
@@ -164,7 +164,7 @@ void havocbot_ai()
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               if (WEPSET_CONTAINS_EW(self, i) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
+                               if ((self.weapons & WepSet_FromWeapon(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
                                        self.switchweapon = i;
                        }
                }
@@ -264,7 +264,7 @@ void havocbot_bunnyhop(vector dir)
 
        if(self.aistatus & AI_STATUS_DANGER_AHEAD)
        {
-               self.aistatus &~= AI_STATUS_RUNNING;
+               self.aistatus &= ~AI_STATUS_RUNNING;
                self.BUTTON_JUMP = FALSE;
                self.bot_canruntogoal = 0;
                self.bot_timelastseengoal = 0;
@@ -273,7 +273,7 @@ void havocbot_bunnyhop(vector dir)
 
        if(self.waterlevel > WATERLEVEL_WETFEET)
        {
-               self.aistatus &~= AI_STATUS_RUNNING;
+               self.aistatus &= ~AI_STATUS_RUNNING;
                return;
        }
 
@@ -339,7 +339,7 @@ void havocbot_bunnyhop(vector dir)
 
                                        if(checkdistance)
                                        {
-                                               self.aistatus &~= AI_STATUS_RUNNING;
+                                               self.aistatus &= ~AI_STATUS_RUNNING;
                                                if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
                                                        self.BUTTON_JUMP = TRUE;
                                        }
@@ -363,7 +363,7 @@ void havocbot_bunnyhop(vector dir)
 #if 0
        // Release jump button
        if(!cvar("sv_pogostick"))
-       if(self.flags & FL_ONGROUND == 0)
+       if((self.flags & FL_ONGROUND) == 0)
        {
                if(self.velocity_z < 0 || vlen(self.velocity)<maxspeed)
                        self.BUTTON_JUMP = FALSE;
@@ -455,15 +455,15 @@ void havocbot_movetogoal()
                                }
                                // Switch to normal mode
                                self.navigation_jetpack_goal = world;
-                               self.aistatus &~= AI_STATUS_JETPACK_LANDING;
-                               self.aistatus &~= AI_STATUS_JETPACK_FLYING;
+                               self.aistatus &= ~AI_STATUS_JETPACK_LANDING;
+                               self.aistatus &= ~AI_STATUS_JETPACK_FLYING;
                                return;
                        }
                }
                else if(checkpvs(self.origin,self.goalcurrent))
                {
                        // If I can see the goal switch to landing code
-                       self.aistatus &~= AI_STATUS_JETPACK_FLYING;
+                       self.aistatus &= ~AI_STATUS_JETPACK_FLYING;
                        self.aistatus |= AI_STATUS_JETPACK_LANDING;
                        return;
                }
@@ -514,7 +514,7 @@ void havocbot_movetogoal()
                                        self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
                                        navigation_clearroute();
                                        navigation_routetogoal(newgoal, self.origin);
-                                       self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
+                                       self.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
                                }
                        }
                        else
@@ -542,7 +542,7 @@ void havocbot_movetogoal()
                }
        }
        else if(self.aistatus & AI_STATUS_OUT_JUMPPAD)
-               self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
+               self.aistatus &= ~AI_STATUS_OUT_JUMPPAD;
 
        // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump
        if(skill>6)
@@ -698,7 +698,7 @@ void havocbot_movetogoal()
                else
                {
                        if(self.aistatus & AI_STATUS_OUT_WATER)
-                               self.aistatus &~= AI_STATUS_OUT_WATER;
+                               self.aistatus &= ~AI_STATUS_OUT_WATER;
 
                        // jump if going toward an obstacle that doesn't look like stairs we
                        // can walk up directly
@@ -756,10 +756,10 @@ void havocbot_movetogoal()
 
                        // Check for water/slime/lava and dangerous edges
                        // (only when the bot is on the ground or jumping intentionally)
-                       self.aistatus &~= AI_STATUS_DANGER_AHEAD;
+                       self.aistatus &= ~AI_STATUS_DANGER_AHEAD;
 
                        if(trace_fraction == 1 && self.jumppadcount == 0 && !self.goalcurrent.wphardwired )
-                       if(self.flags & FL_ONGROUND || self.aistatus & AI_STATUS_RUNNING || self.BUTTON_JUMP == TRUE)
+                       if((self.flags & FL_ONGROUND) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == TRUE)
                        {
                                // Look downwards
                                traceline(dst_ahead , dst_down, TRUE, world);
@@ -923,7 +923,7 @@ void havocbot_chooseenemy()
 
                // I want to do a second scan if no enemy was found or I don't have weapons
                // TODO: Perform the scan when using the rifle (requires changes on the rifle code)
-               if(best || !WEPSET_EMPTY_E(self)) // || self.weapon == WEP_RIFLE
+               if(best || self.weapons) // || self.weapon == WEP_RIFLE
                        break;
                if(i)
                        break;
@@ -971,7 +971,7 @@ void havocbot_chooseweapon()
        float i;
 
        // ;)
-       if(WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
+       if(g_weaponarena_weapons == WEPSET_TUBA)
        {
                self.switchweapon = WEP_TUBA;
                return;
@@ -1111,7 +1111,7 @@ float havocbot_moveto(vector pos)
                if(self.havocbot_personal_waypoint==world)
                {
                        dprint("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
-                       self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+                       self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                        return CMD_STATUS_ERROR;
                }
 
@@ -1132,7 +1132,7 @@ float havocbot_moveto(vector pos)
                                if(self.havocbot_personal_waypoint_failcounter >= 30)
                                {
                                        dprint("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
-                                       self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
+                                       self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
                                        remove(self.havocbot_personal_waypoint);
                                        return CMD_STATUS_ERROR;
                                }
@@ -1157,7 +1157,7 @@ float havocbot_moveto(vector pos)
                        // Step 5: Waypoint reached
                        dprint(self.netname, "'s personal waypoint reached\n");
                        remove(self.havocbot_personal_waypoint);
-                       self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
+                       self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_REACHED;
                        return CMD_STATUS_FINISHED;
                }
 
@@ -1175,7 +1175,7 @@ float havocbot_moveto(vector pos)
                }
 
                self.havocbot_personal_waypoint_searchtime = time; // so we set the route next frame
-               self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_LINKING;
+               self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
                self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_GOING;
 
                // Step 3: Route to waypoint
index 8071fef74aec7fe26fbb243743fdd36d72941e57..ab5372833323de4c6be95bb7dbb3ca26b2143986 100644 (file)
@@ -39,7 +39,7 @@ void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float s
        for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
        {
                // Find weapon
-               if(WEPSET_CONTAINS_EW(self, i))
+               if(self.weapons & WepSet_FromWeapon(i))
                if(++c>=4)
                        break;
        }
@@ -59,7 +59,7 @@ void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float s
        {
                // gather health and armor only
                if (head.solid)
-               if ( ((head.health || head.armorvalue) && needarmor) || (!WEPSET_EMPTY_E(head) && needweapons ) )
+               if ( ((head.health || head.armorvalue) && needarmor) || (head.weapons && needweapons ) )
                if (vlen(head.origin - org) < sradius)
                {
                        t = head.bot_pickupevalfunc(self, head);
index 17b80224d5ed98f5f8b3c4c6245cc405418b0057..3e0e60fcc09995c25dd8525b050bc8f6f3f93561 100644 (file)
@@ -85,8 +85,8 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                        if( head.armorvalue && player.armorvalue > self.armorvalue)
                                                continue;
 
-                                       if( !WEPSET_EMPTY_E(head) )
-                                       if( !WEPSET_CONTAINS_ALL_EE(player, head) )
+                                       if( head.weapons )
+                                       if( head.weapons & ~player.weapons )
                                                continue;
 
                                        if (head.ammo_shells && player.ammo_shells > self.ammo_shells)
@@ -175,11 +175,11 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
                                continue;
                        */
 
-                       if(head.flags & FL_INWATER || head.flags & FL_PARTIALGROUND)
+                       if((head.flags & FL_INWATER) || (head.flags & FL_PARTIALGROUND))
                                continue;
 
                        // not falling
-                       if(head.flags & FL_ONGROUND == 0)
+                       if((head.flags & FL_ONGROUND) == 0)
                        {
                                traceline(head.origin, head.origin + '0 0 -1500', TRUE, world);
                                t = pointcontents(trace_endpos + '0 0 1');
index 5c60050cf1c674fb4f6e8694b346e87d9122857a..9160c1133ab4ba9e50bcb3972dea7492918d85fd 100644 (file)
@@ -903,7 +903,7 @@ void navigation_poptouchedgoals()
                        if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
                        if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
                        {
-                               self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+                               self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                                self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
                        }
                        navigation_poproute();
@@ -950,7 +950,7 @@ void navigation_poptouchedgoals()
                                if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
                                if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
                                {
-                                       self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+                                       self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                                        self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
                                }
 
@@ -965,7 +965,7 @@ void navigation_poptouchedgoals()
                if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
                if(self.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL && self.goalcurrent.owner==self)
                {
-                       self.aistatus &~= AI_STATUS_WAYPOINT_PERSONAL_GOING;
+                       self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
                        self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_REACHED;
                }
 
@@ -1088,7 +1088,7 @@ void navigation_unstuck()
                                bot_debug(strcat(self.netname, " stuck, reachable waypoint found, heading to it\n"));
                                navigation_routetogoal(bot_waypoint_queue_bestgoal, self.origin);
                                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
-                               self.aistatus &~= AI_STATUS_STUCK;
+                               self.aistatus &= ~AI_STATUS_STUCK;
                        }
                        else
                        {
index b3b40ce03e55443be1c82e8e362f354381e82483..24d01c7c44f9adfee93013c0ca34fd3e496f61c5 100644 (file)
@@ -33,9 +33,9 @@ entity navigation_bestgoal;
 .entity navigation_jetpack_goal;
 .vector navigation_jetpack_point;
 
-float DEBUG_NODE_SUCCESS        = 1;
-float DEBUG_NODE_WARNING        = 2;
-float DEBUG_NODE_FAIL           = 3;
+const float DEBUG_NODE_SUCCESS        = 1;
+const float DEBUG_NODE_WARNING        = 2;
+const float DEBUG_NODE_FAIL           = 3;
 vector debuglastnode;
 
 entity bot_waypoint_queue_owner;       // Owner of the temporary list of goals
index 21e1b728f6b0d553c9588fb93a104e7809f9356f..24048854bc5643383a87f008d242ea4b77f13eef 100644 (file)
@@ -551,7 +551,7 @@ float bot_cmd_impulse()
 
 float bot_cmd_continue()
 {
-       self.bot_exec_status &~= BOT_EXEC_STATUS_PAUSED;
+       self.bot_exec_status &= ~BOT_EXEC_STATUS_PAUSED;
        return CMD_STATUS_FINISHED;
 }
 
@@ -562,7 +562,7 @@ float bot_cmd_wait()
        {
                if(time>=self.bot_cmd_wait_time)
                {
-                       self.bot_exec_status &~= BOT_EXEC_STATUS_WAITING;
+                       self.bot_exec_status &= ~BOT_EXEC_STATUS_WAITING;
                        return CMD_STATUS_FINISHED;
                }
                else
@@ -581,7 +581,7 @@ float bot_cmd_wait_until()
                self.bot_exec_status |= BOT_EXEC_STATUS_WAITING;
                return CMD_STATUS_EXECUTING;
        }
-       self.bot_exec_status &~= BOT_EXEC_STATUS_WAITING;
+       self.bot_exec_status &= ~BOT_EXEC_STATUS_WAITING;
        return CMD_STATUS_FINISHED;
 }
 
@@ -758,7 +758,7 @@ float bot_cmd_if()
 
 float bot_cmd_else()
 {
-       self.bot_cmd_condition_status &~= CMD_CONDITION_TRUE_BLOCK;
+       self.bot_cmd_condition_status &= ~CMD_CONDITION_TRUE_BLOCK;
        self.bot_cmd_condition_status |= CMD_CONDITION_FALSE_BLOCK;
        return CMD_STATUS_FINISHED;
 }
@@ -952,79 +952,79 @@ float bot_cmd_keypress_handler(string key, float enabled)
                        if(enabled)
                        {
                                self.bot_cmd_keys |= BOT_CMD_KEY_FORWARD;
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_BACKWARD;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_BACKWARD;
                        }
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_FORWARD;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_FORWARD;
                        break;
                case "backward":
                        if(enabled)
                        {
                                self.bot_cmd_keys |= BOT_CMD_KEY_BACKWARD;
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_FORWARD;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_FORWARD;
                        }
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_BACKWARD;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_BACKWARD;
                        break;
                case "left":
                        if(enabled)
                        {
                                self.bot_cmd_keys |= BOT_CMD_KEY_LEFT;
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_RIGHT;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_RIGHT;
                        }
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_LEFT;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_LEFT;
                        break;
                case "right":
                        if(enabled)
                        {
                                self.bot_cmd_keys |= BOT_CMD_KEY_RIGHT;
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_LEFT;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_LEFT;
                        }
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_RIGHT;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_RIGHT;
                        break;
                case "jump":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_JUMP;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_JUMP;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_JUMP;
                        break;
                case "crouch":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_CROUCH;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_CROUCH;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_CROUCH;
                        break;
                case "attack1":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_ATTACK1;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_ATTACK1;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_ATTACK1;
                        break;
                case "attack2":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_ATTACK2;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_ATTACK2;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_ATTACK2;
                        break;
                case "use":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_USE;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_USE;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_USE;
                        break;
                case "hook":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_HOOK;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_HOOK;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_HOOK;
                        break;
                case "chat":
                        if(enabled)
                                self.bot_cmd_keys |= BOT_CMD_KEY_CHAT;
                        else
-                               self.bot_cmd_keys &~= BOT_CMD_KEY_CHAT;
+                               self.bot_cmd_keys &= ~BOT_CMD_KEY_CHAT;
                        break;
                default:
                        break;
@@ -1102,7 +1102,7 @@ float bot_cmd_sound()
        string sample = f;
        float chan = CH_WEAPON_B;
        float vol = VOL_BASE;
-       float atten = ATTN_MIN;
+       float atten = ATTEN_MIN;
 
        if(n >= 1)
                sample = argv(n - 1);
index fb7beea0fcaf74cfa73e4aa9deeded549cad3270..5a75551d2452652383a62728383141633b412c97 100644 (file)
@@ -2,11 +2,11 @@
  * Globals and Fields
  */
 
-float WAYPOINTFLAG_GENERATED = 8388608;
-float WAYPOINTFLAG_ITEM = 4194304;
-float WAYPOINTFLAG_TELEPORT = 2097152;
-float WAYPOINTFLAG_NORELINK = 1048576;
-float WAYPOINTFLAG_PERSONAL = 524288;
+const float WAYPOINTFLAG_GENERATED = 8388608;
+const float WAYPOINTFLAG_ITEM = 4194304;
+const float WAYPOINTFLAG_TELEPORT = 2097152;
+const float WAYPOINTFLAG_NORELINK = 1048576;
+const float WAYPOINTFLAG_PERSONAL = 524288;
 
 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
index c87eee433669cc01da6cd30de366ff459b0d42d7..5c08d7bbd0473c2a44ed533e764ae764a65c57a8 100644 (file)
@@ -144,7 +144,7 @@ float CheatImpulse(float i)
                        self.personal.ammo_fuel = self.ammo_fuel;
                        self.personal.health = self.health;
                        self.personal.armorvalue = self.armorvalue;
-                       WEPSET_COPY_EE(self.personal, self);
+                       self.personal.weapons = self.weapons;
                        self.personal.items = self.items;
                        self.personal.pauserotarmor_finished = self.pauserotarmor_finished;
                        self.personal.pauserothealth_finished = self.pauserothealth_finished;
@@ -201,7 +201,7 @@ float CheatImpulse(float i)
                                self.ammo_fuel = self.personal.ammo_fuel;
                                self.health = self.personal.health;
                                self.armorvalue = self.personal.armorvalue;
-                               WEPSET_COPY_EE(self, self.personal);
+                               self.weapons = self.personal.weapons;
                                self.items = self.personal.items;
                                self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time;
                                self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time;
@@ -260,7 +260,7 @@ float CheatImpulse(float i)
                                e = self;
 
                        pointparticles(particleeffectnum("rocket_explode"), e.origin, '0 0 0', 1);
-                       sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                       sound(e, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
 
                        e2 = spawn();
                        setorigin(e2, e.origin);
@@ -880,7 +880,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
        draggee.draggravity = draggee.gravity;
        draggee.movetype = MOVETYPE_WALK;
        draggee.gravity = 0.00001;
-       draggee.flags &~= FL_ONGROUND;
+       draggee.flags &= ~FL_ONGROUND;
        draggee.draggedby = dragger;
 
        dragger.dragentity = draggee;
@@ -985,7 +985,7 @@ void Drag_Update(entity dragger)
        entity draggee;
 
        draggee = dragger.dragentity;
-       draggee.flags &~= FL_ONGROUND;
+       draggee.flags &= ~FL_ONGROUND;
 
        curorigin = gettaginfo(draggee, 0);
        curorigin = curorigin + v_forward * dragger.draglocalvector_x + v_right * dragger.draglocalvector_y + v_up * dragger.draglocalvector_z;
index d7ca62ba01a800c4ee8f7ee848940649b84206a0..d79c07465a858e5084489a47ef995c8dd3d75638 100644 (file)
@@ -241,7 +241,7 @@ void PutObserverInServer (void)
        setorigin (self, (spot.origin + PL_VIEW_OFS)); // offset it so that the spectator spawns higher off the ground, looks better this way
        self.prevorigin = self.origin;
        self.items = 0;
-       WEPSET_CLEAR_E(self);
+       self.weapons = '0 0 0';
        self.model = "";
        FixPlayermodel();
        setmodel(self, "null");
@@ -433,7 +433,7 @@ void PutClientInServer (void)
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
-                       WEPSET_COPY_EA(self, warmup_start_weapons);
+                       self.weapons = warmup_start_weapons;
                }
                else
                {
@@ -444,10 +444,10 @@ void PutClientInServer (void)
                        self.ammo_fuel = start_ammo_fuel;
                        self.health = start_health;
                        self.armorvalue = start_armorvalue;
-                       WEPSET_COPY_EA(self, start_weapons);
+                       self.weapons = start_weapons;
                }
 
-               if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS)) // exception for minstagib, as minstanex is a superweapon
+               if(self.weapons & WEPSET_SUPERWEAPONS)
                        self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
                else
                        self.superweapons_finished = 0;
@@ -455,10 +455,10 @@ void PutClientInServer (void)
                if(g_weaponarena_random)
                {
                        if(g_weaponarena_random_with_laser)
-                               WEPSET_ANDNOT_EW(self, WEP_LASER);
+                               self.weapons &= ~WEPSET_LASER;
                        W_RandomWeapons(self, g_weaponarena_random);
                        if(g_weaponarena_random_with_laser)
-                               WEPSET_OR_EW(self, WEP_LASER);
+                               self.weapons |= WEPSET_LASER;
                }
 
                self.items = start_items;
@@ -1180,7 +1180,7 @@ void ClientConnect (void)
                        Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
                }
 
-               if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
+               if(autocvar_g_bugrigs || (g_weaponarena_weapons == WEPSET_TUBA))
                        stuffcmd(self, "cl_cmd settemp chase_active 1\n");
        }
 
@@ -1282,7 +1282,7 @@ void ClientDisconnect (void)
 
        // Here, everything has been done that requires this player to be a client.
 
-       self.flags &~= FL_CLIENT;
+       self.flags &= ~FL_CLIENT;
 
        if (self.chatbubbleentity)
                remove (self.chatbubbleentity);
@@ -1403,7 +1403,7 @@ void play_countdown(float finished, string samp)
        if(IS_REAL_CLIENT(self))
                if(floor(finished - time - frametime) != floor(finished - time))
                        if(finished - time < 6)
-                               sound (self, CH_INFO, samp, VOL_BASE, ATTN_NORM);
+                               sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
 }
 
 void player_powerups (void)
@@ -1414,9 +1414,9 @@ void player_powerups (void)
        if((self.items & IT_USING_JETPACK) && !self.deadflag)
                self.modelflags |= MF_ROCKET;
        else
-               self.modelflags &~= MF_ROCKET;
+               self.modelflags &= ~MF_ROCKET;
 
-       self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+       self.effects &= ~(EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
        if((self.alpha < 0 || self.deadflag) && !self.vehicle) // don't apply the flags if the player is gibbed
                return;
@@ -1468,7 +1468,7 @@ void player_powerups (void)
                }
                if (self.items & IT_SUPERWEAPON)
                {
-                       if (!WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+                       if (!(self.weapons & WEPSET_SUPERWEAPONS))
                        {
                                self.superweapons_finished = 0;
                                self.items = self.items - (self.items & IT_SUPERWEAPON);
@@ -1485,13 +1485,13 @@ void player_powerups (void)
                                if (time > self.superweapons_finished)
                                {
                                        self.items = self.items - (self.items & IT_SUPERWEAPON);
-                                       WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS);
+                                       self.weapons &= ~WEPSET_SUPERWEAPONS;
                                        //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, self.netname);
                                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
                                }
                        }
                }
-               else if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+               else if(self.weapons & WEPSET_SUPERWEAPONS)
                {
                        if (time < self.superweapons_finished || (self.items & IT_UNLIMITED_SUPERWEAPONS))
                        {
@@ -1502,7 +1502,7 @@ void player_powerups (void)
                        else
                        {
                                self.superweapons_finished = 0;
-                               WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS);
+                               self.weapons &= ~WEPSET_SUPERWEAPONS;
                        }
                }
                else
@@ -1608,7 +1608,7 @@ void player_regen (void)
        }
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
+               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
 }
 
 float zoomstate_set;
@@ -1627,52 +1627,52 @@ void GetPressedKeys(void) {
        if (self.movement_x > 0) // get if movement keys are pressed
        {       // forward key pressed
                self.pressedkeys |= KEY_FORWARD;
-               self.pressedkeys &~= KEY_BACKWARD;
+               self.pressedkeys &= ~KEY_BACKWARD;
        }
        else if (self.movement_x < 0)
        {       // backward key pressed
                self.pressedkeys |= KEY_BACKWARD;
-               self.pressedkeys &~= KEY_FORWARD;
+               self.pressedkeys &= ~KEY_FORWARD;
        }
        else
        {       // no x input
-               self.pressedkeys &~= KEY_FORWARD;
-               self.pressedkeys &~= KEY_BACKWARD;
+               self.pressedkeys &= ~KEY_FORWARD;
+               self.pressedkeys &= ~KEY_BACKWARD;
        }
 
        if (self.movement_y > 0)
        {       // right key pressed
                self.pressedkeys |= KEY_RIGHT;
-               self.pressedkeys &~= KEY_LEFT;
+               self.pressedkeys &= ~KEY_LEFT;
        }
        else if (self.movement_y < 0)
        {       // left key pressed
                self.pressedkeys |= KEY_LEFT;
-               self.pressedkeys &~= KEY_RIGHT;
+               self.pressedkeys &= ~KEY_RIGHT;
        }
        else
        {       // no y input
-               self.pressedkeys &~= KEY_RIGHT;
-               self.pressedkeys &~= KEY_LEFT;
+               self.pressedkeys &= ~KEY_RIGHT;
+               self.pressedkeys &= ~KEY_LEFT;
        }
 
        if (self.BUTTON_JUMP) // get if jump and crouch keys are pressed
                self.pressedkeys |= KEY_JUMP;
        else
-               self.pressedkeys &~= KEY_JUMP;
+               self.pressedkeys &= ~KEY_JUMP;
        if (self.BUTTON_CROUCH)
                self.pressedkeys |= KEY_CROUCH;
        else
-               self.pressedkeys &~= KEY_CROUCH;
+               self.pressedkeys &= ~KEY_CROUCH;
 
        if (self.BUTTON_ATCK)
                self.pressedkeys |= KEY_ATCK;
        else
-               self.pressedkeys &~= KEY_ATCK;
+               self.pressedkeys &= ~KEY_ATCK;
        if (self.BUTTON_ATCK2)
                self.pressedkeys |= KEY_ATCK2;
        else
-               self.pressedkeys &~= KEY_ATCK2;
+               self.pressedkeys &= ~KEY_ATCK2;
 }
 
 /*
@@ -1703,7 +1703,7 @@ void SpectateCopy(entity spectatee) {
        self.strength_finished = spectatee.strength_finished;
        self.invincible_finished = spectatee.invincible_finished;
        self.pressedkeys = spectatee.pressedkeys;
-       WEPSET_COPY_EE(self, spectatee);
+       self.weapons = spectatee.weapons;
        self.switchweapon = spectatee.switchweapon;
        self.switchingweapon = spectatee.switchingweapon;
        self.weapon = spectatee.weapon;
@@ -2053,10 +2053,10 @@ void ObserverThink()
        float prefered_movetype;
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
-                       self.flags &~= FL_JUMPRELEASED;
+                       self.flags &= ~FL_JUMPRELEASED;
                        self.flags |= FL_SPAWNING;
                } else if(self.BUTTON_ATCK && !self.version_mismatch) {
-                       self.flags &~= FL_JUMPRELEASED;
+                       self.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
                                self.classname = "spectator";
                        }
@@ -2070,7 +2070,7 @@ void ObserverThink()
                        self.flags |= FL_JUMPRELEASED;
                        if(self.flags & FL_SPAWNING)
                        {
-                               self.flags &~= FL_SPAWNING;
+                               self.flags &= ~FL_SPAWNING;
                                LeaveSpectatorMode();
                                return;
                        }
@@ -2082,10 +2082,10 @@ void SpectatorThink()
 {
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
-                       self.flags &~= FL_JUMPRELEASED;
+                       self.flags &= ~FL_JUMPRELEASED;
                        self.flags |= FL_SPAWNING;
-               } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209) {
-                       self.flags &~= FL_JUMPRELEASED;
+               } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
+                       self.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
                                self.classname = "spectator";
                        } else {
@@ -2093,8 +2093,8 @@ void SpectatorThink()
                                PutClientInServer();
                        }
                        self.impulse = 0;
-               } else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229) {
-                       self.flags &~= FL_JUMPRELEASED;
+               } else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || (self.impulse >= 220 && self.impulse <= 229)) {
+                       self.flags &= ~FL_JUMPRELEASED;
                        if(SpectatePrev()) {
                                self.classname = "spectator";
                        } else {
@@ -2103,7 +2103,7 @@ void SpectatorThink()
                        }
                        self.impulse = 0;
                } else if (self.BUTTON_ATCK2) {
-                       self.flags &~= FL_JUMPRELEASED;
+                       self.flags &= ~FL_JUMPRELEASED;
                        self.classname = "observer";
                        PutClientInServer();
                } else {
@@ -2115,7 +2115,7 @@ void SpectatorThink()
                        self.flags |= FL_JUMPRELEASED;
                        if(self.flags & FL_SPAWNING)
                        {
-                               self.flags &~= FL_SPAWNING;
+                               self.flags &= ~FL_SPAWNING;
                                LeaveSpectatorMode();
                                return;
                        }
@@ -2384,7 +2384,7 @@ void PlayerPreThink (void)
                // LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
                //if(frametime)
                {
-                       self.items &~= self.items_added;
+                       self.items &= ~self.items_added;
 
                        W_WeaponFrame();
 
index 3288bbc72a9af3b52cfcc56c64e44ddd8df4b4cd..a94ba29015d166cde2577dca407639e3d7163376 100644 (file)
@@ -272,7 +272,7 @@ void ImpulseCommands (void)
                                        for(e = findchain(classname, "waypoint"); e; e = e.chain)
                                        {
                                                e.colormod = '0.5 0.5 0.5';
-                                               e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
+                                               e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
                                        }
                                        e2 = navigation_findnearestwaypoint(self, FALSE);
                                        navigation_markroutes(e2);
@@ -318,7 +318,7 @@ void ImpulseCommands (void)
                                                if(navigation_findnearestwaypoint(e, FALSE))
                                                {
                                                        setorigin(e, org);
-                                                       e.effects &~= EF_NODEPTHTEST;
+                                                       e.effects &= ~EF_NODEPTHTEST;
                                                        e.model = "";
                                                }
                                                else
@@ -341,7 +341,7 @@ void ImpulseCommands (void)
                                        start = findchainflags(flags, FL_ITEM);
                                        for(e = start; e; e = e.chain)
                                        {
-                                               e.effects &~= EF_NODEPTHTEST | EF_RED | EF_BLUE;
+                                               e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
                                                e.colormod = '0.5 0.5 0.5';
                                        }
                                        for(e = start; e; e = e.chain)
index a7051ff14c4b18da5e95a228fae1ccd4c64c44ff..b5b6ad793570cd4a980d7e68048da9918c733e5d 100644 (file)
@@ -106,8 +106,8 @@ void PlayerJump (void)
        self.velocity_z = self.velocity_z + mjumpheight;
        self.oldvelocity_z = self.velocity_z;
 
-       self.flags &~= FL_ONGROUND;
-       self.flags &~= FL_JUMPRELEASED;
+       self.flags &= ~FL_ONGROUND;
+       self.flags &= ~FL_JUMPRELEASED;
 
        animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
        
@@ -139,7 +139,7 @@ void CheckWaterJump()
                {       // open at eye level
                        self.flags |= FL_WATERJUMP;
                        self.velocity_z = 225;
-                       self.flags &~= FL_JUMPRELEASED;
+                       self.flags &= ~FL_JUMPRELEASED;
                        self.teleport_time = time + 2;  // safety net
                        return;
                }
@@ -327,7 +327,7 @@ void RaceCarPhysics()
                else
                {
                        // now set angles_x so that the car points forward, but is tilted in velocity direction
-                       self.flags &~= FL_ONGROUND;
+                       self.flags &= ~FL_ONGROUND;
                }
 
                self.velocity = (neworigin - self.origin) * (1.0 / frametime);
@@ -748,7 +748,7 @@ void SV_PlayerPhysics()
                bot_think();
        }
        
-       self.items &~= IT_USING_JETPACK;
+       self.items &= ~IT_USING_JETPACK;
 
        if(IS_PLAYER(self))
        {
@@ -809,15 +809,15 @@ void SV_PlayerPhysics()
                maxspd_mod = autocvar_sv_spectator_speed_multiplier;
                if(!self.spectatorspeed)
                        self.spectatorspeed = maxspd_mod;
-               if(self.impulse && self.impulse <= 19 || self.impulse >= 200 && self.impulse <= 209 || self.impulse >= 220 && self.impulse <= 229)
+               if(self.impulse && self.impulse <= 19 || (self.impulse >= 200 && self.impulse <= 209) || (self.impulse >= 220 && self.impulse <= 229))
                {
                        if(self.lastclassname != "player")
                        {
-                               if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209)
+                               if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209))
                                        self.spectatorspeed = bound(1, self.spectatorspeed + 0.5, 5);
                                else if(self.impulse == 11)
                                        self.spectatorspeed = maxspd_mod;
-                               else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229)
+                               else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || (self.impulse >= 220 && self.impulse <= 229))
                                        self.spectatorspeed = bound(1, self.spectatorspeed - 0.5, 5);
                                else if(self.impulse >= 1 && self.impulse <= 9)
                                        self.spectatorspeed = 1 + 0.5 * (self.impulse - 1);
@@ -887,7 +887,7 @@ void SV_PlayerPhysics()
                self.velocity_y = self.movedir_y;
                if (time > self.teleport_time || self.waterlevel == WATERLEVEL_NONE)
                {
-                       self.flags &~= FL_WATERJUMP;
+                       self.flags &= ~FL_WATERJUMP;
                        self.teleport_time = 0;
                }
        }
@@ -898,7 +898,7 @@ void SV_PlayerPhysics()
        else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY)
        {
                // noclipping or flying
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
 
                self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
                makevectors(self.v_angle);
@@ -915,7 +915,7 @@ void SV_PlayerPhysics()
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
                // swimming
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
 
                makevectors(self.v_angle);
                //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
@@ -938,7 +938,7 @@ void SV_PlayerPhysics()
        else if (time < self.ladder_time)
        {
                // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
 
                float g;
                g = autocvar_sv_gravity * frametime;
@@ -1078,7 +1078,7 @@ void SV_PlayerPhysics()
                        self.velocity = self.velocity + wishvel * f * frametime;
                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                                self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
-                       self.flags &~= FL_ONGROUND;
+                       self.flags &= ~FL_ONGROUND;
                        self.items |= IT_USING_JETPACK;
 
                        // jetpack also inhibits health regeneration, but only for 1 second
index fbe6d7aea9dbda56745613bc34d0944d39c1cdad..c901780d448748deeceae54ab9dc575ce4f593b6 100644 (file)
@@ -262,7 +262,7 @@ void player_anim (void)
 
 void SpawnThrownWeapon (vector org, float w)
 {
-       if(WEPSET_CONTAINS_EW(self, self.weapon))
+       if(self.weapons & WepSet_FromWeapon(self.weapon))
                if(W_IsWeaponThrowable(self.weapon))
                        W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
 }
@@ -283,11 +283,11 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        if(sound_allowed(MSG_BROADCAST, attacker))
        {
                if (save > 10)
-                       sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
                else if (take > 30)
-                       sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
                else if (take > 10)
-                       sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM);
        }
 
        if (take > 50)
@@ -415,11 +415,11 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        if(sound_allowed(MSG_BROADCAST, attacker))
        {
                if (save > 10)
-                       sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM);
                else if (take > 30)
-                       sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM);
                else if (take > 10)
-                       sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM); // FIXME possibly remove them?
+                       sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME possibly remove them?
        }
 
        if (take > 50)
@@ -613,7 +613,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                self.solid = SOLID_CORPSE;
                self.ballistics_density = autocvar_g_ballistics_density_corpse;
                // don't stick to the floor
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
                // dying animation
                self.deadflag = DEAD_DYING;
                // when to allow respawn
@@ -1096,15 +1096,15 @@ void FakeGlobalSound(string sample, float chan, float voicetype)
                        {
                                msg_entity = self;
                                if(IS_REAL_CLIENT(msg_entity))
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
                        }
                        break;
                case VOICETYPE_TEAMRADIO:
                        msg_entity = self;
                        if(msg_entity.cvar_cl_voice_directional == 1)
-                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
                        else
-                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                        break;
                case VOICETYPE_AUTOTAUNT:
                        if(!sv_autotaunt)
@@ -1118,9 +1118,9 @@ void FakeGlobalSound(string sample, float chan, float voicetype)
                        if (tauntrand < msg_entity.cvar_cl_autotaunt)
                        {
                                if (msg_entity.cvar_cl_voice_directional >= 1)
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
                                else
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                        }
                        break;
                case VOICETYPE_TAUNT:
@@ -1133,13 +1133,13 @@ void FakeGlobalSound(string sample, float chan, float voicetype)
                                break;
                        msg_entity = self;
                        if (msg_entity.cvar_cl_voice_directional >= 1)
-                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
                        else
-                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                        break;
                case VOICETYPE_PLAYERSOUND:
                        msg_entity = self;
-                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NORM);
+                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NORM);
                        break;
                default:
                        backtrace("Invalid voice type!");
@@ -1171,9 +1171,9 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if(IS_REAL_CLIENT(msg_entity))
                                {
                                        if(msg_entity.cvar_cl_voice_directional == 1)
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
                                        else
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                                }
                        }
                        break;
@@ -1184,13 +1184,13 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if(IS_REAL_CLIENT(msg_entity))
                                {
                                        if(msg_entity.cvar_cl_voice_directional == 1)
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
                                        else
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                                }
                                msg_entity = self;
                                if(IS_REAL_CLIENT(msg_entity))
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE);
                        }
                        break;
                case VOICETYPE_TEAMRADIO:
@@ -1198,9 +1198,9 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if(!teamplay || msg_entity.team == self.team)
                                {
                                        if(msg_entity.cvar_cl_voice_directional == 1)
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN);
                                        else
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                                }
                        break;
                case VOICETYPE_AUTOTAUNT:
@@ -1215,9 +1215,9 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if (tauntrand < msg_entity.cvar_cl_autotaunt)
                                {
                                        if (msg_entity.cvar_cl_voice_directional >= 1)
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
                                        else
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                                }
                        break;
                case VOICETYPE_TAUNT:
@@ -1231,13 +1231,13 @@ void GlobalSound(string sample, float chan, float voicetype)
                        FOR_EACH_REALCLIENT(msg_entity)
                        {
                                if (msg_entity.cvar_cl_voice_directional >= 1)
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX));
                                else
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);
+                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE);
                        }
                        break;
                case VOICETYPE_PLAYERSOUND:
-                       sound(self, chan, sample, VOL_BASE, ATTN_NORM);
+                       sound(self, chan, sample, VOL_BASE, ATTEN_NORM);
                        break;
                default:
                        backtrace("Invalid voice type!");
index 34f17a613a7f438f566b6d47859463f50729ac4b..2fc23307edee6e1f8187a02496f8758bcca2ac26 100644 (file)
@@ -188,7 +188,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        wep.flags |= FL_TOSSED;
        wep.colormap = own.colormap;
 
-       if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, wpn))
+       if(WepSet_FromWeapon(wpn) & WEPSET_SUPERWEAPONS)
        {
                if(own.items & IT_UNLIMITED_SUPERWEAPONS)
                {
@@ -198,8 +198,8 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                {
                        float superweapons = 1;
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-                               if(WEPSET_CONTAINS_AW(WEPBIT_SUPERWEAPONS, i))
-                                       if(WEPSET_CONTAINS_EW(own, i))
+                               if(WepSet_FromWeapon(i) & WEPSET_SUPERWEAPONS)
+                                       if(own.weapons & WepSet_FromWeapon(i))
                                                ++superweapons;
                        if(superweapons <= 1)
                        {
@@ -309,7 +309,7 @@ float W_IsWeaponThrowable(float w)
         return 0;
        
        wa = W_AmmoItemCode(w);
-       if(WEPSET_CONTAINS_AW(start_weapons, w))
+       if(start_weapons & WepSet_FromWeapon(w))
        {
                // start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
                if(start_items & IT_UNLIMITED_WEAPON_AMMO)
@@ -339,9 +339,9 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
        if(!W_IsWeaponThrowable(w))
                return;
 
-       if(!WEPSET_CONTAINS_EW(self, w))
+       if(!(self.weapons & WepSet_FromWeapon(w)))
                return;
-       WEPSET_ANDNOT_EW(self, w);
+       self.weapons &= ~WepSet_FromWeapon(w);
 
        W_SwitchWeapon_Force(self, w_getbestweapon(self));
        a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
@@ -386,7 +386,7 @@ void W_WeaponFrame()
                self.switchingweapon = 0;
                self.weaponentity.state = WS_CLEAR;
                self.weaponname = "";
-               self.items &~= IT_AMMO;
+               self.items &= ~IT_AMMO;
                return;
        }
 
@@ -440,7 +440,7 @@ void W_WeaponFrame()
                        if(ATTACK_FINISHED(self) <= time + self.weapon_frametime * 0.5)
                        {
 #endif
-                       sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_WEAPON_SINGLE, "weapons/weapon_switch.wav", VOL_BASE, ATTEN_NORM);
                        self.weaponentity.state = WS_DROP;
                        // set up weapon switch think in the future, and start drop anim
                        weapon_thinkf(WFRAME_DONTCHANGE, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear);
@@ -467,7 +467,7 @@ void W_WeaponFrame()
        while (c < W_TICSPERFRAME)
        {
                c = c + 1;
-               if(w && !WEPSET_CONTAINS_EW(self, w))
+               if(w && !(self.weapons & WepSet_FromWeapon(w)))
                {
                        if(self.weapon == self.switchweapon)
                                W_SwitchWeapon_Force(self, w_getbestweapon(self));
index 81a4f5a7ef895e4a704b91b9a02ea9c0aad4436a..f530b54046e4653f100baa6c454352130078672a 100644 (file)
@@ -27,11 +27,11 @@ void W_SwitchWeapon_Force(entity e, float w)
 .float antilag_debug;
 
 // VorteX: static frame globals
-float WFRAME_DONTCHANGE = -1;
-float WFRAME_FIRE1 = 0;
-float WFRAME_FIRE2 = 1;
-float WFRAME_IDLE = 2;
-float WFRAME_RELOAD = 3;
+const float WFRAME_DONTCHANGE = -1;
+const float WFRAME_FIRE1 = 0;
+const float WFRAME_FIRE2 = 1;
+const float WFRAME_IDLE = 2;
+const float WFRAME_RELOAD = 3;
 .float wframe;
 
 void(float fr, float t, void() func) weapon_thinkf;
@@ -121,7 +121,7 @@ void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
                && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
                || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
                {
-                       sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+                       sound(player, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTEN_NORM);
                        player.prevstrengthsound = time;
                }
                player.prevstrengthsoundattempt = time;
@@ -238,7 +238,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
 
        if (snd != "")
        {
-               sound (ent, chan, snd, VOL_BASE, ATTN_NORM);
+               sound (ent, chan, snd, VOL_BASE, ATTEN_NORM);
                W_PlayStrengthSound(ent);
        }
 
@@ -517,10 +517,10 @@ void CL_Weaponentity_Think()
 
        tb = (self.effects & (EF_TELEPORT_BIT | EF_RESTARTANIM_BIT));
        self.effects = self.owner.effects & EFMASK_CHEAP;
-       self.effects &~= EF_LOWPRECISION;
-       self.effects &~= EF_FULLBRIGHT; // can mask team color, so get rid of it
-       self.effects &~= EF_TELEPORT_BIT;
-       self.effects &~= EF_RESTARTANIM_BIT;
+       self.effects &= ~EF_LOWPRECISION;
+       self.effects &= ~EF_FULLBRIGHT; // can mask team color, so get rid of it
+       self.effects &= ~EF_TELEPORT_BIT;
+       self.effects &= ~EF_RESTARTANIM_BIT;
        self.effects |= tb;
 
        if(self.owner.alpha == default_player_alpha)
@@ -668,7 +668,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
        if(complain)
                self.hasweapon_complain_spam = time + 0.2;
                
-       if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !WEPSET_CONTAINS_EW(cl, wpn) && !WEPSET_CONTAINS_AW(weaponsInMap, wpn))
+       if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
                complain = 0;
 
        if (wpn < WEP_FIRST || wpn > WEP_LAST)
@@ -677,7 +677,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                        sprint(self, "Invalid weapon\n");
                return FALSE;
        }
-       if (WEPSET_CONTAINS_EW(cl, wpn))
+       if (cl.weapons & WepSet_FromWeapon(wpn))
        {
                if (andammo)
                {
@@ -717,7 +717,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
        {
                // DRESK - 3/16/07
                // Report Proper Weapon Status / Modified Weapon Ownership Message
-               if (WEPSET_CONTAINS_AW(weaponsInMap, wpn))
+               if (weaponsInMap & WepSet_FromWeapon(wpn))
                {
                        Send_WeaponComplain(cl, wpn, W_Name(wpn), 1);
 
@@ -784,7 +784,7 @@ void weapon_setup(float windex)
 {
        entity e;
        e = get_weaponinfo(windex);
-       self.items &~= IT_AMMO;
+       self.items &= ~IT_AMMO;
        self.items = self.items | (e.items & IT_AMMO);
 
        // the two weapon entities will notice this has changed and update their models
@@ -800,11 +800,11 @@ void W_SwitchToOtherWeapon(entity pl)
        // hack to ensure it switches to an OTHER weapon (in case the other fire mode still has ammo, we want that anyway)
        float w, ww;
        w = pl.weapon;
-       if(WEPSET_CONTAINS_EW(pl, w))
+       if(pl.weapons & WepSet_FromWeapon(w))
        {
-               WEPSET_ANDNOT_EW(pl, w);
+               pl.weapons &= ~WepSet_FromWeapon(w);
                ww = w_getbestweapon(pl);
-               WEPSET_OR_EW(pl, w);
+               pl.weapons |= WepSet_FromWeapon(w);
        }
        else
                ww = w_getbestweapon(pl);
@@ -827,7 +827,7 @@ float weapon_prepareattack_checkammo(float secondary)
 
                if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
                {
-                       sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTEN_NORM);
                        self.prevdryfire = time;
                }
 
@@ -1386,7 +1386,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
 
        // now begin the reloading process
 
-       sound (self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_SINGLE, self.reload_sound, VOL_BASE, ATTEN_NORM);
 
        // do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,
        // then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,
index d8651762965d9d6859dbc05ed205b5ee0407d8dc..7fd707813570331d9d20f4d63a958138f70cc01b 100644 (file)
@@ -397,9 +397,9 @@ float RadarMap_Make(float argc)
                                case "--force": { radarmapper.count |= 1; break; }
                                case "--loop": { radarmapper.count |= 2; break; }
                                case "--quit": { radarmapper.count |= 4; break; }
-                               case "--block": { radarmapper.count &~= 24; break; }
-                               case "--trace": { radarmapper.count &~= 24; radarmapper.count |= 8; break; }
-                               case "--sample": { radarmapper.count &~= 24; radarmapper.count |= 16; break; }
+                               case "--block": { radarmapper.count &= ~24; break; }
+                               case "--trace": { radarmapper.count &= ~24; radarmapper.count |= 8; break; }
+                               case "--sample": { radarmapper.count &= ~24; radarmapper.count |= 16; break; }
                                case "--lineblock": { radarmapper.count |= 24; break; }
                                case "--flags": { ++i; radarmapper.count = stof(argv(i)); break; } // for the recursive call
                                case "--sharpen": { ++i; radarmapper.ltime = stof(argv(i)); break; } // for the recursive call
index b92d8466f310a9fa348eeafd8fdb950cd815a666..706de70722d306c707ec6015c57e25fdf26fe581 100644 (file)
@@ -4,8 +4,8 @@
 
 entity radarmapper;
 
-float RADAR_WIDTH_MAX = 512;
-float RADAR_HEIGHT_MAX = 512;
+const float RADAR_WIDTH_MAX = 512;
+const float RADAR_HEIGHT_MAX = 512;
 float sharpen_buffer[RADAR_WIDTH_MAX * 3];
 
 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
index c7010dfb756369a47cd41aff93425d567d69bfc4..35d441fece3166e3983aeb8a963b727ac6c8e4d7 100644 (file)
@@ -43,7 +43,7 @@ float Nagger_SendEntity(entity to, float sendflags)
                nags |= 128;
 
        if(!(nags & 4)) // no vote called? send no string
-               nags &~= (64 | 128);
+               nags &= ~(64 | 128);
 
        WriteByte(MSG_ENTITY, nags);
 
index cb3c34fdc4de8a5fd6e4ef2f8c716a7d650381ad..ada2acd1adf3a183c76aed99298521e4711a8b83 100644 (file)
-float  FALSE                                   = 0;
-float  TRUE                                    = 1;
+const float FL_WEAPON = 8192;
+const float FL_POWERUP = 16384;
+const float FL_PROJECTILE = 32768;
+const float FL_TOSSED = 65536;
+const float FL_NO_WEAPON_STAY = 131072;
+const float FL_SPAWNING = 262144;
 
-float  FL_FLY                                  = 1;
-float  FL_SWIM                                 = 2;
-float  FL_CLIENT                               = 8;
-float  FL_INWATER                              = 16;
-float  FL_MONSTER                              = 32;
-float  FL_GODMODE                              = 64;
-float  FL_NOTARGET                             = 128;
-float  FL_ITEM                                 = 256;
-float  FL_ONGROUND                             = 512;
-float  FL_PARTIALGROUND                        = 1024;
-float  FL_WATERJUMP                            = 2048;
-float  FL_JUMPRELEASED                         = 4096;
-float  FL_WEAPON                               = 8192;
-float  FL_POWERUP                              = 16384;
-float  FL_PROJECTILE                           = 32768;
-float  FL_TOSSED                               = 65536;
-float   FL_NO_WEAPON_STAY       = 131072;
-float   FL_SPAWNING       = 262144;
+const float SVC_SOUND = 6;
+const float SVC_STOPSOUND = 16;
+const float SVC_SETVIEW = 5;
 
-float  MOVETYPE_NONE                           = 0;
-float  MOVETYPE_ANGLENOCLIP                    = 1;
-float  MOVETYPE_ANGLECLIP                      = 2;
-float  MOVETYPE_WALK                           = 3;
-float  MOVETYPE_STEP                           = 4;
-float  MOVETYPE_FLY                            = 5;
-float  MOVETYPE_TOSS                           = 6;
-float  MOVETYPE_PUSH                           = 7;
-float  MOVETYPE_NOCLIP                         = 8;
-float  MOVETYPE_FLYMISSILE                     = 9;
-float  MOVETYPE_BOUNCE                         = 10;
-float  MOVETYPE_BOUNCEMISSILE  = 11;   // Like bounce but doesn't lose speed on bouncing
-//float        MOVETYPE_FOLLOW                         = 12;   // 'Attaches' the entity to its aim_ent
-//float MOVETYPE_FLY_WORLDONLY = 33;
-
-float  SOLID_NOT                               = 0;
-float  SOLID_TRIGGER                           = 1;
-float  SOLID_BBOX                              = 2;
-float  SOLID_SLIDEBOX                          = 3;
-float  SOLID_BSP                               = 4;
-
-float  DEAD_NO                                 = 0;
-float  DEAD_DYING                              = 1;
-float  DEAD_DEAD                               = 2;
-float  DEAD_RESPAWNABLE                        = 3;
-float  DEAD_RESPAWNING                 = 4;
-
-float  RESPAWN_FORCE                   = 1;
-float  RESPAWN_SILENT                  = 2;
-
-float  DAMAGE_NO                               = 0;
-float  DAMAGE_YES                              = 1;
-float  DAMAGE_AIM                              = 2;
-
-float  CONTENT_EMPTY                           = -1;
-float  CONTENT_SOLID                           = -2;
-float  CONTENT_WATER                           = -3;
-float  CONTENT_SLIME                           = -4;
-float  CONTENT_LAVA                            = -5;
-float  CONTENT_SKY                             = -6;
-
-float  SVC_BAD                                 = 0;
-float  SVC_NOP                                 = 1;
-float  SVC_DISCONNECT                          = 2;
-float  SVC_UPDATESTAT                          = 3;
-float  SVC_VERSION                             = 4;
-float  SVC_SETVIEW                             = 5;
-float  SVC_SOUND                               = 6;
-float  SVC_TIME                                = 7;
-float  SVC_PRINT                               = 8;
-float  SVC_STUFFTEXT                           = 9;
-float  SVC_SETANGLE                            = 10;
-float  SVC_SERVERINFO                          = 11;
-float  SVC_LIGHTSTYLE                          = 12;
-float  SVC_UPDATENAME                          = 13;
-float  SVC_UPDATEFRAGS                         = 14;
-float  SVC_CLIENTDATA                          = 15;
-float  SVC_STOPSOUND                           = 16;
-float  SVC_UPDATECOLORS                        = 17;
-float  SVC_PARTICLE                            = 18;
-float  SVC_DAMAGE                              = 19;
-float  SVC_SPAWNSTATIC                         = 20;
-float  SVC_SPAWNBINARY                         = 21;
-float  SVC_SPAWNBASELINE                       = 22;
-float  SVC_TEMPENTITY                          = 23;
-float  SVC_SETPAUSE                            = 24;
-float  SVC_SIGNONNUM                           = 25;
-float  SVC_CENTERPRINT                         = 26;
-float  SVC_KILLEDMONSTER                       = 27;
-float  SVC_FOUNDSECRET                         = 28;
-float  SVC_SPAWNSTATICSOUND                    = 29;
-float  SVC_INTERMISSION                        = 30;
-float  SVC_FINALE                              = 31;
-float  SVC_CDTRACK                             = 32;
-float  SVC_SELLSCREEN                          = 33;
-float  SVC_CUTSCENE                            = 34;
-
-float  TE_SPIKE                                = 0;
-float  TE_SUPERSPIKE                           = 1;
-float  TE_GUNSHOT                              = 2;
-float  TE_EXPLOSION                            = 3;
-float  TE_TAREXPLOSION                         = 4;
-float  TE_LIGHTNING1                           = 5;
-float  TE_LIGHTNING2                           = 6;
-float  TE_WIZSPIKE                             = 7;
-float  TE_KNIGHTSPIKE                          = 8;
-float  TE_LIGHTNING3                           = 9;
-float  TE_LAVASPLASH                           = 10;
-float  TE_TELEPORT                             = 11;
-float TE_BEAM                                  = 13;           // grappling hook
-
-float  UPDATE_GENERAL                          = 0;
-float  UPDATE_STATIC                           = 1;
-float  UPDATE_BINARY                           = 2;
-float  UPDATE_TEMP                             = 3;
-
-float  EF_BRIGHTFIELD                          = 1;
-float  EF_MUZZLEFLASH                          = 2;
-float  EF_BRIGHTLIGHT                          = 4;
-float  EF_DIMLIGHT                             = 8;
+const float RESPAWN_FORCE = 1;
+const float RESPAWN_SILENT = 2;
 
 #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
 
-float  MSG_BROADCAST                           = 0; // unreliable
-float  MSG_ONE                                 = 1; // reliable
-float  MSG_ALL                                 = 2; // reliable
-float  MSG_INIT                                = 3; // initialization
-float  MSG_ENTITY                              = 5; // csqc
-
-// Sajt - added these, just as constants. Not sure how you want them actually put in the game, but I just
-// did this so at least they worked
-// NOTE: instagib IS NOT compatible with rocket-arena, so make sure to prevent selecting both in a menu
-//float        GAME_INSTAGIB                           = 1;   /// everyone gets the nex gun with infinite ammo, and one shot kills
-//float        GAME_ROCKET_ARENA                       = 16;  /// Everyone starts with a rocket launcher
-//float        GAME_FULLBRIGHT_PLAYERS                 = 64; /// makes the players model fullbright
-//float        GAME_TEAMS                              = 128; /// Teams, red/green/yellow/blue
-
-
-//float        POWERUP_STRENGTH_DAMAGE                 = 2; // damage multiplier for strength powerup
-//float        POWERUP_STRENGTH_FORCE                  = 4; // force multiplier for strength powerup
-
-//float        POWERUP_INVINCIBLE_TAKEDAMAGE           = 0.2; // received damage multiplier for invincible powerup
+const float MSG_ENTITY = 5; // csqc
 
-float NUM_PLAYERSKINS_TEAMPLAY = 3;
+const float NUM_PLAYERSKINS_TEAMPLAY = 3;
 
-float ASSAULT_VALUE_INACTIVE = 1000;
+const float ASSAULT_VALUE_INACTIVE = 1000;
 
-float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
+const float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
index 74d4345b824529469b3855d185a249e14221ccd4..17b75aeab646cdf039192b08a029d69b514a7681 100644 (file)
@@ -191,15 +191,15 @@ void w_ready();
 .void() weapon_think;
 
 //float        PLAYER_WEAPONSELECTION_DELAY = );
-float  PLAYER_WEAPONSELECTION_SPEED = 18;
-vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
+const float    PLAYER_WEAPONSELECTION_SPEED = 18;
+const vector   PLAYER_WEAPONSELECTION_RANGE = '0 20 -40';
 
 // weapon states (self.weaponentity.state)
-float WS_CLEAR                 = 0; // no weapon selected
-float WS_RAISE                 = 1; // raise frame
-float WS_DROP                  = 2; // deselecting frame
-float WS_INUSE                 = 3; // fire state
-float WS_READY                 = 4; // idle frame
+const float WS_CLEAR                   = 0; // no weapon selected
+const float WS_RAISE                   = 1; // raise frame
+const float WS_DROP                    = 2; // deselecting frame
+const float WS_INUSE                   = 3; // fire state
+const float WS_READY                   = 4; // idle frame
 
 // there is 2 weapon tics that can run in one server frame
 #define W_TICSPERFRAME 2
@@ -296,7 +296,7 @@ string W_Apply_Weaponreplace(string in);
 void FixIntermissionClient(entity e);
 void FixClientCvars(entity e);
 
-WEPSET_DECLARE_A(weaponsInMap);
+WepSet weaponsInMap;
 
 .float respawn_countdown; // next number to count
 
index 58e737e58c55fd72de7990f8082d6c334c2727f2..8dca538f1a417a46b271458557e8ecda139a3870 100644 (file)
@@ -164,7 +164,7 @@ void func_breakable_destroy() {
        func_breakable_destroyed();
 
        if(self.noise)
-               sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
        if(self.dmg)
                RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, self.dmg_force, DEATH_HURTTRIGGER, world);
index bd4fe2b8b07a143b9c9009b70b8ab36283e1bacb..61b5add2bbd3b0e9a5bb47109add2f574cb62df6 100644 (file)
@@ -128,7 +128,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                culprit = DEATH_WEAPONOF(deathtype);
                if(!culprit)
                        culprit = attacker.weapon;
-               else if(!WEPSET_CONTAINS_EW(attacker, culprit))
+               else if(!(attacker.weapons & WepSet_FromWeapon(culprit)))
                        culprit = attacker.weapon;
 
                if(g_weaponarena_random_with_laser && culprit == WEP_LASER)
@@ -144,26 +144,26 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                        }
 
                        if(inWarmupStage)
-                               WEPSET_COPY_EA(GiveFrags_randomweapons, warmup_start_weapons);
+                               GiveFrags_randomweapons.weapons = warmup_start_weapons;
                        else
-                               WEPSET_COPY_EA(GiveFrags_randomweapons, start_weapons);
+                               GiveFrags_randomweapons.weapons = start_weapons;
 
                        // all others (including the culprit): remove
-                       WEPSET_ANDNOT_EE(GiveFrags_randomweapons, attacker);
-                       WEPSET_ANDNOT_EW(GiveFrags_randomweapons, culprit);
+                       GiveFrags_randomweapons.weapons &= ~attacker.weapons;
+                       GiveFrags_randomweapons.weapons &= ~WepSet_FromWeapon(culprit);
 
                        // among the remaining ones, choose one by random
                        W_RandomWeapons(GiveFrags_randomweapons, 1);
 
-                       if(!WEPSET_EMPTY_E(GiveFrags_randomweapons))
+                       if(GiveFrags_randomweapons.weapons)
                        {
-                               WEPSET_OR_EE(attacker, GiveFrags_randomweapons);
-                               WEPSET_ANDNOT_EW(attacker, culprit);
+                               attacker.weapons |= GiveFrags_randomweapons.weapons;
+                               attacker.weapons &= ~WepSet_FromWeapon(culprit);
                        }
                }
 
                // after a frag, choose another random weapon set
-               if not(WEPSET_CONTAINS_EW(attacker, attacker.weapon))
+               if not(attacker.weapons & WepSet_FromWeapon(attacker.weapon))
                        W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker));
        }
 
@@ -788,7 +788,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                }
                else
                        self.velocity = self.velocity + farce;
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
                UpdateCSQCProjectile(self);
        }
        // apply damage
@@ -1227,7 +1227,7 @@ void Fire_ApplyEffect(entity e)
        if(Fire_IsBurning(e))
                e.effects |= EF_FLAME;
        else
-               e.effects &~= EF_FLAME;
+               e.effects &= ~EF_FLAME;
 }
 
 void fireburner_think()
index dec6e167d1b413c074374b0d067a440591d225f1..bde5e580a054b3912ceb0fe86f41f31c2b7607b3 100644 (file)
@@ -22,8 +22,8 @@ void GrapplingHookFrame();
 void RemoveGrapplingHook(entity pl);
 void SetGrappleHookBindings();
 // hook impulses
-float GRAPHOOK_FIRE            = 20;
-float GRAPHOOK_RELEASE         = 21;
+const float GRAPHOOK_FIRE              = 20;
+const float GRAPHOOK_RELEASE           = 21;
 // (note: you can change the hook impulse #'s to whatever you please)
 
 4. Open client.c and add this to the top of PutClientInServer():
@@ -74,7 +74,7 @@ void GrapplingHookThink();
 void GrapplingHook_Stop()
 {
        pointparticles(particleeffectnum("grapple_impact"), self.origin, '0 0 0', 1);
-       sound (self, CH_SHOTS, "weapons/hook_impact.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_SHOTS, "weapons/hook_impact.wav", VOL_BASE, ATTEN_NORM);
 
        self.state = 1;
        self.think = GrapplingHookThink;
@@ -210,14 +210,14 @@ void GrapplingHookThink()
                                        {
                                                v = v - dv * 0.5;
                                                self.aiment.velocity = self.aiment.velocity - dv * 0.5;
-                                               self.aiment.flags &~= FL_ONGROUND;
+                                               self.aiment.flags &= ~FL_ONGROUND;
                                                self.aiment.pusher = self.realowner;
                                                self.aiment.pushltime = time + autocvar_g_maxpushtime;
                                                self.aiment.istypefrag = self.aiment.BUTTON_CHAT;
                                        }
                                }
 
-                               self.realowner.flags &~= FL_ONGROUND;
+                               self.realowner.flags &= ~FL_ONGROUND;
                        }
 
                        self.realowner.velocity = WarpZone_RefSys_TransformVelocity(self, self.realowner, v);
@@ -235,7 +235,7 @@ void GrapplingHookThink()
                        self.realowner.velocity = dir*spd;
                        self.realowner.movetype = MOVETYPE_FLY;
 
-                       self.realowner.flags &~= FL_ONGROUND;
+                       self.realowner.flags &= ~FL_ONGROUND;
                }
        }
 
@@ -311,7 +311,7 @@ void FireGrapplingHook (void)
        vs = hook_shotorigin[s];
 
        // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds
-       sound (self, CH_WEAPON_B, "weapons/hook_fire.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_B, "weapons/hook_fire.wav", VOL_BASE, ATTEN_NORM);
        org = self.origin + self.view_ofs + v_forward * vs_x + v_right * -vs_y + v_up * vs_z;
 
        tracebox(self.origin + self.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, self);
@@ -392,19 +392,19 @@ void GrapplingHookFrame()
                else
                {
                        self.hook_state |= HOOK_REMOVING;
-                       self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+                       self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
                }
 
-               self.hook_state &~= HOOK_RELEASING;
+               self.hook_state &= ~HOOK_RELEASING;
                if(self.BUTTON_CROUCH)
                {
-                       self.hook_state &~= HOOK_PULLING;
+                       self.hook_state &= ~HOOK_PULLING;
                        //self.hook_state |= HOOK_RELEASING;
                }
                else
                {
                        self.hook_state |= HOOK_PULLING;
-                       //self.hook_state &~= HOOK_RELEASING;
+                       //self.hook_state &= ~HOOK_RELEASING;
                }
        }
        else if(!(self.items & IT_JETPACK) && !g_grappling_hook && self.switchweapon != WEP_HOOK)
@@ -416,7 +416,7 @@ void GrapplingHookFrame()
 
        if(!g_grappling_hook && self.weapon != WEP_HOOK)
        {
-               self.hook_state &~= HOOK_FIRING;
+               self.hook_state &= ~HOOK_FIRING;
                self.hook_state |= HOOK_REMOVING;
        }
 
@@ -425,13 +425,13 @@ void GrapplingHookFrame()
                if (self.hook)
                        RemoveGrapplingHook(self);
                FireGrapplingHook();
-               self.hook_state &~= HOOK_FIRING;
+               self.hook_state &= ~HOOK_FIRING;
        }
        else if(self.hook_state & HOOK_REMOVING)
        {
                if (self.hook)
                        RemoveGrapplingHook(self);
-               self.hook_state &~= HOOK_REMOVING;
+               self.hook_state &= ~HOOK_REMOVING;
        }
 
        /*
index b8e0da557d8358c3b2e9f7ba68c4ef447eea4849..2904c3230010db8ec0cde840d63cc9595e2b66e5 100644 (file)
@@ -6,11 +6,11 @@ void SetGrappleHookBindings();
 // (note: you can change the hook impulse #'s to whatever you please)
 .float hook_time;
 
-float HOOK_FIRING = 1;
-float HOOK_REMOVING = 2;
-float HOOK_PULLING = 4;
-float HOOK_RELEASING = 8;
-float HOOK_WAITING_FOR_RELEASE = 16;
+const float HOOK_FIRING = 1;
+const float HOOK_REMOVING = 2;
+const float HOOK_PULLING = 4;
+const float HOOK_RELEASING = 8;
+const float HOOK_WAITING_FOR_RELEASE = 16;
 .float hook_state;
 
 void GrappleHookInit();
index 854b7fef24f7466c86a373ec784ed69fea9cc420..98429f7d7a510fe07a09657825d58809335ec1de 100644 (file)
@@ -1,7 +1,7 @@
-float LOOP = 1;
+const float LOOP = 1;
 
-float DNOSHADOW = 2;
-float DFOLLOW = 4;
+const float DNOSHADOW = 2;
+const float DFOLLOW = 4;
 .float light_lev;
 .float lefty;
 .vector color;
index 43dc25ff791da1074919a772bbf9fcea53d0ad7c..20a78b7c9dec1cb40a0a00bc3a4d395c1ca07dd0 100644 (file)
@@ -22,17 +22,17 @@ void g_clientmodel_setcolormaptoactivator (void)
 
 void g_model_dropbyspawnflags()
 {
-       if(self.spawnflags & 3 == 1) // ALIGN_ORIGIN
+       if((self.spawnflags & 3) == 1) // ALIGN_ORIGIN
        {
                traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
                setorigin(self, trace_endpos);
        }
-       else if(self.spawnflags & 3 == 2) // ALIGN_BOTTOM
+       else if((self.spawnflags & 3) == 2) // ALIGN_BOTTOM
        {
                tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
                setorigin(self, trace_endpos);
        }
-       else if(self.spawnflags & 3 == 3) // ALIGN_ORIGIN | ALIGN_BOTTOM
+       else if((self.spawnflags & 3) == 3) // ALIGN_ORIGIN | ALIGN_BOTTOM
        {
                traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self);
                setorigin(self, trace_endpos - '0 0 1' * self.mins_z);
index db2c9a45c14d9a5690deb7e13b6dd0cc917b48a9..90ef516d5f3ed32f2a805b1c20f6c133895d646c 100644 (file)
@@ -26,28 +26,28 @@ float tet_vs_current_timeout;
 
 var float tet_high_score = 0;
 
-vector TET_START_PIECE_POS = '5 1 0';
-float TET_LINES = 22;
-float TET_DISPLAY_LINES = 20;
-float TET_WIDTH = 10;
-string TET_EMPTY_LINE = "0000000000"; // must match TET_WIDTH
+const vector TET_START_PIECE_POS = '5 1 0';
+const float TET_LINES = 22;
+const float TET_DISPLAY_LINES = 20;
+const float TET_WIDTH = 10;
+const string TET_EMPTY_LINE = "0000000000"; // must match TET_WIDTH
 //character values
-float TET_BORDER = 139;
-float TET_BLOCK = 133;
-float TET_SPACE = 160; // blankness
+const float TET_BORDER = 139;
+const float TET_BLOCK = 133;
+const float TET_SPACE = 160; // blankness
 
 
 
-float TETKEY_UP = 1;
-float TETKEY_DOWN = 2;
-float TETKEY_LEFT = 4;
-float TETKEY_RIGHT = 8;
-float TETKEY_ROTLEFT = 16;
-float TETKEY_ROTRIGHT = 32;
-float TETKEY_DROP = 64;
-string TET_PADDING_RIGHT = "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0"; // get away from crosshair
+const float TETKEY_UP = 1;
+const float TETKEY_DOWN = 2;
+const float TETKEY_LEFT = 4;
+const float TETKEY_RIGHT = 8;
+const float TETKEY_ROTLEFT = 16;
+const float TETKEY_ROTRIGHT = 32;
+const float TETKEY_DROP = 64;
+const string TET_PADDING_RIGHT = "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0"; // get away from crosshair
 
-float PIECES = 7;
+const float PIECES = 7;
 
 float tet_line_buf;
 
@@ -875,8 +875,8 @@ void CementPiece(float piece, float orgx, float orgy, float rot) /*FIXDECL*/
        }
 }
 
-float LINE_LOW = 349525;
-float LINE_HIGH = 699050; // above number times 2
+const float LINE_LOW = 349525;
+const float LINE_HIGH = 699050; // above number times 2
 
 void AddLines(float n)
 {
index 65846f5e38ba332e8f6e226c8f29831f18474260..359bf84a362e3ce7d73dbc6e33f0bbd372cacbf3 100644 (file)
@@ -137,8 +137,8 @@ void SUB_UseTargets()
 
 //=============================================================================
 
-float  SPAWNFLAG_NOMESSAGE = 1;
-float  SPAWNFLAG_NOTOUCH = 1;
+const float    SPAWNFLAG_NOMESSAGE = 1;
+const float    SPAWNFLAG_NOTOUCH = 1;
 
 // the wait time has passed, so set back up for another activation
 void multi_wait()
@@ -171,7 +171,7 @@ void multi_trigger()
        }
 
        if (self.noise)
-               sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+               sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
 // don't trigger again until reset
        self.takedamage = DAMAGE_NO;
@@ -210,7 +210,7 @@ void multi_touch()
                        return;
 
        if(self.team)
-               if((self.spawnflags & 4 == 0) == (self.team != other.team))
+               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
                        return;
 
 // if the trigger has an angles field, check player's facing direction
@@ -445,7 +445,7 @@ void trigger_hurt_touch()
                return;
 
        if(self.team)
-               if((self.spawnflags & 4 == 0) == (self.team != other.team))
+               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
                        return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
@@ -549,7 +549,7 @@ void trigger_heal_touch()
                        {
                                other.health = min(other.health + self.health, self.max_health);
                                other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
-                               sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+                               sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
                        }
                }
        }
@@ -660,7 +660,7 @@ void trigger_gravity_touch()
        {
                other.gravity = g;
                if(self.noise != "")
-                       sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+                       sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
                UpdateCSQCProjectile(self.owner);
        }
 }
@@ -775,9 +775,9 @@ void spawnfunc_target_speaker()
        if(!self.atten && !(self.spawnflags & 4))
        {
                IFTARGETED
-                       self.atten = ATTN_NORM;
+                       self.atten = ATTEN_NORM;
                else
-                       self.atten = ATTN_STATIC;
+                       self.atten = ATTEN_STATIC;
        }
        else if(self.atten < 0)
                self.atten = 0;
@@ -949,7 +949,7 @@ void spawnfunc_func_pointparticles()
                self.bgmscriptsustain = 0;
 
        if(!self.atten)
-               self.atten = ATTN_NORM;
+               self.atten = ATTEN_NORM;
        else if(self.atten < 0)
                self.atten = 0;
        if(!self.volume)
@@ -1214,7 +1214,7 @@ void misc_laser_think()
        if(self.dmg)
        {
                if(self.team)
-                       if((self.spawnflags & 8 == 0) == (self.team != hitent.team))
+                       if(((self.spawnflags & 8) == 0) == (self.team != hitent.team))
                                return;
                if(hitent.takedamage)
                        Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
@@ -1400,7 +1400,7 @@ void trigger_impulse_touch1()
     if(!pushdeltatime) return;
 
     other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
-    other.flags &~= FL_ONGROUND;
+    other.flags &= ~FL_ONGROUND;
     UpdateCSQCProjectile(other);
 }
 
index e3b796c4a6271041f31296f5549a4db39650ec00..91ddad1522d37aed539b19165a2b9e34108edefa 100644 (file)
@@ -51,7 +51,7 @@ void PingPLReport_Spawn()
        pingplreport.nextthink = time;
 }
 
-float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
+const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
 string redirection_target;
 float world_initialized;
 
@@ -769,7 +769,7 @@ void spawnfunc_worldspawn (void)
 
        WeaponStats_Init();
 
-       WEPSET_ADDSTAT();
+       WepSet_AddStat();
        addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
        addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon);
        addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
@@ -1569,10 +1569,10 @@ float checkrules_suddendeathwarning;
 float checkrules_suddendeathend;
 float checkrules_overtimesadded; //how many overtimes have been already added
 
-float WINNING_NO = 0; // no winner, but time limits may terminate the game
-float WINNING_YES = 1; // winner found
-float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
-float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
+const float WINNING_NO = 0; // no winner, but time limits may terminate the game
+const float WINNING_YES = 1; // winner found
+const float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
+const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
 
 float InitiateSuddenDeath()
 {
@@ -2399,7 +2399,7 @@ float MapVote_SendEntity(entity to, float sf)
        float i;
 
        if(sf & 1)
-               sf &~= 2; // if we send 1, we don't need to also send 2
+               sf &= ~2; // if we send 1, we don't need to also send 2
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_MAPVOTE);
        WriteByte(MSG_ENTITY, sf);
index 530c2815c88349c55e3ccedb7a60070de23d88b2..5c7e30e36e7c78c58087722707750081360f7aad 100644 (file)
@@ -19,7 +19,7 @@ float item_keys_usekey(entity l, entity p) {
                return TRUE;
        } else {
                // only some of the needed keys were given
-               l.itemkeys &~= valid;
+               l.itemkeys &= ~valid;
                return TRUE;
        }
 }
index ef05b5a5b6ccc4fa647c7b13d724e96592dacab6..6a2458000fce42b1fb023821497a09b84efffe37 100644 (file)
@@ -79,9 +79,9 @@ float DistributeEvenly_GetRandomized(float weight)
 
 #define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
 
-string STR_PLAYER = "player";
-string STR_SPECTATOR = "spectator";
-string STR_OBSERVER = "observer";
+const string STR_PLAYER = "player";
+const string STR_SPECTATOR = "spectator";
+const string STR_OBSERVER = "observer";
 
 #define IS_PLAYER(v)                   (v.classname == STR_PLAYER)
 #define IS_SPEC(v)                             (v.classname == STR_SPECTATOR)
@@ -178,7 +178,7 @@ float strstr(string haystack, string needle, float offset)
 }
 */
 
-float NUM_NEAREST_ENTITIES = 4;
+const float NUM_NEAREST_ENTITIES = 4;
 entity nearest_entity[NUM_NEAREST_ENTITIES];
 float nearest_length[NUM_NEAREST_ENTITIES];
 entity findnearest(vector point, .string field, string value, vector axismod)
@@ -591,7 +591,7 @@ float g_pickup_healthmega_anyway;
 float g_pickup_ammo_anyway;
 float g_pickup_weapons_anyway;
 float g_weaponarena;
-WEPSET_DECLARE_A(g_weaponarena_weapons);
+WepSet g_weaponarena_weapons;
 float g_weaponarena_random;
 float g_weaponarena_random_with_laser;
 string g_weaponarena_list;
@@ -601,9 +601,9 @@ float g_weapondamagefactor;
 float g_weaponforcefactor;
 float g_weaponspreadfactor;
 
-WEPSET_DECLARE_A(start_weapons);
-WEPSET_DECLARE_A(start_weapons_default);
-WEPSET_DECLARE_A(start_weapons_defaultmask);
+WepSet start_weapons;
+WepSet start_weapons_default;
+WepSet start_weapons_defaultmask;
 float start_items;
 float start_ammo_shells;
 float start_ammo_nails;
@@ -612,9 +612,9 @@ float start_ammo_cells;
 float start_ammo_fuel;
 float start_health;
 float start_armorvalue;
-WEPSET_DECLARE_A(warmup_start_weapons);
-WEPSET_DECLARE_A(warmup_start_weapons_default);
-WEPSET_DECLARE_A(warmup_start_weapons_defaultmask);
+WepSet warmup_start_weapons;
+WepSet warmup_start_weapons_default;
+WepSet warmup_start_weapons_defaultmask;
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -676,9 +676,9 @@ void readplayerstartcvars()
        string s;
 
        // initialize starting values for players
-       WEPSET_CLEAR_A(start_weapons);
-       WEPSET_CLEAR_A(start_weapons_default);
-       WEPSET_CLEAR_A(start_weapons_defaultmask);
+       start_weapons = '0 0 0';
+       start_weapons_default = '0 0 0';
+       start_weapons_defaultmask = '0 0 0';
        start_items = 0;
        start_ammo_shells = 0;
        start_ammo_nails = 0;
@@ -688,7 +688,7 @@ void readplayerstartcvars()
        start_armorvalue = cvar("g_balance_armor_start");
 
        g_weaponarena = 0;
-       WEPSET_CLEAR_A(g_weaponarena_weapons);
+       g_weaponarena_weapons = '0 0 0';
 
        s = cvar_string("g_weaponarena");
        if (s == "0" || s == "")
@@ -713,7 +713,7 @@ void readplayerstartcvars()
                {
                        e = get_weaponinfo(j);
                        if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
-                               WEPSET_OR_AW(g_weaponarena_weapons, j);
+                               g_weaponarena_weapons |= WepSet_FromWeapon(j);
                }
        }
        else if (s == "most")
@@ -725,7 +725,7 @@ void readplayerstartcvars()
                        e = get_weaponinfo(j);
                        if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                                if (e.spawnflags & WEP_FLAG_NORMAL)
-                                       WEPSET_OR_AW(g_weaponarena_weapons, j);
+                                       g_weaponarena_weapons |= WepSet_FromWeapon(j);
                }
        }
        else if (s == "none")
@@ -746,7 +746,7 @@ void readplayerstartcvars()
                                e = get_weaponinfo(j);
                                if (e.netname == s)
                                {
-                                       WEPSET_OR_AW(g_weaponarena_weapons, j);
+                                       g_weaponarena_weapons |= WepSet_FromWeapon(j);
                                        g_weaponarena_list = strcat(g_weaponarena_list, e.message, " & ");
                                        break;
                                }
@@ -768,7 +768,7 @@ void readplayerstartcvars()
        if (g_weaponarena)
        {
                g_weapon_stay = 0; // incompatible
-               WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
+               start_weapons = g_weaponarena_weapons;
                start_items |= IT_UNLIMITED_AMMO;
        }
        else
@@ -778,11 +778,11 @@ void readplayerstartcvars()
                        e = get_weaponinfo(i);
                        float w = want_weapon("g_start_weapon_", e, FALSE);
                        if(w & 1)
-                               WEPSET_OR_AW(start_weapons, i);
+                               start_weapons |= WepSet_FromWeapon(i);
                        if(w & 2)
-                               WEPSET_OR_AW(start_weapons_default, i);
+                               start_weapons_default |= WepSet_FromWeapon(i);
                        if(w & 4)
-                               WEPSET_OR_AW(start_weapons_defaultmask, i);
+                               start_weapons_defaultmask |= WepSet_FromWeapon(i);
                }
        }
 
@@ -815,9 +815,9 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = start_ammo_fuel;
                warmup_start_health = start_health;
                warmup_start_armorvalue = start_armorvalue;
-               WEPSET_COPY_AA(warmup_start_weapons, start_weapons);
-               WEPSET_COPY_AA(warmup_start_weapons_default, start_weapons_default);
-               WEPSET_COPY_AA(warmup_start_weapons_defaultmask, start_weapons_defaultmask);
+               warmup_start_weapons = start_weapons;
+               warmup_start_weapons_default = start_weapons_default;
+               warmup_start_weapons_defaultmask = start_weapons_defaultmask;
 
                if (!g_weaponarena && !g_ca)
                {
@@ -828,19 +828,19 @@ void readplayerstartcvars()
                        warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
                        warmup_start_health = cvar("g_warmup_start_health");
                        warmup_start_armorvalue = cvar("g_warmup_start_armor");
-                       WEPSET_CLEAR_A(warmup_start_weapons);
-                       WEPSET_CLEAR_A(warmup_start_weapons_default);
-                       WEPSET_CLEAR_A(warmup_start_weapons_defaultmask);
+                       warmup_start_weapons = '0 0 0';
+                       warmup_start_weapons_default = '0 0 0';
+                       warmup_start_weapons_defaultmask = '0 0 0';
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
                                float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
                                if(w & 1)
-                                       WEPSET_OR_AW(warmup_start_weapons, i);
+                                       warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
-                                       WEPSET_OR_AW(warmup_start_weapons_default, i);
+                                       warmup_start_weapons_default |= WepSet_FromWeapon(i);
                                if(w & 4)
-                                       WEPSET_OR_AW(warmup_start_weapons_defaultmask, i);
+                                       warmup_start_weapons_defaultmask |= WepSet_FromWeapon(i);
                        }
                }
        }
@@ -850,7 +850,7 @@ void readplayerstartcvars()
 
        MUTATOR_CALLHOOK(SetStartItems);
 
-       if ((start_items & IT_JETPACK) || (g_grappling_hook && WEPSET_CONTAINS_AW(start_weapons, WEP_HOOK)))
+       if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
        {
                g_grappling_hook = 0; // these two can't coexist, as they use the same button
                start_items |= IT_FUEL_REGEN;
@@ -861,7 +861,7 @@ void readplayerstartcvars()
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                e = get_weaponinfo(i);
-               if(WEPSET_CONTAINS_AW(start_weapons, i) || WEPSET_CONTAINS_AW(warmup_start_weapons, i))
+               if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
                        weapon_action(i, WR_PRECACHE);
        }
 
@@ -1204,7 +1204,7 @@ void play2(entity e, string filename)
 {
     //stuffcmd(e, strcat("play2 ", filename, "\n"));
     msg_entity = e;
-    soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTN_NONE);
+    soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
 }
 
 // use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
@@ -1242,7 +1242,7 @@ void play2all(string samp)
     if (autocvar_bot_sound_monopoly)
         return;
 
-    sound(world, CH_INFO, samp, VOL_BASE, ATTN_NONE);
+    sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
 }
 
 void PrecachePlayerSounds(string f);
@@ -1411,7 +1411,7 @@ void precache()
     if (self.noise)
     {
         precache_sound (self.noise);
-        ambientsound ('0 0 0', self.noise, VOL_BASE, ATTN_NONE);
+        ambientsound ('0 0 0', self.noise, VOL_BASE, ATTEN_NONE);
     }
 #endif
 
index 7c49045650b3479f170f67f9b16d7c126f351ddc..0d0261a2ca5909e4157aaa4b9bf0724b4a53423a 100644 (file)
@@ -233,7 +233,7 @@ MUTATOR_HOOKFUNCTION(ca_SetStartItems)
        start_ammo_cells = cvar("g_lms_start_ammo_cells");
        start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
        
-       start_items &~= IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_AMMO;
 
        return 0;
 }
index 1de05661bed63d57a275f61c8d0709d2fb8c7232..d2fc1e99368ff8c6eeb0669c2844392f1c71f6ff 100644 (file)
@@ -240,7 +240,7 @@ void ctf_Handle_Drop(entity flag, entity player, float droptype)
        
        // messages and sounds
        Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname);
-       sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTN_NONE);
+       sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
        ctf_EventLog("dropped", player.team, player);
 
        // scoring
@@ -286,7 +286,7 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        flag.ctf_status = FLAG_CARRY;
 
        // messages and sounds
-       sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTN_NORM);
+       sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM);
        ctf_EventLog("receive", flag.team, player);
        
        FOR_EACH_REALPLAYER(tmp_player)
@@ -353,7 +353,7 @@ void ctf_Handle_Throw(entity player, entity receiver, float droptype)
                        flag.ctf_status = FLAG_PASSING;
                        
                        // other
-                       sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTN_NORM);
+                       sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM);
                        WarpZone_TrailParticles(world, particleeffectnum(flag.passeffect), player.origin, targ_origin);
                        ctf_EventLog("pass", flag.team, player);
                        break;
@@ -411,7 +411,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype)
        // messages and sounds
        Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(enemy_flag, CENTER_CTF_CAPTURE_));
        ctf_CaptureRecord(enemy_flag, player);
-       sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE);
+       sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTEN_NONE);
        
        switch(capturetype)
        {
@@ -453,7 +453,7 @@ void ctf_Handle_Return(entity flag, entity player)
        // messages and sounds
        Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_));
        Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname);
-       sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
+       sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
        ctf_EventLog("return", flag.team, player);
 
        // scoring
@@ -501,7 +501,7 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype)
 
        // messages and sounds
        Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname);
-       sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
+       sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
 
        FOR_EACH_REALPLAYER(tmp_player)
        {
@@ -591,7 +591,7 @@ void ctf_CheckFlagReturn(entity flag, float returntype)
                                case RETURN_TIMEOUT:
                                        { Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_)); break; }
                        }
-                       sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTN_NONE);
+                       sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE);
                        ctf_EventLog("returned", flag.team, world);
                        ctf_RespawnFlag(flag);
                }
@@ -830,7 +830,7 @@ void ctf_FlagTouch()
                if(time > self.wait) // if we haven't in a while, play a sound/effect
                {
                        pointparticles(particleeffectnum(self.toucheffect), self.origin, '0 0 0', 1);
-                       sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM);
                        self.wait = time + FLAG_TOUCHRATE;
                }
                return;
@@ -1715,7 +1715,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink)
        entity flag;
        
        // initially clear items so they can be set as necessary later.
-       self.items &~= (IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST 
+       self.items &= ~(IT_RED_FLAG_CARRYING | IT_RED_FLAG_TAKEN | IT_RED_FLAG_LOST
                | IT_BLUE_FLAG_CARRYING | IT_BLUE_FLAG_TAKEN | IT_BLUE_FLAG_LOST | IT_CTF_SHIELDED);
 
        // scan through all the flags and notify the client about them 
index 4a3b3b818e597b20bbd29231af5760683888f02e..50f512991723b0b7e45d40d1686914eb4ed39c10 100644 (file)
@@ -58,9 +58,9 @@ void dompoint_captured ()
 
        if (head.noise != "")
                if(self.enemy)
-                       sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+                       sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
                else
-                       sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
        if (head.noise1 != "")
                play2all(head.noise1);
 
index f92afab658a81d0eee8d51ce55e2cfdf6bc64947..145636239c265d2e661ca30d0a6a4fd8b441a32b 100644 (file)
@@ -41,7 +41,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
                WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
                WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);    
 
-               sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
+               sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) 
        }
        else
        {
@@ -74,7 +74,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        if not(IS_PLAYER(other)) 
        {  // The ball just touched an object, most likely the world
                pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
-               sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM);
                return; 
        }
        else if(self.wait > time) { return; }
@@ -103,7 +103,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        ka_EventLog("pickup", other);
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
        Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
-       sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
+       sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
        PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
@@ -131,7 +131,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.think = ka_RespawnBall;
        ball.nextthink = time + autocvar_g_keepawayball_respawntime;
        ball.takedamage = DAMAGE_YES;
-       ball.effects &~= EF_NODRAW; 
+       ball.effects &= ~EF_NODRAW; 
        setorigin(ball, plyr.origin + '0 0 10');
        ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
        ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P 
@@ -139,13 +139,13 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        
        // reset the player effects
        plyr.glow_trail = FALSE;
-       plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+       plyr.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
 
        // messages and sounds
        ka_EventLog("dropped", plyr);
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
        Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
-       sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);  // ATTN_NONE (it's a sound intended to be heard anywhere) 
+       sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
        // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
@@ -271,7 +271,7 @@ MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill)
 MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
 {
        // clear the item used for the ball in keepaway
-       self.items &~= IT_KEY1;
+       self.items &= ~IT_KEY1;
        
        // if the player has the ball, make sure they have the item for it (Used for HUD primarily)
        if(self.ballcarried)
@@ -333,7 +333,7 @@ MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
        // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
        // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player() 
        
-       self.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+       self.effects &= ~autocvar_g_keepaway_ballcarrier_effects;
 
        if(self.ballcarried)
                self.effects |= autocvar_g_keepaway_ballcarrier_effects;
index 99e7a3eae1cfd5666505e32237180d6d08549bf0..a0cbf619a77f61a6ea73a0e16bbf2c3c7c0b3f90 100644 (file)
@@ -4,21 +4,21 @@
 // #define KH_PLAYER_USE_CARRIEDMODEL
 
 #ifdef KH_PLAYER_USE_ATTACHMENT
-vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
-vector KH_PLAYER_ATTACHMENT_DIST = '4 0 0';
-vector KH_PLAYER_ATTACHMENT = '0 0 0';
-vector KH_PLAYER_ATTACHMENT_ANGLES = '0 0 0';
-string KH_PLAYER_ATTACHMENT_BONE = "";
+const vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
+const vector KH_PLAYER_ATTACHMENT_DIST = '4 0 0';
+const vector KH_PLAYER_ATTACHMENT = '0 0 0';
+const vector KH_PLAYER_ATTACHMENT_ANGLES = '0 0 0';
+const string KH_PLAYER_ATTACHMENT_BONE = "";
 #else
-float KH_KEY_ZSHIFT = 22;
-float KH_KEY_XYDIST = 24;
-float KH_KEY_XYSPEED = 45;
+const float KH_KEY_ZSHIFT = 22;
+const float KH_KEY_XYDIST = 24;
+const float KH_KEY_XYSPEED = 45;
 #endif
-float KH_KEY_WP_ZSHIFT = 20;
+const float KH_KEY_WP_ZSHIFT = 20;
 
-vector KH_KEY_MIN = '-10 -10 -46';
-vector KH_KEY_MAX = '10 10 3';
-float KH_KEY_BRIGHTNESS = 2;
+const vector KH_KEY_MIN = '-10 -10 -46';
+const vector KH_KEY_MAX = '10 10 3';
+const float KH_KEY_BRIGHTNESS = 2;
 
 float kh_no_radar_circles;
 
@@ -397,7 +397,7 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deatht
 
 void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped key
 {
-       sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTN_NORM);
+       sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTEN_NORM);
 
        if(key.kh_dropperteam != player.team)
        {
@@ -662,7 +662,7 @@ void kh_Key_Think()  // runs all the time
        {
                if(self.siren_time < time)
                {
-                       sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTN_NORM);  // play a simple alarm
+                       sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTEN_NORM);  // play a simple alarm
                        self.siren_time = time + 2.5;  // repeat every 2.5 seconds
                }
 
@@ -700,7 +700,7 @@ void key_reset()
        kh_Key_Remove(self);
 }
 
-string STR_ITEM_KH_KEY = "item_kh_key";
+const string STR_ITEM_KH_KEY = "item_kh_key";
 void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every time a new flag is created, ie after all the keys have been collected
 {
        entity key;
@@ -798,7 +798,7 @@ void kh_Key_DropOne(entity key)
        key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
        key.kh_dropperteam = key.team;
 
-       sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
+       sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM);
 }
 
 void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
@@ -824,7 +824,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                        if(suicide)
                                key.kh_dropperteam = player.team;
                }
-               sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
+               sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTEN_NORM);
        }
 }
 
index aa8e8f37eaa656cea53e3273e364d33ef30bf614..f980607a7e5b71c2332707d07fc5827b4cd9633d 100644 (file)
@@ -121,7 +121,7 @@ MUTATOR_HOOKFUNCTION(lms_GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(lms_SetStartItems)
 {
-       start_items &~= IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_AMMO;
        start_ammo_shells = cvar("g_lms_start_ammo_shells");
        start_ammo_nails = cvar("g_lms_start_ammo_nails");
        start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
index adfb31a1b57112685e62e9ddfa04dd2337cfedba..5831250d2d4b29cf144821413fc4028d7239483f 100644 (file)
@@ -44,7 +44,7 @@ void ball_restart(void)
 void nexball_setstatus(void)
 {
        entity oldself;
-       self.items &~= IT_KEY1;
+       self.items &= ~IT_KEY1;
        if(self.ballcarried)
        {
                if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
@@ -85,7 +85,7 @@ void DropOwner(void)
        DropBall(self, ownr.origin, ownr.velocity);
        makevectors(ownr.v_angle_y * '0 1 0');
        ownr.velocity += ('0 0 0.75' - v_forward) * 1000;
-       ownr.flags &~= FL_ONGROUND;
+       ownr.flags &= ~FL_ONGROUND;
 }
 
 void GiveBall(entity plyr, entity ball)
@@ -94,7 +94,7 @@ void GiveBall(entity plyr, entity ball)
 
        if((ownr = ball.owner))
        {
-               ownr.effects &~= autocvar_g_nexball_basketball_effects_default;
+               ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
                ownr.ballcarried = world;
                if(ownr.metertime)
                {
@@ -120,7 +120,7 @@ void GiveBall(entity plyr, entity ball)
        ball.nb_dropper = plyr;
 
        plyr.effects |= autocvar_g_nexball_basketball_effects_default;
-       ball.effects &~= autocvar_g_nexball_basketball_effects_default;
+       ball.effects &= ~autocvar_g_nexball_basketball_effects_default;
 
        ball.velocity = '0 0 0';
        ball.movetype = MOVETYPE_NONE;
@@ -139,9 +139,9 @@ void GiveBall(entity plyr, entity ball)
        
        ownr = self;
        self = plyr;    
-       WEPSET_COPY_EE(self.weaponentity, self);
+       self.weaponentity.weapons = self.weapons;
        self.weaponentity.switchweapon = self.weapon;
-       WEPSET_COPY_EW(self, WEP_PORTO);
+       self.weapons = WEPSET_PORTO;
        weapon_action(WEP_PORTO, WR_RESETPLAYER);
        self.switchweapon = WEP_PORTO;
        W_SwitchWeapon(WEP_PORTO);
@@ -151,13 +151,13 @@ void GiveBall(entity plyr, entity ball)
 void DropBall(entity ball, vector org, vector vel)
 {
        ball.effects |= autocvar_g_nexball_basketball_effects_default;
-       ball.effects &~= EF_NOSHADOW;
-       ball.owner.effects &~= autocvar_g_nexball_basketball_effects_default;
+       ball.effects &= ~EF_NOSHADOW;
+       ball.owner.effects &= ~autocvar_g_nexball_basketball_effects_default;
 
        setattachment(ball, world, "");
        setorigin(ball, org);
        ball.movetype = MOVETYPE_BOUNCE;
-       ball.flags &~= FL_ONGROUND;
+       ball.flags &= ~FL_ONGROUND;
        ball.scale = ball_scale;
        ball.velocity = vel;
        ball.nb_droptime = time;
@@ -182,7 +182,7 @@ void DropBall(entity ball, vector org, vector vel)
 void InitBall(void)
 {
        if(gameover) return;
-       self.flags &~= FL_ONGROUND;
+       self.flags &= ~FL_ONGROUND;
        self.movetype = MOVETYPE_BOUNCE;
        if(self.classname == "nexball_basketball")
                self.touch = basketball_touch;
@@ -194,7 +194,7 @@ void InitBall(void)
        self.teamtime = 0;
        self.pusher = world;
        self.team = FALSE;
-       sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTN_NORM);
+       sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
        WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
        LogNB("init", world);
 }
@@ -241,7 +241,7 @@ void football_touch(void)
        {
                if(time > self.lastground + 0.1)
                {
-                       sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
                        self.lastground = time;
                }
                if(vlen(self.velocity) && !self.cnt)
@@ -297,7 +297,7 @@ void basketball_touch(void)
        }
        else if(other.solid == SOLID_BSP)
        {
-               sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
                if(vlen(self.velocity) && !self.cnt)
                        self.nextthink = min(time + autocvar_g_nexball_delay_idle, self.teamtime);
        }
@@ -363,7 +363,7 @@ void GoalTouch(void)
                pscore = 1;
        }
 
-       sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
+       sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE);
 
        if(ball.team && pscore)
        {
@@ -677,11 +677,11 @@ void W_Nexball_Touch(void)
                if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
                {
                        other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
-                       other.flags &~= FL_ONGROUND;
+                       other.flags &= ~FL_ONGROUND;
                        if(!attacker.ballcarried)
                        {
                                LogNB("stole", attacker);
-                               sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTN_NORM);
+                               sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
 
                                if(attacker.team == other.team && time > attacker.teamkill_complain)
                                {
@@ -778,7 +778,7 @@ float ball_customize()
 {
        if(!self.owner)
        {
-               self.effects &~= EF_FLAME;
+               self.effects &= ~EF_FLAME;
                self.scale = 1;
                self.customizeentityforclient = func_null;
                return TRUE;
@@ -790,11 +790,11 @@ float ball_customize()
                if(self.enemy)
                        self.effects |= EF_FLAME;
                else
-                       self.effects &~= EF_FLAME;
+                       self.effects &= ~EF_FLAME;
        }       
        else
        {
-               self.effects &~= EF_FLAME;
+               self.effects &= ~EF_FLAME;
                self.scale = 1;
        }
                
@@ -917,14 +917,14 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
                }
                else
                {                       
-                       if(!WEPSET_EMPTY_E(self.weaponentity))
+                       if(self.weaponentity.weapons)
                        {
-                               WEPSET_COPY_EE(self, self.weaponentity);
+                               self.weapons = self.weaponentity.weapons;
                                weapon_action(WEP_PORTO, WR_RESETPLAYER);
                                self.switchweapon = self.weaponentity.switchweapon;
                                W_SwitchWeapon(self.switchweapon);
                                
-               WEPSET_CLEAR_E(self.weaponentity);
+               self.weaponentity.weapons = '0 0 0';
                        }
                }
                
@@ -937,12 +937,12 @@ MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
 {      
-       WEPSET_CLEAR_E(self.weaponentity);
+       self.weaponentity.weapons = '0 0 0';
        
        if(nexball_mode & NBM_BASKETBALL)
-               WEPSET_OR_EW(self, WEP_PORTO);
+               self.weapons |= WEPSET_PORTO;
        else
-               WEPSET_CLEAR_E(self);
+               self.weapons = '0 0 0';
 
        return FALSE;
 }
index e4be2d7ab4ce2ea2b9422456b2affc7fbec3f2fd..cf8d52cd2c113bb4bf9ad5ef640f774fda5efe1f 100644 (file)
@@ -397,7 +397,7 @@ void onslaught_generator_think()
                        }
                        // self.max_health / 300 gives 5 minutes of overtime.
                        // control points reduce the overtime duration.
-                       sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/generator_decay.wav", VOL_BASE, ATTEN_NORM);
                        d = 1;
                        e = findchain(classname, "onslaught_controlpoint");
                        while (e)
@@ -426,7 +426,7 @@ void onslaught_generator_think()
                 if(e.team == self.team)
                 {
                     centerprint(e, "^1Your generator is NOT shielded!\n^7Re-capture controlpoints to shield it!");
-                    soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTN_NONE);    // FIXME: Uniqe sound?
+                    soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTEN_NONE);    // FIXME: Uniqe sound?
                 }
             }
         }
@@ -488,7 +488,7 @@ void onslaught_generator_damage_think()
                if(random() < 0.01)
                {
                        pointparticles(particleeffectnum("electro_ballexplode"), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
-                       sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);
                }
                else
                        pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
@@ -517,7 +517,7 @@ void onslaught_generator_deaththink()
        if(self.count==40||self.count==20)
        {
                onslaught_generator_ring_spawn(self.origin);
-               sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
        }
 
        // Throw some gibs
@@ -543,7 +543,7 @@ void onslaught_generator_deaththink()
        if(random() < 0.25)
        {
                te_explosion(self.origin);
-               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
        }
 
        // Particles
@@ -563,7 +563,7 @@ void onslaught_generator_deaththink()
                te_explosion(org);
                onslaught_generator_shockwave_spawn(org);
                pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
-               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        }
        else
                self.nextthink = time + 0.05;
@@ -664,7 +664,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
        // Throw some flaming gibs on damage, more damage = more chance for gib
        if(random() < damage/220)
        {
-               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                i = random();
                if(i < 0.3)
                        ons_throwgib(hitloc + '0 0 20', force * -1, "models/onslaught/gen_gib1.md3", 5, TRUE);
@@ -680,9 +680,9 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
 
                //sound on every hit
                if (random() < 0.5)
-                       sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE, ATTEN_NORM);
                else
-                       sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);
        }
 
        //throw some gibs on damage
@@ -1026,13 +1026,13 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
        pointparticles(particleeffectnum("sparks"), hitloc, force*-1, 1);
        //sound on every hit
        if (random() < 0.5)
-               sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTEN_NORM);
        else
-               sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/ons_hit2.wav", VOL_BASE+0.3, ATTEN_NORM);
 
        if (self.health < 0)
        {
-               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
                pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
                {
                        string t;
@@ -1209,9 +1209,9 @@ void onslaught_controlpoint_icon_think()
                pointparticles(particleeffectnum("electricity_sparks"), self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1);
 
                if(random() > 0.8)
-                       sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTEN_NORM);
                else if (random() > 0.5)
-                       sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTEN_NORM);
        }
 }
 
@@ -1234,7 +1234,7 @@ void onslaught_controlpoint_icon_buildthink()
                self.health = self.max_health;
                self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
                self.think = onslaught_controlpoint_icon_think;
-               sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTEN_NORM);
                bprint(Team_ColoredFullName(self.team), " captured ", self.owner.message, " control point\n");
                self.owner.iscaptured = TRUE;
 
@@ -1297,7 +1297,7 @@ void onslaught_controlpoint_touch()
        e.think = onslaught_controlpoint_icon_buildthink;
        e.nextthink = time + sys_frametime;
        e.count = (e.max_health - e.health) * sys_frametime / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
-       sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
+       sound(e, CH_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTEN_NORM);
        self.team = e.team;
        self.colormap = e.colormap;
        WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
index 263df8225f3f365746239fec3fca43c3d13b41ae..2eaa5f0b24725c5b2c1adc133c4ce0dd2267e057 100644 (file)
@@ -91,7 +91,7 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
 
        // the up part of the dodge is a single shot action
        if (self.dodging_single_action == 1) {
-               self.flags &~= FL_ONGROUND;
+               self.flags &= ~FL_ONGROUND;
 
                self.velocity = 
                          self.velocity 
index 639bba507ce522f6e1eeebe4e33901da998e27dd..33d0e27b6b64734daf57dc385cdce6d15a4c1399 100644 (file)
@@ -3,8 +3,8 @@ MUTATOR_HOOKFUNCTION(melee_SetStartItems)
        start_ammo_shells = 0;
        warmup_start_ammo_shells = 0;
        
-       WEPSET_COPY_AW(start_weapons, WEP_SHOTGUN);
-       WEPSET_COPY_AW(warmup_start_weapons, WEP_SHOTGUN);
+       start_weapons = WEPSET_SHOTGUN;
+       warmup_start_weapons = WEPSET_SHOTGUN;
                
        return FALSE;
 }
index 9b4bd7012f50db0f6f72c9691b5c206106aa1570..f521e0f67b427ff5efdaafbd145f6366afd8f5ed 100644 (file)
@@ -147,7 +147,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                {
                        self.alpha = default_player_alpha;
                        self.exteriorweaponentity.alpha = default_weapon_alpha;
-                       self.items &~= IT_STRENGTH;
+                       self.items &= ~IT_STRENGTH;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_INVISIBILITY);
                }
        }
@@ -168,7 +168,7 @@ MUTATOR_HOOKFUNCTION(minstagib_PlayerPowerups)
                play_countdown(self.invincible_finished, "misc/poweroff.wav");
                if (time > self.invincible_finished)
                {
-                       self.items &~= IT_INVINCIBLE;
+                       self.items &= ~IT_INVINCIBLE;
                        Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_POWERDOWN_SPEED);
                }
        }
@@ -275,8 +275,8 @@ MUTATOR_HOOKFUNCTION(minstagib_SetStartItems)
        
        start_health = 100;
        start_armorvalue = 0;
-       WEPSET_COPY_AW(start_weapons, WEP_MINSTANEX);
-       WEPSET_COPY_AW(warmup_start_weapons, WEP_MINSTANEX);
+       start_weapons = WEPSET_MINSTANEX;
+       warmup_start_weapons = WEPSET_MINSTANEX;
        start_items |= IT_UNLIMITED_SUPERWEAPONS;
                
        return FALSE;
index a223f8be2b2c9e6a20ab1863b578c38a63ffb9b3..d911720de536c00407b85d83ee2de43b382c54a8 100644 (file)
@@ -64,8 +64,8 @@ void nade_boom()
                default:                 expef = "nade_explode"; break;
        }
        
-       sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
-       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+       sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
+       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1);
        
        Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
@@ -84,7 +84,7 @@ void nade_touch()
        //UpdateCSQCProjectile(self);
        if(self.health == self.max_health)
        {
-               spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTN_NORM);
+               spamsound(self, CH_SHOTS, strcat("weapons/grenade_bounce", ftos(1 + rint(random() * 5)), ".wav"), VOL_BASE, ATTEN_NORM);
                return;
        }
 
@@ -94,7 +94,7 @@ void nade_touch()
 
 void nade_beep()
 {
-       sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+       sound(self, CH_SHOTS_SINGLE, "overkill/grenadebip.ogg", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
        self.think = nade_boom;
        self.nextthink = max(self.wait, time);
 }
@@ -129,7 +129,7 @@ void nade_damage(entity inflictor, entity attacker, float damage, float deathtyp
 
        if(self.health == self.max_health)
        {
-               sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTN_LARGE + ATTN_MAX));
+               sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
                self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time);
                self.think = nade_beep;
        }
@@ -296,7 +296,7 @@ MUTATOR_HOOKFUNCTION(nades_VehicleEnter)
 
 MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
 {
-       float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || WEPSET_CONTAINS_AW(weaponsInMap, WEP_HOOK)) ? self.button16 : self.BUTTON_HOOK);
+       float key_pressed = ((g_grappling_hook || client_hasweapon(self, WEP_HOOK, FALSE, FALSE) || (weaponsInMap & WEPSET_HOOK)) ? self.button16 : self.BUTTON_HOOK);
        
        if(self.nade)
                if(self.nade.wait - 0.1 <= time)
index 89ad13c5380775439b1a186e05ff93c81dba8141..873e1632c7a2b6f2c270be0f5b933cb969f79074 100644 (file)
@@ -125,11 +125,11 @@ MUTATOR_HOOKFUNCTION(nt_SetStartItems)
 
        float i, j, k, n;
 
-       WEPSET_DECLARE_A(newdefault);
-       WEPSET_DECLARE_A(warmup_newdefault);
+       WepSet newdefault;
+       WepSet warmup_newdefault;
        
-       WEPSET_CLEAR_A(newdefault);
-       WEPSET_CLEAR_A(warmup_newdefault);
+       newdefault = '0 0 0';
+       warmup_newdefault = '0 0 0';
 
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
@@ -143,20 +143,20 @@ MUTATOR_HOOKFUNCTION(nt_SetStartItems)
                        for(k = WEP_FIRST; k <= WEP_LAST; ++k)
                                if(get_weaponinfo(k).netname == argv(j))
                                {
-                                       if(WEPSET_CONTAINS_AW(start_weapons, i))
-                                               WEPSET_OR_AW(newdefault, k);
-                                       if(WEPSET_CONTAINS_AW(warmup_start_weapons, i))
-                                               WEPSET_OR_AW(warmup_newdefault, k);
+                                       if(start_weapons & WepSet_FromWeapon(i))
+                                               newdefault |= WepSet_FromWeapon(k);
+                                       if(warmup_start_weapons & WepSet_FromWeapon(i))
+                                               warmup_newdefault |= WepSet_FromWeapon(k);
                                }
        }
 
-       WEPSET_AND_AA(newdefault, start_weapons_defaultmask);
-       WEPSET_ANDNOT_AA(start_weapons, start_weapons_defaultmask);
-       WEPSET_OR_AA(start_weapons, newdefault);
+       newdefault &= start_weapons_defaultmask;
+       start_weapons &= ~start_weapons_defaultmask;
+       start_weapons |= newdefault;
 
-       WEPSET_AND_AA(warmup_newdefault, warmup_start_weapons_defaultmask);
-       WEPSET_ANDNOT_AA(warmup_start_weapons, warmup_start_weapons_defaultmask);
-       WEPSET_OR_AA(warmup_start_weapons, warmup_newdefault);
+       warmup_newdefault &= warmup_start_weapons_defaultmask;
+       warmup_start_weapons &= ~warmup_start_weapons_defaultmask;
+       warmup_start_weapons |= warmup_newdefault;
 
        return 0;
 }
@@ -206,7 +206,7 @@ MUTATOR_DEFINITION(mutator_new_toys)
                float i;
                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        if(nt_IsNewToy(i))
-                               get_weaponinfo(i).spawnflags &~= WEP_FLAG_MUTATORBLOCKED;
+                               get_weaponinfo(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index 21285b53a0b62c627065d2d6144ede7f5b2dae2f..4a11e564bdd18990915c7a9f602f9bad6bf597e2 100644 (file)
@@ -17,7 +17,7 @@ float NIX_CanChooseWeapon(float wpn)
                return FALSE;
        if(g_weaponarena)
        {
-               if not(WEPSET_CONTAINS_AW(g_weaponarena_weapons, wpn))
+               if(!(g_weaponarena_weapons & WepSet_FromWeapon(wpn)))
                        return FALSE;
        }
        else
@@ -136,10 +136,10 @@ void NIX_GiveCurrentWeapon()
                self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
        }
 
-       WEPSET_CLEAR_E(self);
+       self.weapons = '0 0 0';
        if(g_nix_with_laser)
-               WEPSET_ANDNOT_EW(self, WEP_LASER);
-       WEPSET_OR_EW(self, nix_weapon);
+               self.weapons &= ~WEPSET_LASER;
+       self.weapons |= WepSet_FromWeapon(nix_weapon);
 
        if(self.switchweapon != nix_weapon)
                if(!client_hasweapon(self, self.switchweapon, TRUE, FALSE))
@@ -263,7 +263,7 @@ MUTATOR_DEFINITION(mutator_nix)
                        e.ammo_nails = start_ammo_nails;
                        e.ammo_rockets = start_ammo_rockets;
                        e.ammo_fuel = start_ammo_fuel;
-                       WEPSET_COPY_EA(e, start_weapons);
+                       e.weapons = start_weapons;
                        if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
                                e.switchweapon = w_getbestweapon(self);
                }
index e32c08a2db5f44c72898596d1d65739bd18177fe..af5d4a8b137d2e983709b2af6830e8396d79299e 100644 (file)
@@ -2,7 +2,7 @@ MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
 {
        float j;
        for(j = WEP_FIRST; j <= WEP_LAST; ++j)
-       if(WEPSET_CONTAINS_EW(self, j))
+       if(self.weapons & WepSet_FromWeapon(j))
        if(self.switchweapon != j)
        if(W_IsWeaponThrowable(j))
                W_ThrowNewWeapon(self, j, FALSE, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
index f7d6c1ad06caa6d9a5750c11a6ea2c524f009528..fc9fc7966b2bfe27f01ca1efdce4471fd30f1e44 100644 (file)
@@ -108,7 +108,7 @@ MUTATOR_HOOKFUNCTION(superspec_ItemTouch)
                                        superspec_msg("", "", self, sprintf("Player %s^7 just picked up ^3%s\n", other.netname, _item.netname), 1);
                                else
                                        superspec_msg("", "", self, sprintf("Player %s^7 just picked up ^3%s\n^8(%s^8)\n", other.netname, _item.netname, _item.classname), 1);
-                               if(self.autospec_flags& ASF_SSIM && self.enemy != other)
+                               if((self.autospec_flags & ASF_SSIM) && self.enemy != other)
                                {
                                        _spectate(other);
 
@@ -239,7 +239,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
                                else if(argv(i) == "off" || argv(i) == "0")
                                {
                                        if(_start == 1)
-                                               self.superspec_flags &~= _bits;
+                                               self.superspec_flags &= ~_bits;
 
                                        _bits = 0;
                                }
@@ -303,7 +303,7 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
                                else if(argv(i) == "off" || argv(i) == "0")
                                {
                                        if(_start == 1)
-                                               self.autospec_flags &~= _bits;
+                                               self.autospec_flags &= ~_bits;
 
                                        _bits = 0;
                                }
index f51ed653a055d55de3726baf27ce7f92a587b2b1..f2d47a5ed1d31a8b732a8fd5cca06c7e50e62ae7 100644 (file)
@@ -6,7 +6,7 @@ void PlayerTouchExplode(entity p1, entity p2)
        org = (p1.origin + p2.origin) * 0.5;
        org_z += (p1.mins_z + p2.mins_z) * 0.5;
 
-       sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+       sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
        pointparticles(particleeffectnum("explosion_small"), org, '0 0 0', 1);
 
        entity e;
index 01119829f1dd496d60cc23326258f20a5f6078b9..94ba20f10d8320b07f4b1d18e0232cb6dd04bf4d 100644 (file)
@@ -26,7 +26,7 @@ void sandbox_ObjectFunction_Touch()
        intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
        intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1);
 
-       sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTN_NORM);
+       sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM);
        pointparticles(particleeffectnum(strcat("impact_", self.material)), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10
 }
 
index ab28b3a558f607d1f43dd4741bde5b2d126f2366..b95037747b459c8bf055a6a2d3f46e6e57d87199 100644 (file)
@@ -1,26 +1,26 @@
 // time the player was alive and kicking
-string PLAYERSTATS_ALIVETIME  = "alivetime";
-string PLAYERSTATS_AVGLATENCY = "avglatency";
-string PLAYERSTATS_WINS = "wins";
-string PLAYERSTATS_MATCHES = "matches";
-string PLAYERSTATS_JOINS = "joins";
-string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
-string PLAYERSTATS_RANK = "rank";
-string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
-
-string PLAYERSTATS_TOTAL = "total-";
-string PLAYERSTATS_SCOREBOARD = "scoreboard-";
-
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
-string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
-string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
-string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
-string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
+const string PLAYERSTATS_ALIVETIME  = "alivetime";
+const string PLAYERSTATS_AVGLATENCY = "avglatency";
+const string PLAYERSTATS_WINS = "wins";
+const string PLAYERSTATS_MATCHES = "matches";
+const string PLAYERSTATS_JOINS = "joins";
+const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
+const string PLAYERSTATS_RANK = "rank";
+const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
+
+const string PLAYERSTATS_TOTAL = "total-";
+const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
+
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
+const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
+const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
+const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
+const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
 
 // delay map switch until this is set
 float playerstats_waitforme;
index d5b14bcdd87cc37603383746944c2f1b2daf6eae..bf3772090d35bab537a6bdc0935b688841f1d0f9 100644 (file)
@@ -398,14 +398,14 @@ void Portal_Remove(entity portal, float killed)
        if(killed)
        {
                fixedmakevectors(portal.mangle);
-               sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTN_NORM);
+               sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTEN_NORM);
                pointparticles(particleeffectnum("rocket_explode"), portal.origin + v_forward * 16, v_forward * 1024, 4);
                remove(portal);
        }
        else
        {
                Portal_MakeBrokenPortal(portal);
-               sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTN_NORM);
+               sound(portal, CH_SHOTS, "porto/expire.wav", VOL_BASE, ATTEN_NORM);
                SUB_SetFade(portal, time, 0.5);
        }
 }
index 0769a4f038021e85b09ebabb757090c482de98a6..24db9e4488bcdee3a18457faab2ecd58e3b413ee 100644 (file)
@@ -14,7 +14,7 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags,
 {
        if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
                return previous;
-       if(fieldflags & SFL_SORT_PRIO_MASK < previous_y)
+       if((fieldflags & SFL_SORT_PRIO_MASK) < previous_y)
                return previous;
        if(t1.field == t2.field)
                return previous;
@@ -150,7 +150,7 @@ void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags)
 {
        scores_label[i] = label;
        scores_flags[i] = scoreflags;
-       if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+       if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
        {
                scores_primary = scores[i];
                scores_flags_primary = scoreflags;
@@ -166,7 +166,7 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
 {
        teamscores_label[i] = label;
        teamscores_flags[i] = scoreflags;
-       if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+       if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
        {
                teamscores_primary = teamscores[i];
                teamscores_flags_primary = scoreflags;
@@ -553,9 +553,9 @@ string GetScoreLogLabel(string label, float fl)
 {
        if(fl & SFL_LOWER_IS_BETTER)
                label = strcat(label, "<");
-       if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+       if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
                label = strcat(label, "!!");
-       else if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+       else if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
                label = strcat(label, "!");
        return label;
 }
@@ -572,7 +572,7 @@ string GetPlayerScoreString(entity pl, float shortString)
        {
                // label
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
                        {
                                f = scores_flags[i];
                                l = scores_label[i];
@@ -580,7 +580,7 @@ string GetPlayerScoreString(entity pl, float shortString)
                        }
                if(shortString < 2)
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
                        {
                                f = scores_flags[i];
                                l = scores_label[i];
@@ -588,8 +588,8 @@ string GetPlayerScoreString(entity pl, float shortString)
                        }
                if(shortString < 1)
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
                        {
                                f = scores_flags[i];
                                l = scores_label[i];
@@ -600,16 +600,16 @@ string GetPlayerScoreString(entity pl, float shortString)
        else if((sk = pl.scorekeeper))
        {
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
                                out = strcat(out, ftos(sk.(scores[i])), ",");
                if(shortString < 2)
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
                                out = strcat(out, ftos(sk.(scores[i])), ",");
                if(shortString < 1)
                for(i = 0; i < MAX_SCORE; ++i)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
-                       if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+                       if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
                                out = strcat(out, ftos(sk.(scores[i])), ",");
                out = substring(out, 0, strlen(out) - 1);
        }
@@ -628,7 +628,7 @@ string GetTeamScoreString(float tm, float shortString)
        {
                // label
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
                        {
                                f = teamscores_flags[i];
                                l = teamscores_label[i];
@@ -636,7 +636,7 @@ string GetTeamScoreString(float tm, float shortString)
                        }
                if(shortString < 2)
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
                        {
                                f = teamscores_flags[i];
                                l = teamscores_label[i];
@@ -644,8 +644,8 @@ string GetTeamScoreString(float tm, float shortString)
                        }
                if(shortString < 1)
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
                        {
                                f = teamscores_flags[i];
                                l = teamscores_label[i];
@@ -656,16 +656,16 @@ string GetTeamScoreString(float tm, float shortString)
        else if((sk = teamscorekeepers[tm - 1]))
        {
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
                                out = strcat(out, ftos(sk.(teamscores[i])), ",");
                if(shortString < 2)
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
                                out = strcat(out, ftos(sk.(teamscores[i])), ",");
                if(shortString < 1)
                for(i = 0; i < MAX_TEAMSCORE; ++i)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
-                       if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
+                       if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
                                out = strcat(out, ftos(sk.(teamscores[i])), ",");
                out = substring(out, 0, strlen(out) - 1);
        }
index a9b2443b73f1715fdf1678a7a8b781517a32f624..84fcb63783ec7e6e3e5f290ae9f7ea690dfd4f47 100644 (file)
@@ -61,7 +61,7 @@ void CreatureFrame (void)
                                                if (self.watersound_finished < time)
                                                {
                                                        self.watersound_finished = time + 0.5;
-                                                       sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+                                                       sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTEN_NORM);
                                                }
                                                Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
                                        }
@@ -70,7 +70,7 @@ void CreatureFrame (void)
                                                if (self.watersound_finished < time)
                                                {
                                                        self.watersound_finished = time + 0.5;
-                                                       sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+                                                       sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTEN_NORM);
                                                }
                                                Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
                                        }
@@ -82,7 +82,7 @@ void CreatureFrame (void)
                        if (self.flags & FL_INWATER)
                        {
                                // play leave water sound
-                               self.flags &~= FL_INWATER;
+                               self.flags &= ~FL_INWATER;
                                self.dmgtime = 0;
                        }
                        self.air_finished = time + 12;
index 919ed6b8d95e93c3127739e2a0119cfccedbf1df..9c389da4392455956528709533d398bcf1af8ee1 100644 (file)
@@ -1,6 +1,6 @@
 #pragma noref 0
 
-#undef ATTN_NORM
+#undef ATTEN_NORM
 #undef objerror
 #undef droptofloor
 #undef sound
index b259b2b6c31bbbe3495fae241cf4915c3cbc061a..1907cb2bb944ce0e692f46c1fba47207ca54bbf4 100644 (file)
@@ -1,6 +1,6 @@
 #define SVQC
 
-#define ATTN_NORM builtin_ATTN_NORM
+#define ATTEN_NORM builtin_ATTEN_NORM
 #define objerror builtin_objerror
 #define droptofloor builtin_droptofloor
 #define sound builtin_sound
index 61e2a09bf8af6927a78273a74005ac1e26e67287..31aa5caf791b29bbe8fb69e489aa935e167bb4d9 100644 (file)
@@ -131,7 +131,7 @@ void ItemRead(float _IsNew)
             if(self.ItemStatus & ITS_AVAILABLE)
                 self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
             else
-                 self.effects &~= (EF_ADDITIVE | EF_FULLBRIGHT);
+                 self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT);
         }
     }
     
@@ -222,7 +222,7 @@ float ItemSend(entity to, float sf)
     if(self.gravity)
         sf |= ISF_DROP;
     else
-        sf &~= ISF_DROP;
+        sf &= ~ISF_DROP;
        
        WriteByte(MSG_ENTITY, ENT_CLIENT_ITEM); 
        WriteByte(MSG_ENTITY, sf);
@@ -285,7 +285,7 @@ float have_pickup_item(void)
                if(autocvar_g_pickup_items == 0)
                        return FALSE;
                if(g_weaponarena)
-                       if(!WEPSET_EMPTY_E(self) || (self.items & IT_AMMO))
+                       if(self.weapons || (self.items & IT_AMMO))
                                return FALSE;
        }
        return TRUE;
@@ -347,7 +347,7 @@ float Item_Customize()
 {
        if(self.spawnshieldtime)
                return TRUE;
-       if(!WEPSET_CONTAINS_ALL_EE(other, self))
+       if(self.weapons & ~other.weapons)
        {
                self.colormod = '0 0 0';
                self.glowmod = self.colormod;
@@ -371,8 +371,8 @@ float Item_Customize()
 
 void Item_Show (entity e, float mode)
 {    
-       e.effects &~= EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST;
-       e.ItemStatus &~= ITS_STAYWEP;
+       e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST);
+       e.ItemStatus &= ~ITS_STAYWEP;
        if (mode > 0)
        {
                // make the item look normal, and be touchable
@@ -387,7 +387,7 @@ void Item_Show (entity e, float mode)
                e.model = string_null;
                e.solid = SOLID_NOT;
                e.spawnshieldtime = 1;
-               e.ItemStatus &~= ITS_AVAILABLE;
+               e.ItemStatus &= ~ITS_AVAILABLE;
        }
        else if((e.flags & FL_WEAPON) && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
        {
@@ -405,7 +405,7 @@ void Item_Show (entity e, float mode)
                e.colormod = '0 0 0';
                e.glowmod = e.colormod;
                e.spawnshieldtime = 1;
-               e.ItemStatus &~= ITS_AVAILABLE;
+               e.ItemStatus &= ~ITS_AVAILABLE;
        }
        
        if (e.items & IT_STRENGTH || e.items & IT_INVINCIBLE)
@@ -431,11 +431,11 @@ void Item_Respawn (void)
        Item_Show(self, 1);
        // this is ugly...
        if(self.items == IT_STRENGTH)
-               sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);     // play respawn sound
+               sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTEN_NORM);    // play respawn sound
        else if(self.items == IT_INVINCIBLE)
-               sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);       // play respawn sound
+               sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTEN_NORM);      // play respawn sound
        else
-               sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM);  // play respawn sound
+               sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
        setorigin (self, self.origin);
 
        //pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
@@ -492,7 +492,7 @@ void Item_RespawnCountdown (void)
                                localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
                        }
                }
-               sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
+               sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM);        // play respawn sound
                if(self.waypointsprite_attached)
                {
                        WaypointSprite_Ping(self.waypointsprite_attached);
@@ -503,7 +503,7 @@ void Item_RespawnCountdown (void)
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if((e.flags & FL_POWERUP) || WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+       if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS))
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
@@ -533,10 +533,10 @@ void Item_ScheduleInitialRespawn(entity e)
        Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
 }
 
-float ITEM_MODE_NONE = 0;
-float ITEM_MODE_HEALTH = 1;
-float ITEM_MODE_ARMOR = 2;
-float ITEM_MODE_FUEL = 3;
+const float ITEM_MODE_NONE = 0;
+const float ITEM_MODE_HEALTH = 1;
+const float ITEM_MODE_ARMOR = 2;
+const float ITEM_MODE_FUEL = 3;
 float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode)
 {
        if (!item.ammofield)
@@ -597,7 +597,7 @@ float Item_GiveTo(entity item, entity player)
        if (player.switchweapon == w_getbestweapon(player))
                _switchweapon = TRUE;
 
-       if not(WEPSET_CONTAINS_EW(player, player.switchweapon))
+       if not(player.weapons & WepSet_FromWeapon(player.switchweapon))
                _switchweapon = TRUE;
 
        pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
@@ -610,15 +610,15 @@ float Item_GiveTo(entity item, entity player)
 
        if (item.flags & FL_WEAPON)
        {
-               WEPSET_DECLARE_A(it);
-               WEPSET_COPY_AE(it, item);
-               WEPSET_ANDNOT_AE(it, player);
+               WepSet it;
+               it = item.weapons;
+               it &= ~player.weapons;
 
-               if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && item.pickup_anyway))
+               if (it || (item.spawnshieldtime && item.pickup_anyway))
                {
                        pickedup = TRUE;
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-                       if(WEPSET_CONTAINS_AW(it, i))
+                       if(it & WepSet_FromWeapon(i))
                                W_GiveWeapon(player, i);
                }
        }
@@ -715,7 +715,7 @@ void Item_Touch (void)
        other.last_pickup = time;
 
        pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1);
-       sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTN_NORM);
+       sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTEN_NORM);
 
        if (self.classname == "droppedweapon")
                remove (self);
@@ -756,7 +756,7 @@ void Item_Reset()
                if(self.waypointsprite_attached)
                        WaypointSprite_Kill(self.waypointsprite_attached);
 
-               if((self.flags & FL_POWERUP) | WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
+               if((self.flags & FL_POWERUP) || (self.weapons & WEPSET_SUPERWEAPONS)) // do not spawn powerups initially!
                        Item_ScheduleInitialRespawn(self);
        }
 }
@@ -784,7 +784,7 @@ void Item_FindTeam()
                                Item_Show(head, -1);
                                head.state = 1; // state 1 = initially hidden item
                        }
-                       head.effects &~= EF_NODRAW;
+                       head.effects &= ~EF_NODRAW;
                }
 
                Item_Reset();
@@ -808,7 +808,7 @@ float weapon_pickupevalfunc(entity player, entity item)
        float c, j, position;
 
        // See if I have it already
-       if(!WEPSET_CONTAINS_ALL_EE(player, item))
+       if(item.weapons & ~player.weapons)
        {
                // If I can pick it up
                if(!item.spawnshieldtime)
@@ -865,7 +865,7 @@ float commodity_pickupevalfunc(entity player, entity item)
        {
                wi = get_weaponinfo(i);
 
-               if not(WEPSET_CONTAINS_EW(player, i))
+               if not(player.weapons & WepSet_FromWeapon(i))
                        continue;
 
                if(wi.items & IT_SHELLS)
@@ -946,7 +946,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        self.weapon = weaponid;
 
        if(weaponid)
-               WEPSET_COPY_EW(self, weaponid);
+               self.weapons = WepSet_FromWeapon(weaponid);
        
        self.flags = FL_ITEM | itemflags;
 
@@ -974,7 +974,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                if(self.strength_finished || self.invincible_finished || self.superweapons_finished)
                /*
                if(self.items == 0)
-               if(WEPSET_CONTAINS_ALL_AE(WEPBIT_SUPERWEAPONS, self)) // only superweapons
+               if(!(self.weapons & ~WEPSET_SUPERWEAPONS)) // only superweapons
                if(self.ammo_nails == 0)
                if(self.ammo_cells == 0)
                if(self.ammo_rockets == 0)
@@ -1062,7 +1062,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        self.is_item = TRUE;
                }
 
-               WEPSET_OR_AW(weaponsInMap, weaponid);
+               weaponsInMap |= WepSet_FromWeapon(weaponid);
 
                precache_model (self.model);
                precache_sound (self.item_pickupsound);
@@ -1232,7 +1232,7 @@ void weapon_defaultspawnfunc(float wpn)
 
        if(!self.respawntime)
        {
-               if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+               if(e.weapons & WEPSET_SUPERWEAPONS)
                {
                        self.respawntime = g_pickup_respawntime_superweapon;
                        self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
@@ -1244,7 +1244,7 @@ void weapon_defaultspawnfunc(float wpn)
                }
        }
 
-       if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+       if(e.weapons & WEPSET_SUPERWEAPONS)
                if(!self.superweapons_finished)
                        self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
@@ -1268,7 +1268,7 @@ void weapon_defaultspawnfunc(float wpn)
        f = FL_WEAPON;
 
        // no weapon-stay on superweapons
-       if(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+       if(e.weapons & WEPSET_SUPERWEAPONS)
                f |= FL_NO_WEAPON_STAY;
 
        // weapon stay isn't supported for teamed weapons
@@ -1541,7 +1541,7 @@ void spawnfunc_target_items (void)
                                        e = get_weaponinfo(j);
                                        if(argv(i) == e.netname)
                                        {
-                                               WEPSET_OR_EW(self, j);
+                                               self.weapons |= WepSet_FromWeapon(j);
                                                if(self.spawnflags == 0 || self.spawnflags == 2)
                                                        weapon_action(e.weapon, WR_PRECACHE);
                                                break;
@@ -1601,7 +1601,7 @@ void spawnfunc_target_items (void)
                {
                        e = get_weaponinfo(j);
                        if(e.weapon)
-                               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, WEPSET_CONTAINS_EW(self, j), e.netname);
+                               self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & WepSet_FromWeapon(j)), e.netname);
                }
        }
        self.netname = strzone(self.netname);
@@ -1664,31 +1664,31 @@ void spawnfunc_item_jetpack(void)
 
 float GiveWeapon(entity e, float wpn, float op, float val)
 {
-       float v0, v1;
-       v0 = WEPSET_CONTAINS_EW(e, wpn);
+       WepSet v0, v1;
+       v0 = (e.weapons & WepSet_FromWeapon(wpn));
        switch(op)
        {
                case OP_SET:
                        if(val > 0)
-                               WEPSET_OR_EW(e, wpn);
+                               e.weapons |= WepSet_FromWeapon(wpn);
                        else
-                               WEPSET_ANDNOT_EW(e, wpn);
+                               e.weapons &= ~WepSet_FromWeapon(wpn);
                        break;
                case OP_MIN:
                case OP_PLUS:
                        if(val > 0)
-                               WEPSET_OR_EW(e, wpn);
+                               e.weapons |= WepSet_FromWeapon(wpn);
                        break;
                case OP_MAX:
                        if(val <= 0)
-                               WEPSET_ANDNOT_EW(e, wpn);
+                               e.weapons &= ~WepSet_FromWeapon(wpn);
                        break;
                case OP_MINUS:
                        if(val > 0)
-                               WEPSET_ANDNOT_EW(e, wpn);
+                               e.weapons &= ~WepSet_FromWeapon(wpn);
                        break;
        }
-       v1 = WEPSET_CONTAINS_EW(e, wpn);
+       v1 = (e.weapons & WepSet_FromWeapon(wpn));
        return (v0 != v1);
 }
 
@@ -1702,7 +1702,7 @@ float GiveBit(entity e, .float fld, float bit, float op, float val)
                        if(val > 0)
                                e.fld |= bit;
                        else
-                               e.fld &~= bit;
+                               e.fld &= ~bit;
                        break;
                case OP_MIN:
                case OP_PLUS:
@@ -1711,11 +1711,11 @@ float GiveBit(entity e, .float fld, float bit, float op, float val)
                        break;
                case OP_MAX:
                        if(val <= 0)
-                               e.fld &~= bit;
+                               e.fld &= ~bit;
                        break;
                case OP_MINUS:
                        if(val > 0)
-                               e.fld &~= bit;
+                               e.fld &= ~bit;
                        break;
        }
        v1 = (e.fld & bit);
@@ -1755,12 +1755,12 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn
        if(v1 <= v0 - t)
        {
                if(snd_decr != "")
-                       sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM);
        }
        else if(v0 >= v0 + t)
        {
                if(snd_incr != "")
-                       sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM);
        }
 }
 
@@ -1772,9 +1772,9 @@ void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .floa
                e.regenfield = max(e.regenfield, time + regentime);
 }
 
-#define PREGIVE_WEAPONS(e) WEPSET_DECLARE_A(save_weapons); WEPSET_COPY_AE(save_weapons, e)
+#define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = e.weapons
 #define PREGIVE(e,f) float save_##f; save_##f = (e).f
-#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), WEPSET_CONTAINS_AW(save_weapons, b), WEPSET_CONTAINS_EW(e, b), 0, snd_incr, snd_decr)
+#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(e.weapons & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr)
 #define POSTGIVE_BIT(e,f,b,snd_incr,snd_decr) GiveSound((e), save_##f & (b), (e).f & (b), 0, snd_incr, snd_decr)
 #define POSTGIVE_VALUE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
 #define POSTGIVE_VALUE_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e), save_##f, (e).f, rotfield, rottime, regenfield, regentime); GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
@@ -1939,8 +1939,8 @@ float GiveItems(entity e, float beginarg, float endarg)
                if(wi.weapon)
                {
                        POSTGIVE_WEAPON(e, j, "weapons/weaponpickup.wav", string_null);
-                       if not(WEPSET_CONTAINS_AW(save_weapons, j))
-                               if(WEPSET_CONTAINS_EW(e, j))
+                       if not(save_weapons & WepSet_FromWeapon(j))
+                               if(e.weapons & WepSet_FromWeapon(j))
                                        weapon_action(wi.weapon, WR_PRECACHE);
                }
        }
@@ -1955,7 +1955,7 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
 
        if(e.superweapons_finished <= 0)
-               if(WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+               if(self.weapons & WEPSET_SUPERWEAPONS)
                        e.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        if(e.strength_finished <= 0)
@@ -1971,7 +1971,7 @@ float GiveItems(entity e, float beginarg, float endarg)
        else
                e.superweapons_finished += time;
 
-       if not(WEPSET_CONTAINS_EW(e, e.switchweapon))
+       if not(e.weapons & WepSet_FromWeapon(e.switchweapon))
                _switchweapon = TRUE;
        if(_switchweapon)
                W_SwitchWeapon_Force(e, w_getbestweapon(e));
index 0efb77df276ae2154a8127458e5695b2ecb0b53d..3c797f97710e46b6d99e44164816554b122a3d3c 100644 (file)
@@ -1,5 +1,5 @@
-float PUSH_ONCE                        = 1;
-float PUSH_SILENT              = 2;
+const float PUSH_ONCE                  = 1;
+const float PUSH_SILENT                = 2;
 
 .float pushltime;
 .float istypefrag;
@@ -137,7 +137,7 @@ void trigger_push_touch()
                return;
 
        if(self.team)
-               if((self.spawnflags & 4 == 0) == (self.team != other.team))
+               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
                        return;
 
        EXACTTRIGGER_TOUCH;
@@ -164,7 +164,7 @@ void trigger_push_touch()
                other.velocity = self.movedir;
        }
 
-       other.flags &~= FL_ONGROUND;
+       other.flags &= ~FL_ONGROUND;
 
        if (IS_PLAYER(other))
        {
@@ -175,7 +175,7 @@ void trigger_push_touch()
                {
                        // flash when activated
                        pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1);
-                       sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+                       sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
                        self.pushltime = time + 0.2;
                }
                if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
index 300cbd940bb3f8b741b4c8450be4268759a6a21a..24da476d72bad18cb5d19089a883492b98d392c5 100644 (file)
@@ -14,11 +14,6 @@ void generic_plat_blocked()
 }
 
 
-float  STATE_TOP               = 0;
-float  STATE_BOTTOM    = 1;
-float  STATE_UP                = 2;
-float  STATE_DOWN              = 3;
-
 .entity trigger_field;
 
 void() plat_center_touch;
@@ -27,7 +22,7 @@ void() plat_trigger_use;
 void() plat_go_up;
 void() plat_go_down;
 void() plat_crush;
-float PLAT_LOW_TRIGGER = 1;
+const float PLAT_LOW_TRIGGER = 1;
 
 void plat_spawn_inside_trigger()
 {
@@ -72,7 +67,7 @@ void plat_spawn_inside_trigger()
 
 void plat_hit_top()
 {
-       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 1;
        self.think = plat_go_down;
        self.nextthink = self.ltime + 3;
@@ -80,20 +75,20 @@ void plat_hit_top()
 
 void plat_hit_bottom()
 {
-       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 2;
 }
 
 void plat_go_down()
 {
-       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
+       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 3;
        SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
 }
 
 void plat_go_up()
 {
-       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
+       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 4;
        SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
 }
@@ -294,7 +289,7 @@ void train_next()
                SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
 
        if(self.noise != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+               sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
 }
 
 void func_train_find()
@@ -375,7 +370,7 @@ void spawnfunc_func_rotating()
        if (self.noise != "")
        {
                precache_sound(self.noise);
-               ambientsound(self.origin, self.noise, VOL_BASE, ATTN_IDLE);
+               ambientsound(self.origin, self.noise, VOL_BASE, ATTEN_IDLE);
        }
        
        self.active = ACTIVE_ACTIVE;
@@ -454,7 +449,7 @@ void spawnfunc_func_bobbing()
        if (self.noise != "")
        {
                precache_sound(self.noise);
-               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
        }
        if (!self.speed)
                self.speed = 4;
@@ -531,7 +526,7 @@ void spawnfunc_func_pendulum()
        if (self.noise != "")
        {
                precache_sound(self.noise);
-               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
        }
 
        self.active = ACTIVE_ACTIVE;
@@ -624,7 +619,7 @@ void button_fire()
                return;
 
        if (self.noise != "")
-               sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
        self.state = STATE_UP;
        SUB_CalcMove (self.pos2, self.speed, button_wait);
@@ -734,9 +729,9 @@ void spawnfunc_func_button()
 }
 
 
-float DOOR_START_OPEN = 1;
-float DOOR_DONT_LINK = 4;
-float DOOR_TOGGLE = 32;
+const float DOOR_START_OPEN = 1;
+const float DOOR_DONT_LINK = 4;
+const float DOOR_TOGGLE = 32;
 
 /*
 
@@ -819,7 +814,7 @@ void door_blocked()
 void door_hit_top()
 {
        if (self.noise1 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_TOP;
        if (self.spawnflags & DOOR_TOGGLE)
                return;         // don't come down automatically
@@ -836,14 +831,14 @@ void door_hit_top()
 void door_hit_bottom()
 {
        if (self.noise1 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_BOTTOM;
 }
 
 void door_go_down()
 {
        if (self.noise2 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        if (self.max_health)
        {
                self.takedamage = DAMAGE_YES;
@@ -866,7 +861,7 @@ void door_go_up()
        }
 
        if (self.noise2 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
        SUB_CalcMove (self.pos2, self.speed, door_hit_top);
 
@@ -1122,7 +1117,7 @@ void door_generic_plat_blocked()
 void door_rotating_hit_top()
 {
        if (self.noise1 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = STATE_TOP;
        if (self.spawnflags & DOOR_TOGGLE)
                return;         // don't come down automatically
@@ -1133,7 +1128,7 @@ void door_rotating_hit_top()
 void door_rotating_hit_bottom()
 {
        if (self.noise1 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        if (self.lip==666) // self.lip is used to remember reverse opening direction for door_rotating
        {
                self.pos2 = '0 0 0' - self.pos2;
@@ -1145,7 +1140,7 @@ void door_rotating_hit_bottom()
 void door_rotating_go_down()
 {
        if (self.noise2 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        if (self.max_health)
        {
                self.takedamage = DAMAGE_YES;
@@ -1167,7 +1162,7 @@ void door_rotating_go_up()
                return;
        }
        if (self.noise2 != "")
-               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        self.state = STATE_UP;
        SUB_CalcAngleMove (self.pos2, self.speed, door_rotating_hit_top);
 
@@ -1593,11 +1588,11 @@ void() fd_secret_move5;
 void() fd_secret_move6;
 void() fd_secret_done;
 
-float SECRET_OPEN_ONCE = 1;            // stays open
-float SECRET_1ST_LEFT = 2;             // 1st move is left of arrow
-float SECRET_1ST_DOWN = 4;             // 1st move is down from arrow
-float SECRET_NO_SHOOT = 8;             // only opened by trigger
-float SECRET_YES_SHOOT = 16;   // shootable even if targeted
+const float SECRET_OPEN_ONCE = 1;              // stays open
+const float SECRET_1ST_LEFT = 2;               // 1st move is left of arrow
+const float SECRET_1ST_DOWN = 4;               // 1st move is down from arrow
+const float SECRET_NO_SHOOT = 8;               // only opened by trigger
+const float SECRET_YES_SHOOT = 16;     // shootable even if targeted
 
 void fd_secret_use()
 {
@@ -1621,7 +1616,7 @@ void fd_secret_use()
        // Make a sound, wait a little...
 
        if (self.noise1 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.nextthink = self.ltime + 0.1;
 
        temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
@@ -1646,7 +1641,7 @@ void fd_secret_use()
        self.dest2 = self.dest1 + v_forward * self.t_length;
        SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
        if (self.noise2 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
 }
 
 void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
@@ -1660,14 +1655,14 @@ void fd_secret_move1()
        self.nextthink = self.ltime + 1.0;
        self.think = fd_secret_move2;
        if (self.noise3 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 // Start moving sideways w/sound...
 void fd_secret_move2()
 {
        if (self.noise2 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
 }
 
@@ -1675,7 +1670,7 @@ void fd_secret_move2()
 void fd_secret_move3()
 {
        if (self.noise3 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
        if (!(self.spawnflags & SECRET_OPEN_ONCE))
        {
                self.nextthink = self.ltime + self.wait;
@@ -1687,7 +1682,7 @@ void fd_secret_move3()
 void fd_secret_move4()
 {
        if (self.noise2 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
 }
 
@@ -1697,13 +1692,13 @@ void fd_secret_move5()
        self.nextthink = self.ltime + 1.0;
        self.think = fd_secret_move6;
        if (self.noise3 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 void fd_secret_move6()
 {
        if (self.noise2 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
        SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
 }
 
@@ -1716,7 +1711,7 @@ void fd_secret_done()
                //self.th_pain = fd_secret_use;
        }
        if (self.noise3 != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTEN_NORM);
 }
 
 void secret_blocked()
@@ -1866,7 +1861,7 @@ void spawnfunc_func_fourier()
        if (self.noise != "")
        {
                precache_sound(self.noise);
-               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
        }
 
        if (!self.speed)
@@ -2012,7 +2007,7 @@ void spawnfunc_func_vectormamamam()
        if (self.noise != "")
        {
                precache_sound(self.noise);
-               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
+               soundto(MSG_INIT, self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
        }
 
        if(!self.targetfactor)
index 2932ad68b143bed0b8d8cf342717592bc48eaa49..d61911ecdfd2e9e75033b69887c8c69eaf4b73c6 100644 (file)
@@ -97,7 +97,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
                {
                        if(tflags & TELEPORT_FLAG_SOUND)
-                               sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
+                               sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM);
                        if(tflags & TELEPORT_FLAG_PARTICLES)
                        {
                                pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
@@ -126,7 +126,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                                tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
 
                // player no longer is on ground
-               player.flags &~= FL_ONGROUND;
+               player.flags &= ~FL_ONGROUND;
 
                // reset tracking of oldvelocity for impact damage (sudden velocity changes)
                player.oldvelocity = player.velocity;
@@ -216,7 +216,7 @@ void Teleport_Touch (void)
                return;
 
        if(self.team)
-               if((self.spawnflags & 4 == 0) == (self.team != other.team))
+               if(((self.spawnflags & 4) == 0) == (self.team != other.team))
                        return;
 
        EXACTTRIGGER_TOUCH;
index daab6469981c021bf8224e4bf5816a9705876d08..769416c467e534441279a52222fd802e283d26ac 100644 (file)
@@ -63,7 +63,7 @@ void TargetMusic_RestoreGame()
 float trigger_music_SendEntity(entity to, float sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC);
-       sf &~= 0x80;
+       sf &= ~0x80;
        if(self.cnt)
                sf |= 0x80;
        WriteByte(MSG_ENTITY, sf);
index b481f46b3aa6185423d2999558fa0a559d9c46a7..81c877db902fd38fda510aeb97525e962b6226fa 100644 (file)
@@ -54,7 +54,7 @@ void InitGameplayMode()
 
        MapInfo_LoadMapSettings(mapname);
        teamplay = 0;
-       serverflags &~= SERVERFLAG_TEAMPLAY;
+       serverflags &= ~SERVERFLAG_TEAMPLAY;
 
        if not(cvar_value_issafe(world.fog))
        {
index 9d108c6ae8433c565fdf8162a2c1fbe226feb54c..4ce95fc396ac7c03574967877506a45986e7e1d9 100644 (file)
@@ -442,31 +442,31 @@ void turrets_precash();
 
 // common
 .float turret_type;
-float TID_COMMON        = 1;
-float TID_EWHEEL        = 2;
-float TID_FLAC          = 3;
-float TID_FUSION        = 4;
-float TID_HELLION       = 5;
-float TID_HK            = 6;
-float TID_MACHINEGUN    = 7;
-float TID_MLRS          = 8;
-float TID_PHASER        = 9;
-float TID_PLASMA        = 10;
-float TID_PLASMA_DUAL   = 11;
-float TID_TESLA         = 12;
-float TID_WALKER        = 13;
-float TID_LAST          = 13;
-
-float TNSF_UPDATE       = 2;
-float TNSF_STATUS       = 4;
-float TNSF_SETUP        = 8;
-float TNSF_ANG          = 16;
-float TNSF_AVEL         = 32;
-float TNSF_MOVE         = 64;
+const float TID_COMMON        = 1;
+const float TID_EWHEEL        = 2;
+const float TID_FLAC          = 3;
+const float TID_FUSION        = 4;
+const float TID_HELLION       = 5;
+const float TID_HK            = 6;
+const float TID_MACHINEGUN    = 7;
+const float TID_MLRS          = 8;
+const float TID_PHASER        = 9;
+const float TID_PLASMA        = 10;
+const float TID_PLASMA_DUAL   = 11;
+const float TID_TESLA         = 12;
+const float TID_WALKER        = 13;
+const float TID_LAST          = 13;
+
+const float TNSF_UPDATE       = 2;
+const float TNSF_STATUS       = 4;
+const float TNSF_SETUP        = 8;
+const float TNSF_ANG          = 16;
+const float TNSF_AVEL         = 32;
+const float TNSF_MOVE         = 64;
 .float anim_start_time;
-float TNSF_ANIM         = 128;
+const float TNSF_ANIM         = 128;
 
-float TNSF_FULL_UPDATE  = 16777215;
+const float TNSF_FULL_UPDATE  = 16777215;
 
 #endif // TTURRETS_ENABLED
 
index 51fe9dfe7eb1b6df9594af2b8993c365b4c49eaa..4145a6ea34d98addf774368c5d31406ede54d1cb 100644 (file)
@@ -52,7 +52,7 @@ void turret_stdproc_respawn()
     // this function doubles as "teamchange" function.
     self.tur_head.team         = self.team;
 
-    self.effects             &~= EF_NODRAW;
+    self.effects             &= ~EF_NODRAW;
     self.deadflag           = DEAD_NO;
     self.effects            = EF_LOWPRECISION;
     self.solid              = SOLID_BBOX;
index 48a457a573dd04e3048cd8e1c11e1c4691a535a7..5a77b17d91e8c60eed40053787ccba55c8424feb 100644 (file)
@@ -176,7 +176,7 @@ entity turret_projectile(string _snd, float _size, float _health, float _death,
 {
     entity proj;
 
-    sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTN_NORM);
+    sound (self, CH_WEAPON_A, _snd, VOL_BASE, ATTEN_NORM);
     proj                 = spawn ();
     setorigin(proj, self.tur_shotorg);
     setsize(proj, '-0.5 -0.5 -0.5' * _size, '0.5 0.5 0.5' * _size);
index 2f28c7c3b37cbbd5634e3dc0c08319478c80bc25..c704aa1115f9cd51b354c606eec14ad2102cbde8 100644 (file)
@@ -40,7 +40,7 @@ void beam_think()
         self.owner.attack_finished_single = time + self.owner.shot_refire;
         self.owner.fireflag = 2;
         self.owner.tur_head.frame = 10;
-        sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
+        sound (self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
         remove(self);
         return;
     }
@@ -50,7 +50,7 @@ void beam_think()
     if (time - self.shot_spread > 0)
     {
         self.shot_spread = time + 2;
-        sound (self, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTN_NORM);
+        sound (self, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM);
     }
 
 
@@ -93,7 +93,7 @@ void turret_phaser_attack()
     beam.enemy = self.enemy;
     beam.bot_dodge = TRUE;
     beam.bot_dodgerating = beam.shot_dmg;
-    sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTN_NORM);
+    sound (beam, CH_SHOTS_SINGLE, "turrets/phaser.wav", VOL_BASE, ATTEN_NORM);
     self.fireflag = 1;
 
     beam.attack_finished_single = self.attack_finished_single;
@@ -101,7 +101,7 @@ void turret_phaser_attack()
 
     setattachment(beam,self.tur_head,"tag_fire");
 
-    soundat (self, trace_endpos, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+    soundat (self, trace_endpos, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
 
     if (self.tur_head.frame == 0)
         self.tur_head.frame = 1;
index 20100de047203368a5d11e5a520a8cd8cdb39e11..5e0feea35bd77edd8d98186a7f2c4e31e4495ae1 100644 (file)
@@ -186,7 +186,7 @@ void walker_fire_rocket(vector org)
     rocket = spawn ();
     setorigin(rocket, org);
 
-    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_WEAPON_A, "weapons/hagar_fire.wav", VOL_BASE, ATTEN_NORM);
     setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
     rocket.classname          = "walker_rocket";
@@ -514,7 +514,7 @@ void walker_postthink()
 
 void walker_attack()
 {
-    sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
     pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
index 4330966dc7894f2b959b4c51ceedaa302e56e4f4..dff26d6ea370227683bd597e6f785de671506776 100644 (file)
@@ -232,7 +232,7 @@ void bumb_gunner_exit(float _exitflag)
        self.takedamage     = DAMAGE_AIM;
        self.solid          = SOLID_SLIDEBOX;
        self.movetype       = MOVETYPE_WALK;
-       self.effects        &~= EF_NODRAW;
+       self.effects        &= ~EF_NODRAW;
        self.alpha          = 1;
        self.PlayerPhysplug = func_null;
        self.view_ofs       = PL_VIEW_OFS;
@@ -315,7 +315,7 @@ float bumb_gunner_enter()
        other.vehicle_reload2   = self.vehicle_reload2;
        other.vehicle_energy    = self.vehicle_energy;
        other.PlayerPhysplug    = bumb_gunner_frame;
-       other.flags             &~= FL_ONGROUND;
+       other.flags             &= ~FL_ONGROUND;
 
        msg_entity = other;
        WriteByte(MSG_ONE, SVC_SETVIEWPORT);
@@ -531,7 +531,7 @@ float bumb_pilot_frame()
        if((pilot.BUTTON_ATCK || pilot.BUTTON_ATCK2) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
        {
                vehic.gun3.enemy.realowner = pilot;
-               vehic.gun3.enemy.effects &~= EF_NODRAW;
+               vehic.gun3.enemy.effects &= ~EF_NODRAW;
                
                vehic.gun3.enemy.hook_start = gettaginfo(vehic.gun3, gettagindex(vehic.gun3, "fire"));
                vehic.gun3.enemy.SendFlags |= BRG_START;
@@ -706,7 +706,7 @@ void bumb_blowup()
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
                                 DEATH_VH_BUMB_DEATH, world);
 
-       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        
        if(self.owner.deadflag == DEAD_DYING)
@@ -722,7 +722,7 @@ void bumb_diethink()
 
        if(random() < 0.1)
        {
-               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
                pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        }
 
index f5788c60b4b993a4631b2b4dbebe18456a136b85..97bf73aed1a48d8beae1a330d9c990337123ac42 100644 (file)
@@ -319,7 +319,7 @@ float racer_frame()
         {
             self.sounds = 1;
             self.sound_nexttime = time + 10.922667; //soundlength("vehicles/racer_move.wav");
-            sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_move.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+            sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_move.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
         }
     }
     else
@@ -328,7 +328,7 @@ float racer_frame()
         {
             self.sounds = 0;
             self.sound_nexttime = time + 11.888604; //soundlength("vehicles/racer_idle.wav");
-            sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_idle.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+            sound (self, CH_TRIGGER_SINGLE, "vehicles/racer_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
         }
     }
 
@@ -354,13 +354,13 @@ float racer_frame()
         if(racer.strength_finished < time)
         {
             racer.strength_finished = time + 10.922667; //soundlength("vehicles/racer_boost.wav");
-            sound (racer.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+            sound (racer.tur_head, CH_TRIGGER_SINGLE, "vehicles/racer_boost.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
         }
     }
     else
     {
         racer.strength_finished = 0;
-        sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+        sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
     }
 
        df -= v_up * (vlen(racer.velocity) * autocvar_g_vehicle_racer_downforce);
@@ -490,7 +490,7 @@ void racer_exit(float eject)
     self.think      = racer_think;
     self.nextthink  = time;
     self.movetype   = MOVETYPE_BOUNCE;
-    sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+    sound (self.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
 
     if not (self.owner)
         return;
index e899d4a31468b6a83d585babfee4d7f17287ffb3..ecad45b67ce4bf4dbd92468af4d9162d35f3939e 100644 (file)
@@ -295,7 +295,7 @@ float raptor_takeoff()
     if(self.sound_nexttime < time)
     {        
         self.sound_nexttime = time + 7.955812; //soundlength("vehicles/raptor_fly.wav");
-        sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+        sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
     }   
 
     // Takeoff sequense
@@ -388,15 +388,15 @@ float raptor_frame()
     if(self.sound_nexttime < time)
     {        
         self.sound_nexttime = time + 7.955812; 
-        //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp,   ATTN_NORM );
-        sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTN_NORM);        
+        //sound (self.tur_head, CH_TRIGGER_SINGLE, "vehicles/raptor_fly.wav", 1 - ftmp,   ATTEN_NORM );
+        sound (self, CH_TRIGGER_SINGLE, "vehicles/raptor_speed.wav", 1, ATTEN_NORM);        
         self.wait = ftmp;
     }        
     /*
     else if(fabs(ftmp - self.wait) > 0.2)
     {
-        sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp,   ATTN_NORM );
-        sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTN_NORM);        
+        sound (self.tur_head, CH_TRIGGER_SINGLE, "", 1 - ftmp,   ATTEN_NORM );
+        sound (self, CH_TRIGGER_SINGLE, "", ftmp, ATTEN_NORM);        
         self.wait = ftmp;
     }
     */
@@ -669,7 +669,7 @@ float raptor_frame()
         }
         
         if(_incomming)
-            sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTN_NONE);
+            sound(self, CH_PAIN_SINGLE, "vehicles/missile_alarm.wav", VOL_BASE, ATTEN_NONE);
         
         self.bomb1.cnt = time + 1;
     }
@@ -711,7 +711,7 @@ void raptor_diethink()
     
     if(random() < 0.1)
     {
-        sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+        sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
         pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
     }
     self.nextthink = time + 0.1;
index a66b564773635ce4b1a3d0e1b60b239d3a5cf7b5..9dc41952f32167641870998808b0e2b3dd18f18e 100644 (file)
@@ -387,13 +387,13 @@ float spiderbot_frame()
     {
         if(spider.frame == 4 && self.tur_head.wait != 0)
         {
-            sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+            sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
             spider.frame = 5;            
         }
         
         if(player.BUTTON_JUMP && self.tur_head.wait < time)
         {        
-            sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+            sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
             //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
             self.delay = 0;
 
@@ -411,7 +411,7 @@ float spiderbot_frame()
                     self.delay = 3;
                     self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
                     //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
-                    sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+                    sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
                 }                
                 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
                 spider.frame = 5;
@@ -447,7 +447,7 @@ float spiderbot_frame()
                     {                        
                         self.delay = 1;
                         self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
-                        sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+                        sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
                         //dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
                     }
                 }
@@ -468,7 +468,7 @@ float spiderbot_frame()
                     {                        
                         self.delay = 2;
                         self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
-                        sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTN_NORM);
+                        sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
                         //dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n");
                     }
                 }
@@ -505,7 +505,7 @@ float spiderbot_frame()
 //            fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
 //                autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_VH_SPID_MINIGUN, 0);
 
-            sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
+            sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
             //trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
             pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
 
@@ -653,7 +653,7 @@ void spiderbot_headfade()
     {
         if(self.alpha > 0.1)
         {
-            sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+            sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
             pointparticles(particleeffectnum("explosion_big"), self.origin + '0 0 100', '0 0 0', 1);
         }
         remove(self);
@@ -666,7 +666,7 @@ void spiderbot_blowup()
     {
         if(random() < 0.1)
         {
-            sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+            sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
             pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
         }
         self.nextthink = time + 0.1;
@@ -729,8 +729,8 @@ void spiderbot_blowup()
     self.movetype   = MOVETYPE_NONE;
     self.deadflag   = DEAD_DEAD;
     self.solid      = SOLID_NOT;
-    self.tur_head.effects  &~=  EF_FLAME;
-       self.vehicle_hudmodel.viewmodelforclient = self;
+    self.tur_head.effects  &=  ~EF_FLAME;
+    self.vehicle_hudmodel.viewmodelforclient = self;
 }
 
 void spiderbot_die()
index 1e78bd5a28eec14fc7cffa9f5e9703ccffd09bc6..75fa9407e6858b05393a4bdb5ce749f2bc99ec12 100644 (file)
@@ -23,7 +23,7 @@ void vehicles_setreturn();
 /** AuxiliaryXhair*
     Send additional points of interest to be drawn, to vehicle owner
 **/
-float MAX_AXH = 4;
+const float MAX_AXH = 4;
 .entity AuxiliaryXhair[MAX_AXH];
 
 float SendAuxiliaryXhair(entity to, float sf)
@@ -131,7 +131,7 @@ void CSQCVehicleSetup(entity own, float vehicle_id)
 .float  lock_strength;
 .float  lock_time;
 .float  lock_soundtime;
-float  DAMAGE_TARGETDRONE = 10;
+const float    DAMAGE_TARGETDRONE = 10;
 
 vector targetdrone_getnewspot()
 {
@@ -442,7 +442,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound,
         proj.flags           = FL_PROJECTILE | FL_NOTARGET;
 
     if(_mzlsound)
-        sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTN_NORM);
+        sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
 
     if(_mzlfx)
         pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
@@ -631,8 +631,8 @@ void vehicles_enter()
     //self.exteriormodeltoclient = self.owner;
     //self.tur_head.exteriormodeltoclient = self.owner;
 
-    other.flags &~= FL_ONGROUND;
-    self.flags  &~= FL_ONGROUND;
+    other.flags &= ~FL_ONGROUND;
+    self.flags  &= ~FL_ONGROUND;
 
     self.team                 = self.owner.team;
     self.flags               -= FL_NOTARGET;
@@ -781,7 +781,7 @@ void vehicles_exit(float eject)
         _player.takedamage     = DAMAGE_AIM;
         _player.solid          = SOLID_SLIDEBOX;
         _player.movetype       = MOVETYPE_WALK;
-        _player.effects        &~= EF_NODRAW;
+        _player.effects        &= ~EF_NODRAW;
         _player.alpha          = 1;
         _player.PlayerPhysplug = func_null;
         _player.vehicle        = world;
@@ -810,7 +810,7 @@ void vehicles_exit(float eject)
 
     _vehicle.team = _vehicle.tur_head.team;
         
-    sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTN_NORM);
+    sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
     _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;   
     _vehicle.phase = time + 1;
     
@@ -916,7 +916,7 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat
         self.vehicle_shieldent.alpha       = 0.45;
         self.vehicle_shieldent.angles      = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
         self.vehicle_shieldent.nextthink   = time;
-        self.vehicle_shieldent.effects &~= EF_NODRAW;
+        self.vehicle_shieldent.effects &= ~EF_NODRAW;
 
         self.vehicle_shield -= damage;
 
@@ -928,11 +928,11 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat
             self.vehicle_shieldent.alpha    = 0.75;
 
                if(sound_allowed(MSG_BROADCAST, attacker))
-                spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM);   // FIXME: PLACEHOLDER
+                spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);   // FIXME: PLACEHOLDER
         }
         else
                if(sound_allowed(MSG_BROADCAST, attacker))
-                spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTN_NORM);  // FIXME: PLACEHOLDER
+                spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
 
     }
     else
@@ -940,7 +940,7 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat
         self.vehicle_health -= damage;
 
         if(sound_allowed(MSG_BROADCAST, attacker))
-            spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTN_NORM);  // FIXME: PLACEHOLDER
+            spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
     }
     
        if(self.damageforcescale < 1 && self.damageforcescale > 0)
@@ -1347,7 +1347,7 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string
 
 void vehicles_gib_explode()
 {
-       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        remove(self);
 }
index 7d5a787d0061d914ca9159d1ebe6a42108057690..393563f18b51a0aced50c1734498493273d027f8 100644 (file)
@@ -3,20 +3,20 @@
 #ifdef VEHICLES_ENABLED
 
 .float vehicle_flags;
-float VHF_ISVEHICLE     = 2;    /// Indicates vehicle
-float VHF_HASSHIELD     = 4;    /// Vehicle has shileding
-float VHF_SHIELDREGEN   = 8;    /// Vehicles shield regenerates
-float VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
-float VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
-float VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
-float VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
-float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound
-float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
-float VHF_DMGSHAKE      = 1024; /// Add random velocity each frame if health < 50%
-float VHF_DMGROLL       = 2048; /// Add random angles each frame if health < 50%
-float VHF_DMGHEADROLL   = 4096; /// Add random head angles each frame if health < 50%
-float VHF_MULTISLOT     = 8192; /// Vehicle has multiple player slots
-float VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a multi-person vehicle
+const float VHF_ISVEHICLE     = 2;    /// Indicates vehicle
+const float VHF_HASSHIELD     = 4;    /// Vehicle has shileding
+const float VHF_SHIELDREGEN   = 8;    /// Vehicles shield regenerates
+const float VHF_HEALTHREGEN   = 16;   /// Vehicles health regenerates
+const float VHF_ENERGYREGEN   = 32;   /// Vehicles energy regenerates
+const float VHF_DEATHEJECT    = 64;   /// Vehicle ejects pilot upon fatal damage
+const float VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
+const float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound
+const float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
+const float VHF_DMGSHAKE      = 1024; /// Add random velocity each frame if health < 50%
+const float VHF_DMGROLL       = 2048; /// Add random angles each frame if health < 50%
+const float VHF_DMGHEADROLL   = 4096; /// Add random head angles each frame if health < 50%
+const float VHF_MULTISLOT     = 8192; /// Vehicle has multiple player slots
+const float VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a multi-person vehicle
 
 .entity gun1;
 .entity gun2;
@@ -49,13 +49,13 @@ float VHF_PLAYERSLOT    = 16384;    /// This ent is a player slot on a multi-per
 
 void vehicles_exit(float eject);
 .void(float exit_flags) vehicle_exit;
-float VHEF_NORMAL = 0;  /// User pressed exit key
-float VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
-float VHEF_RELESE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
+const float VHEF_NORMAL = 0;  /// User pressed exit key
+const float VHEF_EJECT  = 1;  /// User pressed exit key 3 times fast (not implemented) or vehile is dying
+const float VHEF_RELESE = 2;  /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
 
-float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
-float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
-float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
+const float SVC_SETVIEWPORT   = 5;   // Net.Protocol 0x05
+const float SVC_SETVIEWANGLES = 10;  // Net.Protocol 0x0A
+const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
 
 .void() vehicle_enter;  /// Vehicles custom funciton to be executed when owner exit it
 .void() vehicle_die;    /// Vehicles custom function to be executed when vehile die
index a2de5dab04be64621a6742d0c024ac05aa69e79f..2eca8c2cbbd03e64eaede7854ca99b2b7ad67b75 100644 (file)
@@ -6,7 +6,7 @@ void W_GiveWeapon (entity e, float wep)
        if (!wep)
                return;
 
-       WEPSET_OR_EW(e, wep);
+       e.weapons |= WepSet_FromWeapon(wep);
 
        oldself = self;
        self = e;
@@ -117,7 +117,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 
                        if(!pseudoprojectile)
                                pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
-                       soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTN_NONE);
+                       soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, snd, VOL_BASE * f, ATTEN_NONE);
                }
 
                if(pseudoprojectile)
@@ -219,7 +219,7 @@ void W_BallisticBullet_LeaveSolid_think()
        self.nextthink = max(time, self.W_BallisticBullet_LeaveSolid_nextthink_save);
        self.W_BallisticBullet_LeaveSolid_think_save = func_null;
 
-       self.flags &~= FL_ONGROUND;
+       self.flags &= ~FL_ONGROUND;
 
        if(self.enemy.solid == SOLID_BSP)
        {
index 320d84b3cc50ecbf85579b5c937e1bc119c3fc3e..b24be5fc56bebd5f9d57421f4c92799f1500f4cc 100644 (file)
@@ -707,13 +707,13 @@ float w_crylink(float req)
                {
                        pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
                        if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTEN_NORM);
                }
                else
                {
                        pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
                        if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTEN_NORM);
                }
        }
        else if(req == WR_PRECACHE)
index 649e72374ecc3754ffb6f29b84075854212739e2..40fa490f8498b97494b58d0efc4df1cf56ab2744 100644 (file)
@@ -78,7 +78,7 @@ void W_Plasma_Touch (void)
                W_Plasma_Explode ();
        } else {
                //UpdateCSQCProjectile(self);
-               spamsound (self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTN_NORM);
+               spamsound (self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTEN_NORM);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
        }
 }
@@ -337,7 +337,7 @@ void W_Electro_Attack3 (void)
 {
        // only play fire sound if 0.5 sec has passed since player let go the fire button
        if(time - self.prevlgfire > 0.5)
-               sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTN_NORM);
+               sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTEN_NORM);
 
        entity beam, oldself;
 
@@ -588,7 +588,7 @@ float w_electro(float req)
                {
                        pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
                        if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
                }
                else
                {
@@ -597,13 +597,13 @@ float w_electro(float req)
                                // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
                                pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTEN_NORM);
                        }
                        else
                        {
                                pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
                        }
                }
        }
index 7bccac949414513b6f2aa50cb21ab896fdb3bdc2..78ee3009cee1e784e8c7ceb199635230a213701f 100644 (file)
@@ -210,7 +210,7 @@ void W_Fireball_Attack1_Frame1()
 void W_Fireball_Attack1_Frame0()
 {
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
-       sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame1);
 }
 
@@ -420,7 +420,7 @@ float w_fireball(float req)
                        org2 = w_org + w_backoff * 16;
                        pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
                        if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+                               sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom
                }
        }
        else if(req == WR_PRECACHE)
index 826740dbf3f80c51cc1c8f684675ae4ce7870273..6312de2fd8bddcf644d3cfbc291323f38420a41d 100644 (file)
@@ -95,23 +95,23 @@ void W_Grenade_Touch1 (void)
                float r;
                r = random() * 6;
                if(r < 1)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 2)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 3)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 4)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 5)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTEN_NORM);
                else
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
        }
        else if(autocvar_g_balance_grenadelauncher_primary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+               spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTEN_NORM);
 
                // let it stick whereever it is
                self.oldvelocity = self.velocity;
@@ -139,17 +139,17 @@ void W_Grenade_Touch2 (void)
                float r;
                r = random() * 6;
                if(r < 1)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 2)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 3)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 4)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTEN_NORM);
                else if(r < 5)
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTEN_NORM);
                else
-                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTEN_NORM);
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
                
@@ -159,7 +159,7 @@ void W_Grenade_Touch2 (void)
        }
        else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
-               spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+               spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTEN_NORM);
 
                // let it stick whereever it is
                self.oldvelocity = self.velocity;
@@ -331,7 +331,7 @@ float w_glauncher(float req)
                                        }
                                }
                                if(nadefound)
-                                       sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+                                       sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTEN_NORM);
                        }
                        else if (weapon_prepareattack(1, autocvar_g_balance_grenadelauncher_secondary_refire))
                        {
@@ -402,7 +402,7 @@ float w_glauncher(float req)
                org2 = w_org + w_backoff * 12;
                pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index 0be6ea527e4e20f125eed0586c54b094e092b8db..811038b1427a9510769b133dd9ac689238c2398b 100644 (file)
@@ -269,7 +269,7 @@ void W_Hagar_Attack2_Load (void)
                                self.weaponentity.state = WS_READY;
                                W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
                                self.hagar_load = 0;
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
 
                                // pause until we can load rockets again, once we re-press the alt fire button
                                self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed * W_WeaponRateFactor();
@@ -288,7 +288,7 @@ void W_Hagar_Attack2_Load (void)
                                        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
                                        self.weaponentity.state = WS_INUSE;
                                        self.hagar_load += 1;
-                                       sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
+                                       sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTEN_NORM); // sound is too loud according to most
 
                                        if (self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max)
                                                self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_hold * W_WeaponRateFactor();
@@ -299,7 +299,7 @@ void W_Hagar_Attack2_Load (void)
                        else if(!self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
                        {
                                // if this is the last rocket we can load, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
                                self.hagar_loadbeep = TRUE;
                        }
                }
@@ -318,7 +318,7 @@ void W_Hagar_Attack2_Load (void)
                        if(!self.hagar_warning && self.hagar_load) // prevents the beep from playing each frame
                        {
                                // we're about to automatically release after holding time, play a beep sound to notify the player
-                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTEN_NORM);
                                self.hagar_warning = TRUE;
                        }
                }
@@ -470,11 +470,11 @@ float w_hagar(float req)
                if(!w_issilent)
                {
                        if (w_random<0.15)
-                               sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTEN_NORM);
                        else if (w_random<0.7)
-                               sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTEN_NORM);
                        else
-                               sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTEN_NORM);
                }
        }
        else if(req == WR_PRECACHE)
index 618a21ffe8e35c6bea70f3c4bc67de25632186df..5959965a6c3414ed1e97b5877a20b342ac3346a5 100644 (file)
@@ -249,7 +249,7 @@ float w_hlac(float req)
                org2 = w_org + w_backoff * 6;
                pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index 998f0723b63219731bfeee6b71880e36acb786fc..923083387faf12a0ce8846a8ebf33256ddd05d4c 100644 (file)
@@ -221,16 +221,16 @@ float w_hook(float req)
 
                if (self.BUTTON_CROUCH)
                {
-                       self.hook_state &~= HOOK_PULLING;
+                       self.hook_state &= ~HOOK_PULLING;
                        if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
-                               self.hook_state &~= HOOK_RELEASING;
+                               self.hook_state &= ~HOOK_RELEASING;
                        else
                                self.hook_state |= HOOK_RELEASING;
                }
                else
                {
                        self.hook_state |= HOOK_PULLING;
-                       self.hook_state &~= HOOK_RELEASING;
+                       self.hook_state &= ~HOOK_RELEASING;
 
                        if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
                        {
@@ -241,7 +241,7 @@ float w_hook(float req)
                        else
                        {
                                self.hook_state |= HOOK_REMOVING;
-                               self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+                               self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
                        }
                }
        }
@@ -258,7 +258,7 @@ float w_hook(float req)
        {
                weapon_setup(WEP_HOOK);
                self.current_ammo = ammo_fuel;
-               self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
+               self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
        }
        else if (req == WR_CHECKAMMO1)
        {
@@ -295,7 +295,7 @@ float w_hook(float req)
                org2 = w_org + w_backoff * 2;
                pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index d68240c56cc18130107c28b3c71a7c80ba7a7ebd..ac8cbf1c1d6e38d7b7d543d8b074edd40c1adf23 100644 (file)
@@ -178,7 +178,7 @@ void W_Laser_Attack2 ()
        // only play fire sound if 0.5 sec has passed since player let go the fire button
        if(time - self.prevgauntletfire > 0.5)
        {
-               sound (self, CH_WEAPON_A, "weapons/gauntlet_fire.wav", VOL_BASE, ATTN_NORM);
+               sound (self, CH_WEAPON_A, "weapons/gauntlet_fire.wav", VOL_BASE, ATTEN_NORM);
        }
 
        entity beam, oldself;
@@ -310,7 +310,7 @@ float w_laser(float req)
                org2 = w_org + w_backoff * 6;
                pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index 2cc464df6d704fac8ac91836eb42739322d431c3..1557e9e5ee4e9ef7d1607c2595ac48fff24a6070 100644 (file)
@@ -24,7 +24,7 @@ void spawnfunc_weapon_minelayer (void)
 
 void W_Mine_Stick (entity to)
 {
-       spamsound (self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTN_NORM);
+       spamsound (self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTEN_NORM);
 
        // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
 
@@ -188,7 +188,7 @@ void W_Mine_Think (void)
        if ((time > self.cnt) && (!self.mine_time))
        {
                if(autocvar_g_balance_minelayer_lifetime_countdown > 0)
-                       spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTEN_NORM);
                self.mine_time = time + autocvar_g_balance_minelayer_lifetime_countdown;
                self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
        }
@@ -211,7 +211,7 @@ void W_Mine_Think (void)
                if(head != self.realowner && IsDifferentTeam(head, self.realowner)) // don't trigger for team mates
                if(!self.mine_time)
                {
-                       spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+                       spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTEN_NORM);
                        self.mine_time = time + autocvar_g_balance_minelayer_time;
                }
                head = head.chain;
@@ -485,7 +485,7 @@ float w_minelayer(float req)
                if (self.BUTTON_ATCK2)
                {
                        if(W_PlacedMines(TRUE))
-                               sound (self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
+                               sound (self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTEN_NORM);
                }
        }
        else if (req == WR_PRECACHE)
@@ -551,7 +551,7 @@ float w_minelayer(float req)
                org2 = w_org + w_backoff * 12;
                pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index 4f231a2cb46f5e221db2dfcc89090ed4c5c87c33..1bd4e11bd40b130c1db373ce141f2b1255e9f499 100644 (file)
@@ -201,7 +201,7 @@ float w_minstanex(float req)
                org2 = w_org + w_backoff * 6;
                pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index dc3c30ff6123692543bb051949741febc5ed8804..5ab21e2eae01edd38cb1cd16d9f100f90cb816dc 100644 (file)
@@ -69,7 +69,7 @@ void W_Nex_Attack (float issecondary)
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
        if(charge > autocvar_g_balance_nex_charge_animlimit && autocvar_g_balance_nex_charge_animlimit) // if the Nex is overcharged, we play an extra sound
        {
-               sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM);
+               sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTEN_NORM);
        }
 
        yoda = 0;
@@ -263,7 +263,7 @@ float w_nex(float req)
                org2 = w_org + w_backoff * 6;
                pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index fad480d012ec58623f4f07e8a19b22a3d0b9e518..1eb0f4b0bc80d528b2572f2bfc97a76c18271e3d 100644 (file)
@@ -46,7 +46,7 @@ void W_Porto_Fail (float failhard)
 
        self.realowner.porto_current = world;
 
-       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !WEPSET_CONTAINS_EW(self.realowner, WEP_PORTO))
+       if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !(self.realowner.weapons & WEPSET_PORTO))
        {
                setsize (self, '-16 -16 0', '16 16 32');
                setorigin(self, self.origin + trace_plane_normal);
@@ -110,19 +110,19 @@ void W_Porto_Touch (void)
 
        if(self.realowner.playerid != self.playerid)
        {
-               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                remove(self);
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
        {
-               spamsound(self, CH_SHOTS, "porto/bounce.wav", VOL_BASE, ATTN_NORM);
+               spamsound(self, CH_SHOTS, "porto/bounce.wav", VOL_BASE, ATTEN_NORM);
                // just reflect
                self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * trace_plane_normal);
                self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * trace_plane_normal));
        }
        else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        {
-               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                W_Porto_Fail(0);
                if(self.cnt < 0)
                        Portal_ClearAll_PortalsOnly(self.realowner);
@@ -132,14 +132,14 @@ void W_Porto_Touch (void)
                // in-portal only
                if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
                {
-                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        centerprint(self.realowner, "^1In^7-portal created.");
                        W_Porto_Success();
                }
                else
                {
-                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        W_Porto_Fail(0);
                }
@@ -149,14 +149,14 @@ void W_Porto_Touch (void)
                // out-portal only
                if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
                {
-                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        centerprint(self.realowner, "^4Out^7-portal created.");
                        W_Porto_Success();
                }
                else
                {
-                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        W_Porto_Fail(0);
                }
@@ -166,7 +166,7 @@ void W_Porto_Touch (void)
                self.effects += EF_BLUE - EF_RED;
                if(Portal_SpawnInPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
                {
-                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        centerprint(self.realowner, "^1In^7-portal created.");
                        self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm);
@@ -175,7 +175,7 @@ void W_Porto_Touch (void)
                }
                else
                {
-                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
                        Portal_ClearAll_PortalsOnly(self.realowner);
                        W_Porto_Fail(0);
@@ -187,21 +187,21 @@ void W_Porto_Touch (void)
                {
                        if(Portal_SpawnOutPortalAtTrace(self.realowner, self.right_vector, self.portal_id))
                        {
-                               sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                                trace_plane_normal = norm;
                                centerprint(self.realowner, "^4Out^7-portal created.");
                                W_Porto_Success();
                        }
                        else
                        {
-                               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                                Portal_ClearAll_PortalsOnly(self.realowner);
                                W_Porto_Fail(0);
                        }
                }
                else
                {
-                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "porto/unsupported.wav", VOL_BASE, ATTEN_NORM);
                        Portal_ClearAll_PortalsOnly(self.realowner);
                        W_Porto_Fail(0);
                }
index 8ed4491d7d6b921efbe9392d77ae3ed9aec6a432..c1ed230cf9cef0b31b22186dc9dfe3ea04faa992 100644 (file)
@@ -245,11 +245,11 @@ float w_rifle(float req)
                if(!w_issilent)
                {
                        if(w_random < 0.2)
-                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.4)
-                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.5)
-                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
                }
        }
        else if(req == WR_PRECACHE)
index 55b3379fc8aedd3d69335f428eec0256bcd2b4df..6700e26d20c0d5c43e6bab112b27d7c4933f9513 100644 (file)
@@ -178,7 +178,7 @@ void W_Rocket_Think (void)
                        {
                                pointparticles(particleeffectnum("rocket_guide"), self.origin, self.velocity, 1);
                                // TODO add a better sound here
-                               sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM);
+                               sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTEN_NORM);
                                self.count = 1;
                        }
                }
@@ -409,7 +409,7 @@ float w_rlauncher(float req)
                                        }
                                }
                                if(rockfound)
-                                       sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+                                       sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTEN_NORM);
                        }
                }
        }
@@ -479,7 +479,7 @@ float w_rlauncher(float req)
                org2 = w_org + w_backoff * 12;
                pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index 61d72708c2f9b8935c4e7c172ac53ce04fbb3111..ba580e702ee5e6348c1e1c9ec9c227dcfbbd53d6 100644 (file)
@@ -666,7 +666,7 @@ float w_seeker(float req)
                        if(w_deathtype & HITTYPE_SECONDARY)
                        {
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTEN_NORM);
                        }
                        else
                        {
@@ -674,11 +674,11 @@ float w_seeker(float req)
                                if(!w_issilent)
                                {
                                        if (w_random<0.15)
-                                               sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
                                        else if (w_random<0.7)
-                                               sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTEN_NORM);
                                        else
-                                               sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTEN_NORM);
                                }
                        }
                }
@@ -688,11 +688,11 @@ float w_seeker(float req)
                        if(!w_issilent)
                        {
                                if (w_random<0.15)
-                                       sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTEN_NORM);
                                else if (w_random<0.7)
-                                       sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTEN_NORM);
                                else
-                                       sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+                                       sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM);
                        }
                }
        }
index 6c6658d931dc7431ca06380e0cd936feedd2a464..b26fca2b7a16944fadc7dc47a6788998d5c6da3e 100644 (file)
@@ -156,7 +156,7 @@ void shotgun_meleethink (void)
 
 void W_Shotgun_Attack2 (void)
 {
-       sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
 
        entity meleetemp;
@@ -274,11 +274,11 @@ float w_shotgun(float req)
                if(!w_issilent && time - self.prevric > 0.25)
                {
                        if(w_random < 0.0165)
-                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.033)
-                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.05)
-                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
                        self.prevric = time;
                }
        }
index 38793a96f2c22bef6d459982fd6613c4a8e1ca0b..b3852b8e876cd8cfa8f9be8022bc6d8ccd149d43 100644 (file)
@@ -323,11 +323,11 @@ float w_uzi(float req)
                pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
                if(!w_issilent)
                        if(w_random < 0.05)
-                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.1)
-                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
                        else if(w_random < 0.2)
-                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
index d58985312200f4754fefc2bf0d984cea063ed8dc..a5817fa502addef565a946eaaa55a7bd544f60ff 100644 (file)
@@ -253,7 +253,7 @@ float WaypointSprite_SendEntity(entity to, float sendflags)
        sendflags = sendflags & 0x7F;
        
        if(g_nexball)
-               sendflags &~= 0x80;
+               sendflags &= ~0x80;
        else if(self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25)))
                sendflags |= 0x80;
 
index c2a6e8a89fdfdb1d38e962cc49690f586fb40cb7..386615247ad9e55db4393b8aa8bb87ee4c0e79e2 100644 (file)
@@ -469,7 +469,6 @@ void WarpZone_TrailParticles_WithMultiplier_trace_callback(vector from, vector e
        boxparticles(WarpZone_TrailParticles_trace_callback_eff, WarpZone_TrailParticles_trace_callback_own, from, endpos, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_own.velocity, WarpZone_TrailParticles_trace_callback_f, WarpZone_TrailParticles_trace_callback_flags);
 }
 
-float PARTICLES_DRAWASTRAIL = 128;
 void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, vector end, float f, float boxflags)
 {
        WarpZone_TrailParticles_trace_callback_own = own;