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 3c90dd1..a10ccd2 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 42fadc0..8e36cc9 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 44f8236..55329d4 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 7a4ed92..d335af3 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 70ed9f4..2225c0f 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 1cd7d1f..0016196 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 264f479..b2c98e4 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 bbc8f88..cd7ac7b 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 9e1c6e7..afd61ed 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 11070ba..ab48915 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 5444c8a..d151a53 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 03ea993..49aa033 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 9feb6e8..107b25d 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 49f35d8..0622aaf 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 c6ab654..9f39ffc 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 de45141..b86c234 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 743e4b7..6544c73 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 4fee9fe..a883039 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 1dac05b..8ebe919 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 4bbbf03..f30e77a 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 24deed6..161bfa3 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 a6dbcef..c95185d 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 2066aec..a2ace4f 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 1a70b34..b3dafaa 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 48a269b..e17cd33 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 c961895..1917307 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 ba42d55..4551043 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 7570393..0319ab0 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 10a35ee..db08fdf 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 1ad03e5..ce2842e 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 8a871c6..6353c33 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 1c2c1cc..3912773 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 7fa2f57..3c3c6e3 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 ad612f9..3a4dff7 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 c4882d8..2c7bc2d 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 2711867..46c312f 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 c1626f8..994323c 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 60c135c..1baad7b 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 fb3ddb4..f858afb 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 7694573..65fe815 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 8b2933a..4885f29 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 00e0d31..2ccd843 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 7178628..cfab348 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 78c1969..7339e69 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 e0f4c5b..fd19f28 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 f18658c..6ca9025 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 d0a8f6b..5ba3733 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 739be1b..d16e8bb 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 9e49626..86fdf1c 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 b45f35a..45c7af3 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 6823841..043f833 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 5b889b8..7e23903 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 8071fef..ab53728 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 17b8022..3e0e60f 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 5c60050..9160c11 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 b3b40ce..24d01c7 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 21e1b72..2404885 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 fb7beea..5a75551 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 c87eee4..5c08d7b 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 d7ca62b..d79c074 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 3288bbc..a94ba29 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 a7051ff..b5b6ad7 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 fbe6d7a..c901780 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 34f17a6..2fc2330 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 81a4f5a..f530b54 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 d865176..7fd7078 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 b92d846..706de70 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 c7010df..35d441f 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 cb3c34f..ada2acd 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 74d4345..17b75ae 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 58e737e..8dca538 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 bd4fe2b..61b5add 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 dec6e16..bde5e58 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 b8e0da5..2904c32 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 854b7fe..98429f7 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 43dc25f..20a78b7 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 db2c9a4..90ef516 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 65846f5..359bf84 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 e3b796c..91ddad1 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 530c281..5c7e30e 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 ef05b5a..6a24580 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