mirror of
https://git.code.sf.net/p/quake/game-source
synced 2024-11-22 03:51:12 +00:00
fix a slew of precedence bugs
This commit is contained in:
parent
d352e0529f
commit
9d82f07eaa
13 changed files with 64 additions and 70 deletions
|
@ -39,8 +39,8 @@ void() SetChangeParms =
|
|||
}
|
||||
|
||||
// remove items
|
||||
self.items = self.items - (self.items &
|
||||
(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
|
||||
self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY
|
||||
| IT_SUIT | IT_QUAD);
|
||||
|
||||
// cap super health
|
||||
if (self.health > 100)
|
||||
|
@ -220,7 +220,7 @@ void() ExitIntermission =
|
|||
return;
|
||||
}
|
||||
|
||||
if ( (serverflags&15) == 15)
|
||||
if ((serverflags & 15) == 15)
|
||||
{
|
||||
WriteByte (MSG_ALL, SVC_FINALE);
|
||||
WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born.");
|
||||
|
@ -308,7 +308,7 @@ void() changelevel_touch =
|
|||
|
||||
SUB_UseTargets ();
|
||||
|
||||
if ( (self.spawnflags & 1) && (deathmatch == 0) )
|
||||
if ((self.spawnflags & 1) && (deathmatch == 0))
|
||||
{ // NO_INTERMISSION
|
||||
GotoNextMap();
|
||||
return;
|
||||
|
@ -609,22 +609,22 @@ void() NextLevel =
|
|||
else if (!(serverflags & 1))
|
||||
{
|
||||
mapname = "e1m1";
|
||||
serverflags = serverflags | 1;
|
||||
serverflags |= 1;
|
||||
}
|
||||
else if (!(serverflags & 2))
|
||||
{
|
||||
mapname = "e2m1";
|
||||
serverflags = serverflags | 2;
|
||||
serverflags |= 2;
|
||||
}
|
||||
else if (!(serverflags & 4))
|
||||
{
|
||||
mapname = "e3m1";
|
||||
serverflags = serverflags | 4;
|
||||
serverflags |= 4;
|
||||
}
|
||||
else if (!(serverflags & 8))
|
||||
{
|
||||
mapname = "e4m1";
|
||||
serverflags = serverflags - 7;
|
||||
serverflags -= 7; //FIXME should this be &= ~7?
|
||||
}
|
||||
|
||||
o = spawn();
|
||||
|
@ -751,10 +751,10 @@ void() PlayerJump =
|
|||
if (!(self.flags & FL_ONGROUND))
|
||||
return;
|
||||
|
||||
if ( !(self.flags & FL_JUMPRELEASED) )
|
||||
if (!(self.flags & FL_JUMPRELEASED) )
|
||||
return; // don't pogo stick
|
||||
|
||||
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
|
||||
self.flags &= ~FL_JUMPRELEASED;
|
||||
|
||||
self.flags = self.flags - FL_ONGROUND; // don't stairwalk
|
||||
|
||||
|
@ -804,8 +804,7 @@ void() WaterMove =
|
|||
|
||||
if (!self.waterlevel)
|
||||
{
|
||||
if (self.flags & FL_INWATER)
|
||||
{
|
||||
if (self.flags & FL_INWATER) {
|
||||
// play leave water sound
|
||||
sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM);
|
||||
self.flags = self.flags - FL_INWATER;
|
||||
|
@ -834,8 +833,7 @@ void() WaterMove =
|
|||
}
|
||||
}
|
||||
|
||||
if ( !(self.flags & FL_INWATER) )
|
||||
{
|
||||
if (!(self.flags & FL_INWATER)) {
|
||||
|
||||
// player enter water sound
|
||||
|
||||
|
@ -850,8 +848,8 @@ void() WaterMove =
|
|||
self.dmgtime = 0;
|
||||
}
|
||||
|
||||
if (! (self.flags & FL_WATERJUMP) )
|
||||
self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity;
|
||||
if (!(self.flags & FL_WATERJUMP))
|
||||
self.velocity -= 0.8 * self.waterlevel * frametime * self.velocity;
|
||||
};
|
||||
|
||||
void() CheckWaterJump =
|
||||
|
@ -874,9 +872,9 @@ void() CheckWaterJump =
|
|||
traceline (start, end, TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
{ // open at eye level
|
||||
self.flags = self.flags | FL_WATERJUMP;
|
||||
self.flags |= FL_WATERJUMP;
|
||||
self.velocity_z = 225;
|
||||
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
|
||||
self.flags &= ~FL_JUMPRELEASED;
|
||||
self.teleport_time = time + 2; // safety net
|
||||
return;
|
||||
}
|
||||
|
@ -924,13 +922,14 @@ void() PlayerPreThink =
|
|||
PlayerJump ();
|
||||
}
|
||||
else
|
||||
self.flags = self.flags | FL_JUMPRELEASED;
|
||||
self.flags |= FL_JUMPRELEASED;
|
||||
|
||||
// teleporters can force a non-moving pause time
|
||||
if (time < self.pausetime)
|
||||
self.velocity = '0 0 0';
|
||||
|
||||
if(time > self.attack_finished && self.currentammo == 0 && self.weapon != IT_AXE)
|
||||
if (time > self.attack_finished
|
||||
&& self.currentammo == 0 && self.weapon != IT_AXE)
|
||||
{
|
||||
self.weapon = W_BestWeapon ();
|
||||
W_SetCurrentAmmo ();
|
||||
|
@ -1019,9 +1018,9 @@ void() CheckPowerups =
|
|||
self.invincible_finished = 0;
|
||||
}
|
||||
if (self.invincible_finished > time)
|
||||
self.effects = self.effects | EF_DIMLIGHT;
|
||||
self.effects |= EF_DIMLIGHT;
|
||||
else
|
||||
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
|
||||
self.effects &= ~EF_DIMLIGHT;
|
||||
}
|
||||
|
||||
// super damage
|
||||
|
@ -1054,9 +1053,9 @@ void() CheckPowerups =
|
|||
self.super_time = 0;
|
||||
}
|
||||
if (self.super_damage_finished > time)
|
||||
self.effects = self.effects | EF_DIMLIGHT;
|
||||
self.effects |= EF_DIMLIGHT;
|
||||
else
|
||||
self.effects = self.effects - (self.effects & EF_DIMLIGHT);
|
||||
self.effects &= ~EF_DIMLIGHT;
|
||||
}
|
||||
|
||||
// suit
|
||||
|
|
|
@ -123,7 +123,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
|
|||
{
|
||||
save = targ.armorvalue;
|
||||
targ.armortype = 0; // lost all armor
|
||||
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
|
||||
targ.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
|
||||
}
|
||||
|
||||
targ.armorvalue = targ.armorvalue - save;
|
||||
|
|
|
@ -103,7 +103,7 @@ void() enforcer_fire =
|
|||
{
|
||||
local vector org;
|
||||
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
makevectors (self.angles);
|
||||
|
||||
org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
|
||||
|
|
|
@ -183,7 +183,7 @@ void() health_touch =
|
|||
// Megahealth = rot down the player's super health
|
||||
if (self.healtype == 2)
|
||||
{
|
||||
other.items = other.items | IT_SUPERHEALTH;
|
||||
other.items |= IT_SUPERHEALTH;
|
||||
self.nextthink = time + 5;
|
||||
self.think = item_megahealth_rot;
|
||||
self.owner = other;
|
||||
|
@ -215,7 +215,7 @@ void() item_megahealth_rot =
|
|||
|
||||
// it is possible for a player to die and respawn between rots, so don't
|
||||
// just blindly subtract the flag off
|
||||
other.items = other.items - (other.items & IT_SUPERHEALTH);
|
||||
other.items &= ~IT_SUPERHEALTH;
|
||||
|
||||
if (deathmatch == 1) // deathmatch 2 is silly old rules
|
||||
{
|
||||
|
@ -266,7 +266,8 @@ void() armor_touch =
|
|||
|
||||
other.armortype = type;
|
||||
other.armorvalue = value;
|
||||
other.items = other.items - (other.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + bit;
|
||||
other.items &= ~(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3);
|
||||
other.items |= bit;
|
||||
|
||||
self.solid = SOLID_NOT;
|
||||
self.model = string_null;
|
||||
|
@ -470,7 +471,7 @@ void() weapon_touch =
|
|||
|
||||
// change to the weapon
|
||||
old = other.items;
|
||||
other.items = other.items | new;
|
||||
other.items |= new;
|
||||
|
||||
stemp = self;
|
||||
self = other;
|
||||
|
@ -880,7 +881,7 @@ void() key_touch =
|
|||
|
||||
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
|
||||
stuffcmd (other, "bf\n");
|
||||
other.items = other.items | self.items;
|
||||
other.items |= self.items;
|
||||
|
||||
if (!coop)
|
||||
{
|
||||
|
@ -1011,7 +1012,7 @@ void() sigil_touch =
|
|||
stuffcmd (other, "bf\n");
|
||||
self.solid = SOLID_NOT;
|
||||
self.model = string_null;
|
||||
serverflags = serverflags | (self.spawnflags & 15);
|
||||
serverflags |= self.spawnflags & 15;
|
||||
self.classname = ""; // so rune doors won't find it
|
||||
|
||||
activator = other;
|
||||
|
@ -1095,7 +1096,7 @@ void() powerup_touch =
|
|||
sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
stuffcmd (other, "bf\n");
|
||||
self.solid = SOLID_NOT;
|
||||
other.items = other.items | self.items;
|
||||
other.items |= self.items;
|
||||
self.model = string_null;
|
||||
|
||||
// do the apropriate action
|
||||
|
@ -1255,7 +1256,7 @@ void() BackpackTouch =
|
|||
if (!new)
|
||||
new = other.weapon;
|
||||
old = other.items;
|
||||
other.items = other.items | new;
|
||||
other.items |= new;
|
||||
|
||||
bound_other_ammo ();
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ void() walkmonster_start_go =
|
|||
self.view_ofs = '0 0 25';
|
||||
self.use = monster_use;
|
||||
|
||||
self.flags = self.flags | FL_MONSTER;
|
||||
self.flags |= FL_MONSTER;
|
||||
|
||||
if (self.target)
|
||||
{
|
||||
|
@ -136,8 +136,8 @@ void() flymonster_start_go =
|
|||
self.view_ofs = '0 0 25';
|
||||
self.use = monster_use;
|
||||
|
||||
self.flags = self.flags | FL_FLY;
|
||||
self.flags = self.flags | FL_MONSTER;
|
||||
self.flags |= FL_FLY;
|
||||
self.flags |= FL_MONSTER;
|
||||
|
||||
if (!walkmove(0,0))
|
||||
{
|
||||
|
@ -195,8 +195,8 @@ void() swimmonster_start_go =
|
|||
self.view_ofs = '0 0 10';
|
||||
self.use = monster_use;
|
||||
|
||||
self.flags = self.flags | FL_SWIM;
|
||||
self.flags = self.flags | FL_MONSTER;
|
||||
self.flags |= FL_SWIM;
|
||||
self.flags |= FL_MONSTER;
|
||||
|
||||
if (self.target)
|
||||
{
|
||||
|
|
|
@ -91,7 +91,7 @@ void() OgreFireGrenade =
|
|||
{
|
||||
local entity missile;
|
||||
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ void() player_run =[ $rockrun1, player_run ]
|
|||
|
||||
|
||||
void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe=1;
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;};
|
||||
self.effects |= EF_MUZZLEFLASH;};
|
||||
void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe=2;};
|
||||
void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe=3;};
|
||||
void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe=4;};
|
||||
|
@ -172,7 +172,7 @@ void() player_axed4 = [$axattd4, player_run ] {self.weaponframe=8;};
|
|||
|
||||
void() player_nail1 =[$nailatt1, player_nail2 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
if (!self.button0)
|
||||
{player_run ();return;}
|
||||
|
@ -185,7 +185,7 @@ void() player_nail1 =[$nailatt1, player_nail2 ]
|
|||
};
|
||||
void() player_nail2 =[$nailatt2, player_nail1 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
if (!self.button0)
|
||||
{player_run ();return;}
|
||||
|
@ -201,7 +201,7 @@ void() player_nail2 =[$nailatt2, player_nail1 ]
|
|||
|
||||
void() player_light1 =[$light1, player_light2 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
if (!self.button0)
|
||||
{player_run ();return;}
|
||||
|
@ -214,7 +214,7 @@ void() player_light1 =[$light1, player_light2 ]
|
|||
};
|
||||
void() player_light2 =[$light2, player_light1 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
if (!self.button0)
|
||||
{player_run ();return;}
|
||||
|
@ -230,7 +230,7 @@ void() player_light2 =[$light2, player_light1 ]
|
|||
|
||||
|
||||
void() player_rocket1 =[$rockatt1, player_rocket2 ] {self.weaponframe=1;
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;};
|
||||
self.effects |= EF_MUZZLEFLASH;};
|
||||
void() player_rocket2 =[$rockatt2, player_rocket3 ] {self.weaponframe=2;};
|
||||
void() player_rocket3 =[$rockatt3, player_rocket4 ] {self.weaponframe=3;};
|
||||
void() player_rocket4 =[$rockatt4, player_rocket5 ] {self.weaponframe=4;};
|
||||
|
@ -489,7 +489,7 @@ void(string gibname, float dm) ThrowHead =
|
|||
setsize (self, '-16 -16 0', '16 16 56');
|
||||
self.velocity = VelocityForDamage (dm);
|
||||
self.origin_z = self.origin_z - 24;
|
||||
self.flags = self.flags - (self.flags & FL_ONGROUND);
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
self.avelocity = crandom() * '0 600 0';
|
||||
};
|
||||
|
||||
|
@ -525,7 +525,7 @@ void() PlayerDie =
|
|||
{
|
||||
local float i;
|
||||
|
||||
self.items = self.items - (self.items & IT_INVISIBILITY);
|
||||
self.items &= ~IT_INVISIBILITY;
|
||||
self.invisible_finished = 0; // don't die as eyes
|
||||
self.invincible_finished = 0;
|
||||
self.super_damage_finished = 0;
|
||||
|
@ -539,7 +539,7 @@ void() PlayerDie =
|
|||
self.view_ofs = '0 0 -8';
|
||||
self.deadflag = DEAD_DYING;
|
||||
self.solid = SOLID_NOT;
|
||||
self.flags = self.flags - (self.flags & FL_ONGROUND);
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
self.movetype = MOVETYPE_TOSS;
|
||||
if (self.velocity_z < 10)
|
||||
self.velocity_z = self.velocity_z + random()*300;
|
||||
|
|
|
@ -135,7 +135,7 @@ void() ShalMissile =
|
|||
if (flytime < 0.1)
|
||||
flytime = 0.1;
|
||||
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM);
|
||||
|
||||
missile = spawn ();
|
||||
|
|
|
@ -194,7 +194,7 @@ void() CastLightning =
|
|||
{
|
||||
local vector org, dir;
|
||||
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
ai_face ();
|
||||
|
||||
|
@ -225,7 +225,7 @@ void() sham_magic2 =[ $magic2, sham_magic3 ] {ai_face();};
|
|||
void() sham_magic3 =[ $magic3, sham_magic4 ] {ai_face();self.nextthink = self.nextthink + 0.2;
|
||||
local entity o;
|
||||
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
ai_face();
|
||||
self.owner = spawn();
|
||||
o = self.owner;
|
||||
|
@ -237,12 +237,12 @@ o.think = SUB_Remove;
|
|||
};
|
||||
void() sham_magic4 =[ $magic4, sham_magic5 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
self.owner.frame = 1;
|
||||
};
|
||||
void() sham_magic5 =[ $magic5, sham_magic6 ]
|
||||
{
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;
|
||||
self.effects |= EF_MUZZLEFLASH;
|
||||
self.owner.frame = 2;
|
||||
};
|
||||
void() sham_magic6 =[ $magic6, sham_magic9 ]
|
||||
|
|
|
@ -99,7 +99,7 @@ void() army_atk2 =[ $shoot2, army_atk3 ] {ai_face();};
|
|||
void() army_atk3 =[ $shoot3, army_atk4 ] {ai_face();};
|
||||
void() army_atk4 =[ $shoot4, army_atk5 ] {ai_face();};
|
||||
void() army_atk5 =[ $shoot5, army_atk6 ] {ai_face();army_fire();
|
||||
self.effects = self.effects | EF_MUZZLEFLASH;};
|
||||
self.effects |= EF_MUZZLEFLASH;};
|
||||
void() army_atk6 =[ $shoot6, army_atk7 ] {ai_face();};
|
||||
void() army_atk7 =[ $shoot7, army_atk8 ] {ai_face();SUB_CheckRefire (army_atk1);};
|
||||
void() army_atk8 =[ $shoot8, army_atk9 ] {ai_face();};
|
||||
|
|
|
@ -414,7 +414,7 @@ local vector org;
|
|||
other.flags = other.flags - FL_ONGROUND;
|
||||
other.velocity = v_forward * 300;
|
||||
}
|
||||
other.flags = other.flags - other.flags & FL_ONGROUND;
|
||||
other.flags &= ~FL_ONGROUND;
|
||||
};
|
||||
|
||||
/*QUAKED info_teleport_destination (.5 .5 .5) (-8 -8 -8) (8 8 32)
|
||||
|
|
|
@ -754,7 +754,7 @@ void() W_SetCurrentAmmo =
|
|||
{
|
||||
player_run (); // get out of any weapon firing states
|
||||
|
||||
self.items = self.items - ( self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS) );
|
||||
self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS);
|
||||
|
||||
if (self.weapon == IT_AXE)
|
||||
{
|
||||
|
@ -1028,18 +1028,12 @@ void() CheatCommand =
|
|||
self.ammo_rockets = 100;
|
||||
self.ammo_nails = 200;
|
||||
self.ammo_shells = 100;
|
||||
self.items = self.items |
|
||||
IT_AXE |
|
||||
IT_SHOTGUN |
|
||||
IT_SUPER_SHOTGUN |
|
||||
IT_NAILGUN |
|
||||
IT_SUPER_NAILGUN |
|
||||
IT_GRENADE_LAUNCHER |
|
||||
IT_ROCKET_LAUNCHER |
|
||||
IT_KEY1 | IT_KEY2;
|
||||
self.items |= (IT_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN
|
||||
| IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER
|
||||
| IT_ROCKET_LAUNCHER | IT_KEY1 | IT_KEY2);
|
||||
|
||||
self.ammo_cells = 200;
|
||||
self.items = self.items | IT_LIGHTNING;
|
||||
self.items |= IT_LIGHTNING;
|
||||
|
||||
self.weapon = IT_ROCKET_LAUNCHER;
|
||||
self.impulse = 0;
|
||||
|
@ -1212,7 +1206,7 @@ void() QuadCheat =
|
|||
return;
|
||||
self.super_time = 1;
|
||||
self.super_damage_finished = time + 30;
|
||||
self.items = self.items | IT_QUAD;
|
||||
self.items |= IT_QUAD;
|
||||
dprint ("quad cheat\n");
|
||||
};
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ void() Wiz_FastFire =
|
|||
|
||||
if (self.owner.health > 0)
|
||||
{
|
||||
self.owner.effects = self.owner.effects | EF_MUZZLEFLASH;
|
||||
self.owner.effects |= EF_MUZZLEFLASH;
|
||||
|
||||
makevectors (self.enemy.angles);
|
||||
dst = self.enemy.origin - 13*self.movedir;
|
||||
|
@ -327,7 +327,7 @@ void() wiz_death1 =[ $death1, wiz_death2 ] {
|
|||
self.velocity_x = -200 + 400*random();
|
||||
self.velocity_y = -200 + 400*random();
|
||||
self.velocity_z = 100 + 100*random();
|
||||
self.flags = self.flags - (self.flags & FL_ONGROUND);
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM);
|
||||
};
|
||||
void() wiz_death2 =[ $death2, wiz_death3 ] {};
|
||||
|
|
Loading…
Reference in a new issue