if(nPrimary == K_MOUSE2) mouseClicked |= S_MOUSE2;
}
else {
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- if(nPrimary == K_MOUSE1) mouseClicked -= (mouseClicked & S_MOUSE1);
- if(nPrimary == K_MOUSE2) mouseClicked -= (mouseClicked & S_MOUSE2);
+ if(nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
+ if(nPrimary == K_MOUSE1) mouseClicked &= ~S_MOUSE1;
+ if(nPrimary == K_MOUSE2) mouseClicked &= ~S_MOUSE2;
}
if(nPrimary == K_CTRL)
}
else
{
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- if(nPrimary == K_MOUSE1) mouseClicked -= (mouseClicked & S_MOUSE1);
- if(nPrimary == K_MOUSE2) mouseClicked -= (mouseClicked & S_MOUSE2);
+ if(nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
+ if(nPrimary == K_MOUSE1) mouseClicked &= ~S_MOUSE1;
+ if(nPrimary == K_MOUSE2) mouseClicked &= ~S_MOUSE2;
}
if(nPrimary == K_ESCAPE && key_pressed)
if(key_pressed)
mouseClicked |= S_MOUSE1;
else
- mouseClicked -= (mouseClicked & S_MOUSE1);
+ mouseClicked &= ~S_MOUSE1;
}
else if(nPrimary == K_MOUSE2)
{
if(key_pressed)
mouseClicked |= S_MOUSE2;
else
- mouseClicked -= (mouseClicked & S_MOUSE2);
+ mouseClicked &= ~S_MOUSE2;
}
else if (nPrimary == K_ESCAPE && key_pressed)
{
if(nPrimary == K_TAB) hudShiftState |= S_TAB;
}
else {
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- if(nPrimary == K_TAB) hudShiftState -= (hudShiftState & S_TAB);
+ if(nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
+ if(nPrimary == K_TAB) hudShiftState &= ~S_TAB;
}
if(nPrimary == K_TAB)
}
else // alternatively calculate wishdir by querying pressed keys
{
- if((keys & KEY_FORWARD) || (keys & KEY_BACKWARD))
+ if(keys & (KEY_FORWARD | KEY_BACKWARD))
wishangle = 45;
else
wishangle = 90;
{
int j = 0;
FOREACH(Weapons, it != WEP_Null && it.impulse >= 0 && (it.impulse % 3 != 0) && j < 6, {
- if (!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_SPECIALATTACK))
+ if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)))
{
if (!panel_switchweapon || j < 4)
panel_switchweapon = it;
ItemSetModel(this, wantsimple);
// no bobbing applied to simple items, for consistency's sake (no visual difference between ammo and weapons)
- bool animate = (autocvar_cl_items_animate & 1) && this.item_simple <= 0 && ((this.ItemStatus & ITS_ANIMATE1) || (this.ItemStatus & ITS_ANIMATE2));
+ bool animate = (autocvar_cl_items_animate & 1) && this.item_simple <= 0 && (this.ItemStatus & (ITS_ANIMATE1 | ITS_ANIMATE2));
// rotation must be set before running physics
if(!animate)
}
}
- if(sf & ISF_SIZE || sf & ISF_SIZE2) // always true when it's spawned (in CSQC's perspective)
+ if(sf & (ISF_SIZE | ISF_SIZE2)) // always true when it's spawned (in CSQC's perspective)
{
if(isnew)
{
SET_ONGROUND(this); // extra overkill
}
- if(sf & ISF_REMOVEFX && !(sf & ISF_SIZE) && !(sf & ISF_SIZE2)) // TODO !isnew isn't reliable for this... are we double sending initialisations?
+ if(sf & ISF_REMOVEFX && !(sf & (ISF_SIZE | ISF_SIZE2))) // TODO !isnew isn't reliable for this... are we double sending initialisations?
{
// no longer available to pick up, about to be removed
if (this.drawmask) // this.alpha > 0
if(nPrimary == K_TAB) hudShiftState |= S_TAB;
}
else {
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- if(nPrimary == K_TAB) hudShiftState -= (hudShiftState & S_TAB);
+ if(nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
+ if(nPrimary == K_TAB) hudShiftState &= ~S_TAB;
}
// NOTE: Shift-Escape must be filtered out because it's the hardcoded console shortcut
int sf = ReadShort();
int lf = ReadShort();
FOREACH(Scores, true, {
- int p = 1 << (i % 16);
+ int p = BIT(i % 16);
if (sf & p)
{
if (lf & p)
}
else
{
- if (nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if (nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if (nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+ if (nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if (nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if (nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
if (nPrimary == K_CTRL)
first_digit = 0;
FOREACH(Monsters, it != MON_Null,
{
- if((it.spawnflags & MON_FLAG_HIDDEN) || (it.spawnflags & MONSTER_TYPE_PASSIVE) || (it.spawnflags & MONSTER_TYPE_FLY) || (it.spawnflags & MONSTER_TYPE_SWIM)
- || (it.spawnflags & MONSTER_SIZE_QUAKE) || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
+ if((it.spawnflags & (MON_FLAG_HIDDEN | MONSTER_TYPE_PASSIVE | MONSTER_TYPE_FLY | MONSTER_TYPE_SWIM | MONSTER_SIZE_QUAKE))
+ || ((it.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
continue;
if(autocvar_g_invasion_zombies_only && !(it.spawnflags & MONSTER_TYPE_UNDEAD))
continue;
if(nPrimary == K_MOUSE2) mouseClicked |= S_MOUSE2;
}
else {
- if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
- if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
- if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
- if(nPrimary == K_MOUSE1) mouseClicked -= (mouseClicked & S_MOUSE1);
- if(nPrimary == K_MOUSE2) mouseClicked -= (mouseClicked & S_MOUSE2);
+ if(nPrimary == K_ALT) hudShiftState &= ~S_ALT;
+ if(nPrimary == K_CTRL) hudShiftState &= ~S_CTRL;
+ if(nPrimary == K_SHIFT) hudShiftState &= ~S_SHIFT;
+ if(nPrimary == K_MOUSE1) mouseClicked &= ~S_MOUSE1;
+ if(nPrimary == K_MOUSE2) mouseClicked &= ~S_MOUSE2;
}
// allow some binds
}
}
- if ( (active_minigame.minigame_flags & BD_TURN_LOSS) || (active_minigame.minigame_flags & BD_TURN_WIN) )
+ if(active_minigame.minigame_flags & (BD_TURN_LOSS | BD_TURN_WIN))
{
vector winfs = hud_fontsize*2;
string victory_text = _("Game over!");
{
bool event_blocked = ((event == "key_released")
|| !(minigame.minigame_flags & BD_TURN_MOVE) || (minigame_self.team == BD_SPECTATOR_TEAM));
- if (!(minigame.minigame_flags & BD_TURN_WIN) && !(minigame.minigame_flags & BD_TURN_LOSS))
+ if (!(minigame.minigame_flags & (BD_TURN_WIN | BD_TURN_LOSS)))
{
switch ( ...(0,int) )
{
{
bool event_blocked = ((event == "key_released")
|| ((minigame.minigame_flags & C4_TURN_TEAM) != minigame_self.team));
- if (!(minigame.minigame_flags & C4_TURN_WIN) && !(minigame.minigame_flags & C4_TURN_DRAW))
+ if (!(minigame.minigame_flags & (C4_TURN_WIN | C4_TURN_DRAW)))
{
switch ( ...(0,int) )
{
{
bool event_blocked = ((event == "key_released")
|| ((minigame.minigame_flags & PP_TURN_TEAM) != minigame_self.team));
- if (!(minigame.minigame_flags & PP_TURN_WIN) && !(minigame.minigame_flags & PP_TURN_DRAW))
+ if (!(minigame.minigame_flags & (PP_TURN_WIN | PP_TURN_DRAW)))
{
switch ( ...(0,int) )
{
tile_size * 0.8, '0.5 0.5 0.5', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- if ( ( active_minigame.minigame_flags & PS_TURN_WIN ) || ( active_minigame.minigame_flags & PS_TURN_DRAW ) )
+ if(active_minigame.minigame_flags & (PS_TURN_WIN | PS_TURN_DRAW))
{
int remaining = 0;
FOREACH_MINIGAME_ENTITY(e)
case "key_released":
{
bool event_blocked = (event == "key_released" || minigame_self.team == PS_SPECTATOR_TEAM);
- if (!(minigame.minigame_flags & PS_TURN_WIN) && !(minigame.minigame_flags & PS_TURN_DRAW))
+ if (!(minigame.minigame_flags & (PS_TURN_WIN | PS_TURN_DRAW)))
{
switch ( ...(0,int) )
{
{
bool event_blocked = ((event == "key_released")
|| ((minigame.minigame_flags & TTT_TURN_TEAM) != minigame_self.team));
- if (!(minigame.minigame_flags & TTT_TURN_WIN) && !(minigame.minigame_flags & TTT_TURN_DRAW))
+ if (!(minigame.minigame_flags & (TTT_TURN_WIN | TTT_TURN_DRAW)))
{
switch ( ...(0,int) )
{
{
float s;
- if((this.flags & FL_FLY) || (this.flags & FL_SWIM))
+ if(this.flags & (FL_FLY | FL_SWIM))
{
// Look ahead
traceline(this.origin + this.view_ofs, dst_ahead, true, NULL);
Monster_Sound(this, monstersound_death, 0, false, CH_VOICE);
- if(!(this.spawnflags & MONSTERFLAG_SPAWNED) && !(this.spawnflags & MONSTERFLAG_RESPAWNED))
+ if(!(this.spawnflags & (MONSTERFLAG_SPAWNED | MONSTERFLAG_RESPAWNED)))
monsters_killed += 1;
if(IS_PLAYER(attacker))
- if(autocvar_g_monsters_score_spawned || !((this.spawnflags & MONSTERFLAG_SPAWNED) || (this.spawnflags & MONSTERFLAG_RESPAWNED)))
+ if(autocvar_g_monsters_score_spawned || !(this.spawnflags & (MONSTERFLAG_SPAWNED | MONSTERFLAG_RESPAWNED)))
GameRules_scoring_add(attacker, SCORE, +autocvar_g_monsters_score_kill);
if(gibbed)
this.monster_face = '0 0 0';
this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
- if(!this.noalign) { this.noalign = ((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM)); }
+ if(!this.noalign) { this.noalign = (mon.spawnflags & (MONSTER_TYPE_FLY | MONSTER_TYPE_SWIM)); }
if(!this.scale) { this.scale = 1; }
if(autocvar_g_monsters_edit) { this.grab = 1; }
if(autocvar_g_fullbrightplayers) { this.effects |= EF_FULLBRIGHT; }
float autocvar_g_buffs_luck_damagemultiplier = 3;
// ammo
-.float buff_ammo_prev_infitems;
+.int buff_ammo_prev_infitems;
.int buff_ammo_prev_clipload;
// flight
.float buff_flight_oldgravity;
METHOD(OverkillRocketPropelledChainsaw, wr_suicidemessage, Notification(entity thiswep))
{
- if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
+ if(w_deathtype & (HITTYPE_BOUNCE | HITTYPE_SPLASH))
return WEAPON_OVERKILL_RPC_SUICIDE_SPLASH;
else
return WEAPON_OVERKILL_RPC_SUICIDE_DIRECT;
METHOD(OverkillRocketPropelledChainsaw, wr_killmessage, Notification(entity thiswep))
{
- if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
+ if(w_deathtype & (HITTYPE_BOUNCE | HITTYPE_SPLASH))
return WEAPON_OVERKILL_RPC_MURDER_SPLASH;
else
return WEAPON_OVERKILL_RPC_MURDER_DIRECT;
#define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
#define _ISLOCAL(ent) ((edict_num(1) == (ent)) ? true : false)
-const float ASF_STRENGTH = BIT(0);
-const float ASF_SHIELD = BIT(1);
-const float ASF_MEGA_AR = BIT(2);
-const float ASF_MEGA_HP = BIT(3);
-const float ASF_FLAG_GRAB = BIT(4);
-const float ASF_OBSERVER_ONLY = BIT(5);
-const float ASF_SHOWWHAT = BIT(6);
-const float ASF_SSIM = BIT(7);
-const float ASF_FOLLOWKILLER = BIT(8);
-const float ASF_ALL = 0xFFFFFF;
-.float autospec_flags;
-
-const float SSF_SILENT = 1;
-const float SSF_VERBOSE = 2;
-const float SSF_ITEMMSG = 4;
-.float superspec_flags;
+const int ASF_STRENGTH = BIT(0);
+const int ASF_SHIELD = BIT(1);
+const int ASF_MEGA_AR = BIT(2);
+const int ASF_MEGA_HP = BIT(3);
+const int ASF_FLAG_GRAB = BIT(4);
+const int ASF_OBSERVER_ONLY = BIT(5);
+const int ASF_SHOWWHAT = BIT(6);
+const int ASF_SSIM = BIT(7);
+const int ASF_FOLLOWKILLER = BIT(8);
+const int ASF_ALL = 0xFFFFFF;
+.int autospec_flags;
+
+const int SSF_SILENT = BIT(0);
+const int SSF_VERBOSE = BIT(1);
+const int SSF_ITEMMSG = BIT(2);
+.int superspec_flags;
.string superspec_itemfilter; //"classname1 classname2 ..."
{
fputs(fh, _SSMAGIX);
fputs(fh, "\n");
- fputs(fh, ftos(this.autospec_flags));
+ fputs(fh, itos(this.autospec_flags));
fputs(fh, "\n");
- fputs(fh, ftos(this.superspec_flags));
+ fputs(fh, itos(this.superspec_flags));
fputs(fh, "\n");
fputs(fh, this.superspec_itemfilter);
fputs(fh, "\n");
}
else
{
- player.autospec_flags = stof(fgets(fh));
- player.superspec_flags = stof(fgets(fh));
+ player.autospec_flags = stoi(fgets(fh));
+ player.superspec_flags = stoi(fgets(fh));
player.superspec_itemfilter = strzone(fgets(fh));
}
fclose(fh);
.float gravity;
.float swamp_slowdown;
-.float lastflags;
+.int lastflags;
.float lastground;
.bool wasFlying;
{
if ( random() < actor.(weaponentity).arc_heat_percent )
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
- if ( (fire & 1) || (fire & 2) )
+ if ( fire & (1 | 2) )
{
Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
if ( !actor.arc_smoke_sound )
}
if (actor.(weaponentity).tuba_note)
{
- if (!(fire & 1) && !(fire & 2))
+ if (!(fire & (1 | 2)))
{
W_Tuba_NoteOff(actor.(weaponentity).tuba_note);
}
#pragma once
+#include "bits.qh"
#include "iter.qh"
#include "test.qh"
prevfld = il_links_flds[flds_idx + 1];
this.il_id = id;
int bit = IL_FLOOR(id / IL_LISTS_PER_BIT);
- if (bit < (1 * 24)) this.il_listmask = '1 0 0' * (1 << (bit - (0 * 24)));
- else if (bit < (2 * 24)) this.il_listmask = '0 1 0' * (1 << (bit - (1 * 24)));
- else if (bit < (3 * 24)) this.il_listmask = '0 0 1' * (1 << (bit - (2 * 24)));
+ if (bit < (1 * 24)) this.il_listmask = '1 0 0' * BIT(bit - (0 * 24));
+ else if (bit < (2 * 24)) this.il_listmask = '0 1 0' * BIT(bit - (1 * 24));
+ else if (bit < (3 * 24)) this.il_listmask = '0 0 1' * BIT(bit - (2 * 24));
else assert(false);
il_links_ptr = id + 1;
if (il_links_ptr >= IL_MAX) il_links_ptr -= IL_MAX;
entity WarpZone_RefSys_SpawnSameRefSys(entity me); // spawn().R = me.R
#ifndef BITCLR
-# define BITCLR(a,b) ((a) - ((a) & (b)))
+# define BITCLR(a,b) ((a) & ~(b))
#endif
#ifndef BITSET
# define BITSET(a,b) ((a) | (b))
#endif
#ifndef BITXOR
-# define BITXOR(a,b) (((a) | (b)) - ((a) & (b)))
+# define BITXOR(a,b) (((a) ^ (b))
#endif
#ifndef BITCLR_ASSIGN
-# define BITCLR_ASSIGN(a,b) ((a) = (a) - ((a) & (b)))
+# define BITCLR_ASSIGN(a,b) ((a) &= ~(b))
#endif
#ifndef BITSET_ASSIGN
# define BITSET_ASSIGN(a,b) ((a) |= (b))
#endif
#ifndef BITXOR_ASSIGN
-# define BITXOR_ASSIGN(a,b) ((a) = ((a) | (b)) - ((a) & (b)))
+# define BITXOR_ASSIGN(a,b) ((a) ^= (b))
#endif
int WarpZoneLib_MoveOutOfSolid(entity e);
#define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
if (trace_fraction == 1 && !this.jumppadcount
&& !waypoint_is_hardwiredlink(this.goalcurrent_prev, this.goalcurrent)
&& !(this.goalcurrent_prev && (this.goalcurrent_prev.wpflags & WAYPOINTFLAG_JUMP)))
- if ((IS_ONGROUND(this)) || (this.aistatus & AI_STATUS_RUNNING) || (this.aistatus & AI_STATUS_ROAMING) || PHYS_INPUT_BUTTON_JUMP(this))
+ if ((IS_ONGROUND(this)) || (this.aistatus & (AI_STATUS_RUNNING | AI_STATUS_ROAMING)) || PHYS_INPUT_BUTTON_JUMP(this))
{
// Look downwards
traceline(dst_ahead , dst_down, true, NULL);
if (!(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS))
{
StatusEffects_remove(STATUSEFFECT_Superweapons, this, STATUSEFFECT_REMOVE_NORMAL);
- this.items = this.items - (this.items & IT_SUPERWEAPON);
+ this.items &= ~IT_SUPERWEAPON;
//Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
}
play_countdown(this, StatusEffects_gettime(STATUSEFFECT_Superweapons, this), SND_POWEROFF);
if (time >= StatusEffects_gettime(STATUSEFFECT_Superweapons, this))
{
- this.items = this.items - (this.items & IT_SUPERWEAPON);
+ this.items &= ~IT_SUPERWEAPON;
STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
//Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
{
if (time < StatusEffects_gettime(STATUSEFFECT_Superweapons, this) || (this.items & IT_UNLIMITED_SUPERWEAPONS))
{
- this.items = this.items | IT_SUPERWEAPON;
+ this.items |= IT_SUPERWEAPON;
if(!(this.items & IT_UNLIMITED_SUPERWEAPONS))
{
if(!g_cts)
}
if(autocvar_g_nodepthtestplayers)
- this.effects = this.effects | EF_NODEPTHTEST;
+ this.effects |= EF_NODEPTHTEST;
if(autocvar_g_fullbrightplayers)
- this.effects = this.effects | EF_FULLBRIGHT;
+ this.effects |= EF_FULLBRIGHT;
MUTATOR_CALLHOOK(PlayerPowerups, this, items_prev);
}
total_damage_to_creatures = 0;
- if(!(deathtype & HITTYPE_SOUND) && !(deathtype & HITTYPE_SPAM)) // do not send bandwidth-hogging radial spam attacks
+ if(!(deathtype & (HITTYPE_SOUND | HITTYPE_SPAM))) // do not send bandwidth-hogging radial spam attacks
{
force = inflictorvelocity;
if(force == '0 0 0')
const float HOOK_PULLING = BIT(2);
const float HOOK_RELEASING = BIT(3);
const float HOOK_WAITING_FOR_RELEASE = BIT(4);
-.float hook_state;
+.int hook_state;
.int state;
vector hook_shotorigin[4];
if(sf & ISF_STATUS)
WriteByte(MSG_ENTITY, this.ItemStatus);
- if(sf & ISF_SIZE || sf & ISF_SIZE2) // always true when it's spawned (in CSQC's perspective)
+ if(sf & (ISF_SIZE | ISF_SIZE2)) // always true when it's spawned (in CSQC's perspective)
{
WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767));
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_JETPACK_GOT);
}
- int its = (item.items - (item.items & player.items)) & IT_PICKUPMASK;
+ int its = item.items & ~(player.items) & IT_PICKUPMASK;
if (its)
{
pickedup = true;
if(Portal_TeleportPlayer(this, toucher, this.aiment))
if(toucher.classname == "porto")
if(toucher.effects & EF_RED)
- toucher.effects += EF_BLUE - EF_RED;
+ toucher.effects = (toucher.effects & ~EF_RED) | EF_BLUE;
}
void Portal_MakeBrokenPortal(entity portal)
int longflags = 0;
FOREACH(Scores, true, {
- int p = 1 << (i % 16);
+ int p = BIT(i % 16);
if (this.(scores(it)) > 127 || this.(scores(it)) <= -128)
longflags |= p;
});
WriteShort(MSG_ENTITY, sendflags);
WriteShort(MSG_ENTITY, longflags);
FOREACH(Scores, true, {
- int p = 1 << (i % 16);
+ int p = BIT(i % 16);
if (sendflags & p)
{
if(longflags & p)
}
if (b == accuracy_byte(a.accuracy_hit[wepid], a.accuracy_fired[wepid])) return; // no change
- int sf = 1 << (wepid % 24);
+ int sf = BIT(wepid % 24);
a.SendFlags |= sf;
FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, { CS(it).accuracy.SendFlags |= sf; });
}
FOREACH(Weapons, it != WEP_Null, {
if(i != weaponwant)
if(it.impulse == imp || imp < 0)
- if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
+ if((STAT(WEAPONS, this) | weaponsInMap) & it.m_wepset)
have_other = true;
});
FOREACH(Weapons, it != WEP_Null, {
if(i != weaponwant)
if(it.impulse == imp || imp < 0)
- if((STAT(WEAPONS, this) & (it.m_wepset)) || (weaponsInMap & (it.m_wepset)))
+ if((STAT(WEAPONS, this) | weaponsInMap) & it.m_wepset)
have_other = true;
});
int superweapons = 1;
FOREACH(Weapons, it != WEP_Null, {
WepSet set = it.m_wepset;
- if((set & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, own) & set)) ++superweapons;
+ if((WEPSET_SUPERWEAPONS & STAT(WEAPONS, own)) & set) ++superweapons;
});
if(superweapons <= 1)
{