Change a bunch of self.items = self.items - (self.items & IT_FOO)

lines to self.items = self.items & ~IT_FOO.  also changed some
self.items = self.items - IT_FOO lines, which were just Really Evil
(tm)
This commit is contained in:
Adam Olsen 2001-08-10 10:03:36 +00:00
parent 9b04da83d1
commit a9cf39a1cc
14 changed files with 56 additions and 57 deletions

View file

@ -112,7 +112,7 @@ void() SetChangeParms =
} }
// remove items // remove items
self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) ); self.items = self.items & ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
// cap super health // cap super health
if (self.health > 100) if (self.health > 100)
@ -205,7 +205,7 @@ void () PrematchBegin =
while (other != world) while (other != world)
{ {
other.is_abouttodie = TRUE; other.is_abouttodie = TRUE;
other.items = other.items - (other.items & IT_INVULNERABILITY); other.items = other.items & ~IT_INVULNERABILITY;
other.invincible_time = 0; other.invincible_time = 0;
other.invincible_finished = 0; other.invincible_finished = 0;
other.effects = other.effects - (other.effects & EF_DIMLIGHT); other.effects = other.effects - (other.effects & EF_DIMLIGHT);
@ -218,7 +218,7 @@ void () PrematchBegin =
while (other != world) while (other != world)
{ {
other.is_abouttodie = TRUE; other.is_abouttodie = TRUE;
other.items = other.items - (other.items & IT_INVULNERABILITY); other.items = other.items & ~IT_INVULNERABILITY;
other.invincible_time = 0; other.invincible_time = 0;
other.invincible_finished = 0; other.invincible_finished = 0;
other.effects = other.effects - (other.effects & EF_DIMLIGHT); other.effects = other.effects - (other.effects & EF_DIMLIGHT);
@ -2036,7 +2036,7 @@ void() PutClientInServer =
//WK Give them invincibility if they are a normal class or bought it //WK Give them invincibility if they are a normal class or bought it
if ((self.playerclass >= PC_SCOUT && self.playerclass <= PC_RANDOM) || if ((self.playerclass >= PC_SCOUT && self.playerclass <= PC_RANDOM) ||
self.tf_items & NIT_RESPAWN_GUARD) { self.tf_items & NIT_RESPAWN_GUARD) {
self.items = self.items + IT_INVULNERABILITY; self.items = self.items & IT_INVULNERABILITY;
self.invincible_time = 1; self.invincible_time = 1;
self.invincible_finished = time + RESPAWN_GUARD_TIME; self.invincible_finished = time + RESPAWN_GUARD_TIME;
if (self.custom_speed > 300) if (self.custom_speed > 300)
@ -2791,7 +2791,7 @@ void() CheckPowerups =
if (self.invisible_finished < time) if (self.invisible_finished < time)
{ // just stopped { // just stopped
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items & ~IT_INVISIBILITY;
self.invisible_finished = 0; self.invisible_finished = 0;
self.invisible_time = 0; self.invisible_time = 0;
} }
@ -2834,7 +2834,7 @@ void() CheckPowerups =
if (self.invincible_finished < time) if (self.invincible_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_INVULNERABILITY; self.items = self.items & ~IT_INVULNERABILITY;
self.invincible_time = 0; self.invincible_time = 0;
self.invincible_finished = 0; self.invincible_finished = 0;
} }
@ -2890,7 +2890,7 @@ void() CheckPowerups =
if (self.super_damage_finished < time) if (self.super_damage_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_QUAD; self.items = self.items & ~IT_QUAD;
self.super_damage_finished = 0; self.super_damage_finished = 0;
self.super_time = 0; self.super_time = 0;
//WK If inspired, remove inspiration //WK If inspired, remove inspiration
@ -2950,7 +2950,7 @@ void() CheckPowerups =
if (self.radsuit_finished < time) if (self.radsuit_finished < time)
{ // just stopped { // just stopped
self.items = self.items - IT_SUIT; self.items = self.items & ~IT_SUIT;
self.rad_time = 0; self.rad_time = 0;
self.radsuit_finished = 0; self.radsuit_finished = 0;
} }
@ -2960,7 +2960,7 @@ void() CheckPowerups =
if (self.aura_time < time) if (self.aura_time < time)
{ {
if (self.invisible_finished < time) if (self.invisible_finished < time)
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items & ~IT_INVISIBILITY;
self.aura = 0; self.aura = 0;
} }

View file

@ -393,7 +393,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
sprint(attacker,PRINT_HIGH,"You have strayed from the flock\n"); sprint(attacker,PRINT_HIGH,"You have strayed from the flock\n");
attacker.tfstate = attacker.tfstate - TFSTATE_INSPIRED; attacker.tfstate = attacker.tfstate - TFSTATE_INSPIRED;
attacker.super_damage_finished = 0; attacker.super_damage_finished = 0;
attacker.items = attacker.items - (attacker.items & IT_QUAD); attacker.items = attacker.items & ~IT_QUAD;
attacker.effects = attacker.effects - (attacker.effects & EF_DIMLIGHT); attacker.effects = attacker.effects - (attacker.effects & EF_DIMLIGHT);
} }
} }
@ -403,7 +403,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
sprint(targ,PRINT_HIGH,"You have strayed from the flock\n"); sprint(targ,PRINT_HIGH,"You have strayed from the flock\n");
targ.tfstate = targ.tfstate - TFSTATE_INSPIRED; targ.tfstate = targ.tfstate - TFSTATE_INSPIRED;
targ.super_damage_finished = 0; targ.super_damage_finished = 0;
targ.items = targ.items - (targ.items & IT_QUAD); targ.items = targ.items & ~IT_QUAD;
targ.effects = targ.effects - (targ.effects & EF_DIMLIGHT); targ.effects = targ.effects - (targ.effects & EF_DIMLIGHT);
} }
} }
@ -569,7 +569,7 @@ void(entity targ, entity inflictor, entity attacker, float damage, float T_flags
save = targ.armorvalue; save = targ.armorvalue;
targ.armortype = 0; // lost all armor targ.armortype = 0; // lost all armor
targ.armorclass = 0; // lost special armor targ.armorclass = 0; // lost special armor
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); targ.items = targ.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
//WK Flags prevent armor damage too //WK Flags prevent armor damage too
if (T_flags & TF_TD_NOTTEAM) if (T_flags & TF_TD_NOTTEAM)

View file

@ -24,7 +24,7 @@ void() DropKey =
if (self.items & IT_KEY1) if (self.items & IT_KEY1)
{ {
self.items = self.items - (self.items & IT_KEY1); self.items = self.items & ~IT_KEY1;
newmis.items = IT_KEY1; newmis.items = IT_KEY1;
if (world.worldtype == 0) if (world.worldtype == 0)
{ {
@ -47,7 +47,7 @@ void() DropKey =
} }
else if (self.items & IT_KEY2) else if (self.items & IT_KEY2)
{ {
self.items = self.items - (self.items & IT_KEY2); self.items = self.items & ~IT_KEY2;
newmis.items = IT_KEY2; newmis.items = IT_KEY2;
if (world.worldtype == 0) if (world.worldtype == 0)
{ {

View file

@ -390,7 +390,7 @@ void() DropFromCustomClassGen =
//Make them invincible if they bought respawn protection //Make them invincible if they bought respawn protection
if (self.tf_items & NIT_RESPAWN_GUARD) { if (self.tf_items & NIT_RESPAWN_GUARD) {
self.items = self.items + IT_INVULNERABILITY; self.items = self.items & IT_INVULNERABILITY;
self.invincible_time = 1; self.invincible_time = 1;
self.invincible_finished = time + RESPAWN_GUARD_TIME; self.invincible_finished = time + RESPAWN_GUARD_TIME;
if (self.custom_speed > 300) if (self.custom_speed > 300)
@ -556,12 +556,12 @@ void(float cost, float item) BuyWeapon =
if (item == WEAP_ROCKET_LAUNCHER && self.tf_items & NIT_RL_LASER_SIGHT) if (item == WEAP_ROCKET_LAUNCHER && self.tf_items & NIT_RL_LASER_SIGHT)
{ {
self.money = self.money + 1000; self.money = self.money + 1000;
self.tf_items = self.tf_items - NIT_RL_LASER_SIGHT; self.tf_items = self.tf_items & ~NIT_RL_LASER_SIGHT;
} }
if (item == WEAP_ROCKET_LAUNCHER && self.tf_items & NIT_CLUSTER_ROCKETS) if (item == WEAP_ROCKET_LAUNCHER && self.tf_items & NIT_CLUSTER_ROCKETS)
{ {
self.money = self.money + 3250; self.money = self.money + 3250;
self.tf_items = self.tf_items - NIT_CLUSTER_ROCKETS; self.tf_items = self.tf_items & ~NIT_CLUSTER_ROCKETS;
} }
self.maxammo_shells = self.maxammo_shells - countshells(item); self.maxammo_shells = self.maxammo_shells - countshells(item);
self.maxammo_nails = self.maxammo_nails - countnails(item); self.maxammo_nails = self.maxammo_nails - countnails(item);

View file

@ -307,7 +307,7 @@ void() item_megahealth_rot =
// it is possible for a player to die and respawn between rots, so don't // it is possible for a player to die and respawn between rots, so don't
// just blindly subtract the flag off // just blindly subtract the flag off
other.items = other.items - (other.items & IT_SUPERHEALTH); other.items = other.items & ~IT_SUPERHEALTH;
if (self.classname == "medikit_rot") if (self.classname == "medikit_rot")
{ {
@ -332,7 +332,7 @@ ARMOR
void() armor_touch = void() armor_touch =
{ {
local float type, value, bit; local float type, value, bit = 0;
local string s; local string s;
local entity oldself; local entity oldself;
@ -456,7 +456,7 @@ void() armor_touch =
other.armortype = type; other.armortype = type;
other.armorvalue = value; other.armorvalue = value;
other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit; other.items = other.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3) | bit;
} }
self.solid = SOLID_NOT; self.solid = SOLID_NOT;

View file

@ -98,7 +98,7 @@ void() JobThief =
sprint (self, PRINT_HIGH, "Leaving shadows... just as soon as this ring wears off...\n"); sprint (self, PRINT_HIGH, "Leaving shadows... just as soon as this ring wears off...\n");
else { else {
sprint (self, PRINT_HIGH, "Leaving shadows...\n"); sprint (self, PRINT_HIGH, "Leaving shadows...\n");
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items & ~IT_INVISIBILITY;
self.modelindex = modelindex_player; self.modelindex = modelindex_player;
} }
self.job = self.job - JOB_ACTIVE; self.job = self.job - JOB_ACTIVE;
@ -387,7 +387,7 @@ void() MartyrThink =
//Clean these up so we can kill him //Clean these up so we can kill him
//self.job = self.job - (self.job & JOB_ACTIVE); //self.job = self.job - (self.job & JOB_ACTIVE);
self.owner.items = self.items - (self.items & IT_INVULNERABILITY); self.owner.items = self.items & ~IT_INVULNERABILITY;
self.owner.invincible_time = 0; self.owner.invincible_time = 0;
self.owner.invincible_finished = 0; self.owner.invincible_finished = 0;
self.owner.effects = self.owner.effects - (self.owner.effects & EF_DIMLIGHT); self.owner.effects = self.owner.effects - (self.owner.effects & EF_DIMLIGHT);
@ -1008,7 +1008,7 @@ void (entity targ, float pain) RevealThief = {
if (!targ.invisible_time) { if (!targ.invisible_time) {
targ.modelindex = modelindex_player; targ.modelindex = modelindex_player;
targ.items = targ.items - (targ.items & IT_INVISIBILITY); targ.items = targ.items & ~IT_INVISIBILITY;
} }
if (pain) { if (pain) {
if (targ.invisible_time) if (targ.invisible_time)

24
menu.qc
View file

@ -1542,7 +1542,7 @@ void(float inp) Menu_EngineerFix_Dispenser_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -1737,7 +1737,7 @@ void(float inp) Menu_EngineerFix_SentryGun_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -1794,7 +1794,7 @@ void(float inp) Menu_EngineerFix_Sensor_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -1851,7 +1851,7 @@ void(float inp) Menu_EngineerFix_Camera_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -1919,7 +1919,7 @@ void(float inp) Menu_EngineerFix_Teleporter_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -1989,7 +1989,7 @@ void(float inp) Menu_EngineerFix_FieldGen_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -2384,7 +2384,7 @@ void(float inp) Menu_EngineerFix_Tesla_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -2525,7 +2525,7 @@ void(float inp) Menu_EngineerFix_Tesla_Input2 =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -2658,7 +2658,7 @@ void(float inp) Menu_Dispenser_Input =
{ {
self.armortype = 0; // lost all armor self.armortype = 0; // lost all armor
self.armorclass = 0; // lost special armor self.armorclass = 0; // lost special armor
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
} }
W_SetCurrentAmmo(); W_SetCurrentAmmo();
@ -2798,7 +2798,7 @@ void(float inp) Menu_PrimaryWeapon_Input =
//Clean up asbestos armor //Clean up asbestos armor
if (!(self.tf_items & NIT_ASBESTOS)) if (!(self.tf_items & NIT_ASBESTOS))
self.money = self.money - 750; //Sync this with asbestos self.money = self.money - 750; //Sync this with asbestos
self.tf_items = self.tf_items - (self.tf_items & NIT_ASBESTOS); self.tf_items = self.tf_items & ~NIT_ASBESTOS;
PrintRefund(PRICE); PrintRefund(PRICE);
self.weapons_carried = self.weapons_carried - WEAP_INCENDIARY; self.weapons_carried = self.weapons_carried - WEAP_INCENDIARY;
@ -3574,10 +3574,10 @@ void(float inp) Menu_Special_Input =
//Clean up auto-medic (sync this with Custom.qc) //Clean up auto-medic (sync this with Custom.qc)
if (self.tf_items & NIT_AUTOSCANNER) if (self.tf_items & NIT_AUTOSCANNER)
self.money = self.money + 250; //Sync this with price below self.money = self.money + 250; //Sync this with price below
self.tf_items = self.tf_items - (self.tf_items & NIT_AUTOSCANNER); self.tf_items = self.tf_items & ~NIT_AUTOSCANNER;
PrintRefund(PRICE); PrintRefund(PRICE);
self.tf_items = self.tf_items - NIT_SCANNER; self.tf_items = self.tf_items & ~NIT_SCANNER;
self.tf_items_flags = self.tf_items_flags - (self.tf_items & NIT_SCANNER_ENEMY); self.tf_items_flags = self.tf_items_flags - (self.tf_items & NIT_SCANNER_ENEMY);
} }
else if (self.money >= PRICE) { else if (self.money >= PRICE) {

View file

@ -1270,8 +1270,7 @@ void() PlayerDie =
Attack_Finished(0.75); Attack_Finished(0.75);
self.hook_out = TRUE; // PutClientInServer will reset this self.hook_out = TRUE; // PutClientInServer will reset this
} }
self.items = self.items - (self.items & self.items = self.items & ~(IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
(IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
self.invisible_finished = 0; // don't die as eyes self.invisible_finished = 0; // don't die as eyes
self.invincible_finished = 0; self.invincible_finished = 0;
self.super_damage_finished = 0; self.super_damage_finished = 0;

View file

@ -281,7 +281,7 @@ void(float scanrange,float inAuto) TeamFortress_Scan =
if (self.tf_items_flags & NIT_SCANNER_ENEMY) if (self.tf_items_flags & NIT_SCANNER_ENEMY)
{ {
sprint (self, PRINT_HIGH, "Enemy Scanning disabled.\n"); sprint (self, PRINT_HIGH, "Enemy Scanning disabled.\n");
self.tf_items_flags = self.tf_items_flags - NIT_SCANNER_ENEMY; self.tf_items_flags = self.tf_items_flags & ~NIT_SCANNER_ENEMY;
return; return;
} }
sprint (self, PRINT_HIGH, "Enemy Scanning enabled.\n"); sprint (self, PRINT_HIGH, "Enemy Scanning enabled.\n");
@ -295,7 +295,7 @@ void(float scanrange,float inAuto) TeamFortress_Scan =
if (self.tf_items_flags & NIT_SCANNER_FRIENDLY) if (self.tf_items_flags & NIT_SCANNER_FRIENDLY)
{ {
sprint (self, PRINT_HIGH, "Friendly Scanning disabled.\n"); sprint (self, PRINT_HIGH, "Friendly Scanning disabled.\n");
self.tf_items_flags = self.tf_items_flags - NIT_SCANNER_FRIENDLY; self.tf_items_flags = self.tf_items_flags & ~NIT_SCANNER_FRIENDLY;
return; return;
} }
sprint (self, PRINT_HIGH, "Friendly Scanning enabled.\n"); sprint (self, PRINT_HIGH, "Friendly Scanning enabled.\n");

12
spy.qc
View file

@ -346,7 +346,7 @@ void(float type) TeamFortress_SpyFeignDeath =
} }
if (self.undercover_team == 0 && self.undercover_skin == 0) if (self.undercover_team == 0 && self.undercover_skin == 0)
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items & ~IT_INVISIBILITY;
self.invisible_finished = 0; self.invisible_finished = 0;
self.modelindex = modelindex_player; // don't use eyes self.modelindex = modelindex_player; // don't use eyes
@ -415,7 +415,7 @@ void() TeamFortress_SpyGoUndercover =
{ {
self.is_undercover = 0; self.is_undercover = 0;
self.modelindex = modelindex_player; // return to normal self.modelindex = modelindex_player; // return to normal
//WK self.items = self.items - (self.items & IT_INVISIBILITY); //WK self.items = self.items & ~IT_INVISIBILITY;
} }
else if (self.is_undercover == 2) else if (self.is_undercover == 2)
{ {
@ -582,7 +582,7 @@ void(float class) TeamFortress_SpyChangeSkin =
if (self.undercover_team == 0) if (self.undercover_team == 0)
{ {
//WK self.items = self.items - (self.items & IT_INVISIBILITY); //WK self.items = self.items & ~IT_INVISIBILITY;
self.is_undercover = 0; self.is_undercover = 0;
} }
return; return;
@ -624,7 +624,7 @@ void(float teamno) TeamFortress_SpyChangeColor =
if (self.undercover_skin == 0) if (self.undercover_skin == 0)
{ {
//WK self.items = self.items - (self.items & IT_INVISIBILITY); //WK self.items = self.items & ~IT_INVISIBILITY;
self.is_undercover = 0; self.is_undercover = 0;
} }
return; return;
@ -1056,7 +1056,7 @@ void(entity spy) Spy_RemoveDisguise =
// Reset the Skin // Reset the Skin
if (spy.undercover_skin != 0) if (spy.undercover_skin != 0)
{ {
//WK spy.items = spy.items - (spy.items & IT_INVISIBILITY); //WK spy.items = spy.items & ~IT_INVISIBILITY;
makeImmune(spy,time + 4); makeImmune(spy,time + 4);
//spy.immune_to_check = time + 4; //spy.immune_to_check = time + 4;
spy.undercover_skin = 0; spy.undercover_skin = 0;
@ -1092,7 +1092,7 @@ void(entity spy) Spy_RemoveDisguise =
spy.modelindex = modelindex_player; // return to normal spy.modelindex = modelindex_player; // return to normal
//WK if (spy.items & IT_INVISIBILITY) //WK if (spy.items & IT_INVISIBILITY)
//WK spy.items = spy.items - IT_INVISIBILITY; //WK spy.items = spy.items & ~IT_INVISIBILITY;
self.StatusRefreshTime = time + 0.1; self.StatusRefreshTime = time + 0.1;
} }

View file

@ -345,7 +345,7 @@ void() TeamFortress_ChangeClass =
TeamFortress_SetSkin(self); TeamFortress_SetSkin(self);
//WK Give them invincibility if they are a normal class or bought it //WK Give them invincibility if they are a normal class or bought it
if (self.playerclass >= PC_SCOUT && self.playerclass <= PC_RANDOM) { if (self.playerclass >= PC_SCOUT && self.playerclass <= PC_RANDOM) {
self.items = self.items + IT_INVULNERABILITY; self.items = self.items & IT_INVULNERABILITY;
self.invincible_time = 1; self.invincible_time = 1;
self.invincible_finished = time + RESPAWN_GUARD_TIME; self.invincible_finished = time + RESPAWN_GUARD_TIME;
} }
@ -2930,7 +2930,7 @@ void() TeamFortress_CheckClassStats =
T_Heal(self, (self.health - self.health), 0); T_Heal(self, (self.health - self.health), 0);
// Update armor picture // Update armor picture
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
if (self.armortype >= 0.8) if (self.armortype >= 0.8)
self.items = self.items | IT_ARMOR3; self.items = self.items | IT_ARMOR3;
else if (self.armortype >= 0.6) else if (self.armortype >= 0.6)
@ -3887,7 +3887,7 @@ void() TeamFortress_RegenerateCells =
{ {
self.owner.is_undercover = 0; self.owner.is_undercover = 0;
self.owner.modelindex = modelindex_player; // return to normal self.owner.modelindex = modelindex_player; // return to normal
self.owner.items = self.owner.items - (self.owner.items & IT_INVISIBILITY); self.owner.items = self.owner.items & ~IT_INVISIBILITY;
} }
else // Decrease cells else // Decrease cells
{ {

View file

@ -933,7 +933,7 @@ void(entity Goal, entity Player, entity AP, float addb) Apply_Results =
if (Goal.invincible_finished < 0) if (Goal.invincible_finished < 0)
{ {
// KK allow goal to strip invinc cheats // KK allow goal to strip invinc cheats
Player.items = Player.items + IT_INVULNERABILITY; Player.items = Player.items & ~IT_INVULNERABILITY;
Player.invincible_time = 0; Player.invincible_time = 0;
Player.invincible_finished = 0; Player.invincible_finished = 0;
} }
@ -2346,7 +2346,7 @@ void(entity Goal, entity AP, float addb) DoResults =
} }
bprint(PRINT_HIGH, AP.netname); bprint(PRINT_HIGH, AP.netname);
bprint(PRINT_HIGH, " ÃÁÐÔÕÒÅÄ the ÒÅÄ flag!\n"); bprint(PRINT_HIGH, " ÃÁÐÔÕÒÅÄ the ÒÅÄ flag!\n");
AP.items = AP.items - (AP.items & IT_KEY2); AP.items = AP.items & ~IT_KEY2;
} }
else if (Goal.goal_no == CTF_DROPOFF2) else if (Goal.goal_no == CTF_DROPOFF2)
@ -2368,7 +2368,7 @@ void(entity Goal, entity AP, float addb) DoResults =
} }
bprint(PRINT_HIGH, AP.netname); bprint(PRINT_HIGH, AP.netname);
bprint(PRINT_HIGH, " ÃÁÐÔÕÒÅÄ the ÂÌÕÅ flag!\n"); bprint(PRINT_HIGH, " ÃÁÐÔÕÒÅÄ the ÂÌÕÅ flag!\n");
AP.items = AP.items - (AP.items & IT_KEY1); AP.items = AP.items & ~IT_KEY1;
} }
} }
} }
@ -2973,9 +2973,9 @@ void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer =
// Remove the Light up of console icons // Remove the Light up of console icons
if (!key1on) if (!key1on)
AP.items = AP.items - (AP.items & IT_KEY1); AP.items = AP.items & ~IT_KEY1;
if (!key2on) if (!key2on)
AP.items = AP.items - (AP.items & IT_KEY2); AP.items = AP.items & ~IT_KEY2;
// Remove AP Modifications // Remove AP Modifications
// Go through all the players and do any results // Go through all the players and do any results

View file

@ -61,7 +61,7 @@ void () DoTinker = {
} }
else if (prob <= 0.35){ else if (prob <= 0.35){
if (!(self.building.tf_items & NIT_SCANNER)){ if (!(self.building.tf_items & NIT_SCANNER)){
self.building.tf_items = (self.building.tf_items | NIT_SCANNER); self.building.tf_items = self.building.tf_items | NIT_SCANNER;
sprint(self,PRINT_HIGH,"The tesla gets a free improved targeter!\n"); sprint(self,PRINT_HIGH,"The tesla gets a free improved targeter!\n");
} }
else{ else{
@ -70,7 +70,7 @@ void () DoTinker = {
} }
else if (prob <= 0.4){ else if (prob <= 0.4){
if (!(self.building.tf_items & NIT_AUTOID)){ if (!(self.building.tf_items & NIT_AUTOID)){
self.building.tf_items = (self.building.tf_items | NIT_AUTOID); self.building.tf_items = self.building.tf_items | NIT_AUTOID;
sprint(self,PRINT_HIGH,"The tesla got a free spy detector!\n"); sprint(self,PRINT_HIGH,"The tesla got a free spy detector!\n");
} }
else{ else{

View file

@ -2434,11 +2434,11 @@ void() W_SetCurrentAmmo =
player_run(); player_run();
self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) ); self.items = self.items & ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS);
self.weapon = 0; self.weapon = 0;
//WK Set armor here... update armor picture //WK Set armor here... update armor picture
self.items = self.items - (self.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)); self.items = self.items & ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
if (self.armortype >= 0.8) if (self.armortype >= 0.8)
self.items = self.items | IT_ARMOR3; self.items = self.items | IT_ARMOR3;
else if (self.armortype >= 0.6) else if (self.armortype >= 0.6)