From 7f3ef60d607444d6973d481657edd4b28b54d0b1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 21 Feb 2002 20:36:23 +0000 Subject: [PATCH] compiles with qfcc (this was probably a pointless exercise due to Deek's work, but it's nice having a compilable base paroxysm). --- paroxysm/quake/.gitignore | 3 +++ paroxysm/quake/Makefile | 5 +++++ paroxysm/quake/ai.qc | 2 +- paroxysm/quake/botgrab.qc | 2 +- paroxysm/quake/botmain.qc | 19 ++++++++----------- paroxysm/quake/botspawn.qc | 14 +++++++------- paroxysm/quake/buttons.qc | 2 -- paroxysm/quake/ccam.qc | 1 - paroxysm/quake/client.qc | 16 ++-------------- paroxysm/quake/defs.qc | 2 +- paroxysm/quake/doors.qc | 11 ++++++++--- paroxysm/quake/dynlight.qc | 2 -- paroxysm/quake/hiprot.qc | 1 - paroxysm/quake/items.qc | 14 ++------------ paroxysm/quake/kascam.qc | 16 ++++------------ paroxysm/quake/misc.qc | 7 ++----- paroxysm/quake/plats.qc | 2 -- paroxysm/quake/player.qc | 2 +- paroxysm/quake/sectrig.qc | 12 +++++------- paroxysm/quake/specfx.qc | 2 +- paroxysm/quake/triggers.qc | 2 -- paroxysm/quake/wall.qc | 2 +- paroxysm/quake/weapons.qc | 20 ++++++-------------- paroxysm/quake/world.qc | 2 -- paroxysm/quakeworld/.gitignore | 3 +++ paroxysm/quakeworld/Makefile | 5 +++++ paroxysm/quakeworld/buttons.qc | 2 -- paroxysm/quakeworld/client.qc | 25 +++++-------------------- paroxysm/quakeworld/combat.qc | 1 - paroxysm/quakeworld/defs.qc | 4 ++-- paroxysm/quakeworld/doors.qc | 11 ++++++++--- paroxysm/quakeworld/dynlight.qc | 2 -- paroxysm/quakeworld/hiprot.qc | 1 - paroxysm/quakeworld/items.qc | 18 ++---------------- paroxysm/quakeworld/misc.qc | 7 ++----- paroxysm/quakeworld/observe.qc | 1 - paroxysm/quakeworld/plats.qc | 2 -- paroxysm/quakeworld/player.qc | 2 +- paroxysm/quakeworld/sectrig.qc | 12 +++++------- paroxysm/quakeworld/specfx.qc | 2 +- paroxysm/quakeworld/triggers.qc | 2 -- paroxysm/quakeworld/wall.qc | 2 +- paroxysm/quakeworld/weapons.qc | 18 +++++------------- paroxysm/quakeworld/world.qc | 4 ++-- 44 files changed, 100 insertions(+), 185 deletions(-) create mode 100644 paroxysm/quake/.gitignore create mode 100644 paroxysm/quake/Makefile create mode 100644 paroxysm/quakeworld/.gitignore create mode 100644 paroxysm/quakeworld/Makefile diff --git a/paroxysm/quake/.gitignore b/paroxysm/quake/.gitignore new file mode 100644 index 0000000..5b13a41 --- /dev/null +++ b/paroxysm/quake/.gitignore @@ -0,0 +1,3 @@ +progdefs.h +*.dat +*.sym diff --git a/paroxysm/quake/Makefile b/paroxysm/quake/Makefile new file mode 100644 index 0000000..fefb58a --- /dev/null +++ b/paroxysm/quake/Makefile @@ -0,0 +1,5 @@ +all: progs.dat +progs.dat: progs.src *.qc + qfcc --traditional -Werror -g +clean: + rm -f core *.dat *.sym progdefs.h diff --git a/paroxysm/quake/ai.qc b/paroxysm/quake/ai.qc index c09d892..ea40076 100644 --- a/paroxysm/quake/ai.qc +++ b/paroxysm/quake/ai.qc @@ -3,7 +3,7 @@ void() t_movetarget; //void() knight_walk1; //void() knight_bow6; //void() knight_bow1; -void(entity etemp, entity stemp, entity stemp, float dmg) T_Damage; +void(entity targ, entity inflictor, entity attacker, float damage) T_Damage; /* .enemy diff --git a/paroxysm/quake/botgrab.qc b/paroxysm/quake/botgrab.qc index b4ec8bf..eb7a025 100644 --- a/paroxysm/quake/botgrab.qc +++ b/paroxysm/quake/botgrab.qc @@ -63,7 +63,7 @@ float(entity weap) bot_has_weapon = void() bot_grab_weapon = { - local float weap; + local float weap = 0; if (self.goalentity.weapon == IT_PLASMAGUN) { diff --git a/paroxysm/quake/botmain.qc b/paroxysm/quake/botmain.qc index b35d901..2d7643c 100644 --- a/paroxysm/quake/botmain.qc +++ b/paroxysm/quake/botmain.qc @@ -344,7 +344,7 @@ local float bold; //POX - touching a player can null him out (?) //POX - This was an early problem and this check is probably nolonger necessary due to increased item discrimination - if (!self.goalentity.flags & FL_ITEM) + if (!(self.goalentity.flags & FL_ITEM)) return; //POX - Shouldn't happen but... @@ -571,8 +571,8 @@ This function also doubles as an Attack Style Selection based on botprefs float() better_weapon = // ----------------------------------------- { -local float sweap; -local float eweap; +local float sweap = 0; +local float eweap = 0; //Attack Style - Rush @@ -1271,7 +1271,7 @@ void() bot_walk = //POX - This if statement fixed a few problems I have seen with these bots ignoring enemies, firing at walls... //POX - It just tells them to look for stuff if they aren't going after a bot, player, or item //POX - There must be something I missed elsewhere causing these guys to target junk they can't reach - if (self.goalentity.classname != "bot" || self.goalentity.classname != "player" || !self.goalentity.flags & FL_ITEM || self.goalentity.model == string_null) + if (self.goalentity.classname != "bot" || self.goalentity.classname != "player" || !(self.goalentity.flags & FL_ITEM) || self.goalentity.model == string_null) { self.goalentity = world; self.enemy = world; @@ -1445,7 +1445,7 @@ void() bot_run = return; //POX - A hacky fix to make sure these guys have a real target - if (self.goalentity.classname != "bot" || self.goalentity.classname != "player" || !self.goalentity.flags & FL_ITEM || self.goalentity.model == string_null) + if (self.goalentity.classname != "bot" || self.goalentity.classname != "player" || !(self.goalentity.flags & FL_ITEM) || self.goalentity.model == string_null) { self.goalentity = world; self.enemy = world; @@ -1610,8 +1610,6 @@ void() bot_set_currentammo = void() bot_check_ammo = // ------------------------- { -local float chance; - //if (self.currentammo > 0) // return; @@ -1869,7 +1867,6 @@ void() bot_fire_nailgun = //POX - Actually, this is the PlasmaGun // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { local vector dir; -local float r; if (self.weapon == IT_SUPER_NAILGUN) { @@ -2448,7 +2445,7 @@ void() bot_attack = if (time < self.attack_finished) { - bot_run1; + bot_run1 (); return; } @@ -2463,13 +2460,13 @@ void() bot_attack = else if (self.weapon == IT_COMBOGUN && random() > 0.4 && self.ammo_rockets > 1 && self.pball_finish < time && range(self.enemy) == RANGE_NEAR) { self.pball_finish = time + 0.9; - self.which_ammo == 1;//POX - needed for proper obituary + self.which_ammo = 1;//POX - needed for proper obituary bot_gren1(); } else if (self.weapon == IT_COMBOGUN) { self.attack_finished = time + 0.5; - self.which_ammo == 0;//POX - needed for proper obituary + self.which_ammo = 0;//POX - needed for proper obituary bot_shot1(); } //POX - MegaPlasma Burst (Plasma Gun Second Trigger) diff --git a/paroxysm/quake/botspawn.qc b/paroxysm/quake/botspawn.qc index fac7474..c70a69a 100644 --- a/paroxysm/quake/botspawn.qc +++ b/paroxysm/quake/botspawn.qc @@ -241,7 +241,7 @@ local entity spot; void(float teem) create_bot = // ------------------------------------------------ { -local entity bot, spot, plr; +local entity bot, spot; local float r, cno, sn, pn; //POX - NoBots option @@ -560,17 +560,17 @@ local float r; r = floor(random() * 3); if (r == 1 && random() > 0.5) - bot.botpref_attack == AS_RUSH; + bot.botpref_attack = AS_RUSH; else if (r == 2) - bot.botpref_attack == AS_RETREAT; + bot.botpref_attack = AS_RETREAT; else - bot.botpref_attack == AS_SMART; + bot.botpref_attack = AS_SMART; if (skill == 2 && random() >0.2) - bot.botpref_attack == AS_SMART; + bot.botpref_attack = AS_SMART; if (skill > 2) - bot.botpref_attack == AS_SMART; + bot.botpref_attack = AS_SMART; //POX - Best Weapon Pref r = random(); @@ -597,7 +597,7 @@ local float r; } if (skill > 2) - bot.botpref_react == 0.01; + bot.botpref_react = 0.01; }; diff --git a/paroxysm/quake/buttons.qc b/paroxysm/quake/buttons.qc index d85adc7..8db7ef6 100644 --- a/paroxysm/quake/buttons.qc +++ b/paroxysm/quake/buttons.qc @@ -88,8 +88,6 @@ When a button is touched, it moves some distance in the direction of it's angle, */ void() func_button = { -local float gtemp, ftemp; - if (self.sounds == 0) { precache_sound ("buttons/airbut1.wav"); diff --git a/paroxysm/quake/ccam.qc b/paroxysm/quake/ccam.qc index 216dd41..4c32308 100644 --- a/paroxysm/quake/ccam.qc +++ b/paroxysm/quake/ccam.qc @@ -67,7 +67,6 @@ void (float amount) CCamUp = }; void (float amount) CCamRight = { - local string aa; self.camview_y = self.camview_y + amount; if (self.camview_y < -8) self.camview_y = -8; diff --git a/paroxysm/quake/client.qc b/paroxysm/quake/client.qc index d4ea6e9..5dc5584 100644 --- a/paroxysm/quake/client.qc +++ b/paroxysm/quake/client.qc @@ -1,7 +1,7 @@ // prototypes void () W_WeaponFrame; void() W_SetCurrentAmmo; -void() player_pain; +void(entity attacker, float damage) player_pain; void() player_stand1; void (vector org) spawn_tfog; void (vector org, entity death_owner) spawn_tdeath; @@ -257,8 +257,6 @@ void() execute_changelevel = void() changelevel_touch = { - local entity pos; - if (other.classname != "player") return; @@ -843,7 +841,6 @@ void() CheckRules = void() PlayerDeathThink = { - local entity old_self; local float forward; if ((self.flags & FL_ONGROUND)) @@ -880,8 +877,6 @@ void() PlayerDeathThink = void() PlayerJump = { - local vector start, end; - if (self.flags & FL_WATERJUMP) return; @@ -1099,9 +1094,6 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float mspeed, aspeed; - local float r; - if (intermission_running) { IntermissionThink (); // otherwise a button could be missed between @@ -1349,9 +1341,6 @@ Called every frame after physics are run */ void() PlayerPostThink = { - local float mspeed, aspeed; - local float r; - if (time < 1.5) stuffcmd (self, "bf\n");//POX v1.2 - clear overrun v_cshifts! @@ -1458,7 +1447,7 @@ void() ClientConnect = //POX v.11 FINALLY nailed this one //Players have 30 seconds to join an LMS game, or they are put into observer till changelevel - if (!deathmatch & DM_LMS) + if (!(deathmatch & DM_LMS)) { bprint (self.netname); bprint (" entered the game\n"); @@ -1567,7 +1556,6 @@ void(entity targ, entity attacker) ClientObituary = { local float rnum; local string deathstring, deathstring2; - local entity nar; rnum = random(); //POX v1.2 - Changed this so obituary taunts work in DM_LMS diff --git a/paroxysm/quake/defs.qc b/paroxysm/quake/defs.qc index 6199e13..b64bca3 100644 --- a/paroxysm/quake/defs.qc +++ b/paroxysm/quake/defs.qc @@ -635,7 +635,7 @@ void() traceoff = #30; void(entity e) eprint = #31; // prints an entire edict float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE // #33 was removed -float(float yaw, float dist) droptofloor= #34; // TRUE if landed on floor +float() droptofloor= #34; // TRUE if landed on floor void(float style, string value) lightstyle = #35; float(float v) rint = #36; // round to nearest int float(float v) floor = #37; // largest integer <= v diff --git a/paroxysm/quake/doors.qc b/paroxysm/quake/doors.qc index ffeb112..8bce60a 100644 --- a/paroxysm/quake/doors.qc +++ b/paroxysm/quake/doors.qc @@ -593,7 +593,7 @@ void () fd_secret_use = if (!(self.spawnflags & SECRET_NO_SHOOT)) { - self.th_pain = SUB_Null; + //XXX nneded? self.th_pain = SUB_Null; self.takedamage = DAMAGE_NO; } self.velocity = '0 0 0'; @@ -627,6 +627,11 @@ void () fd_secret_use = sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); }; +void (entity attacker, float damage) fd_secret_pain = +{ + fd_secret_use (); +}; + // Wait after first movement... void () fd_secret_move1 = { @@ -680,7 +685,7 @@ void () fd_secret_done = { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; } sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); }; @@ -785,7 +790,7 @@ void () func_door_secret = { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; self.th_die = fd_secret_use; //POX v1.1 - missed this one... diff --git a/paroxysm/quake/dynlight.qc b/paroxysm/quake/dynlight.qc index dc58399..3e686d4 100644 --- a/paroxysm/quake/dynlight.qc +++ b/paroxysm/quake/dynlight.qc @@ -87,8 +87,6 @@ void() dynlight_use = void() dyn_light = { -local float eff; - precache_model ("progs/null.spr"); if ((self.dynlight_style < 1) || (self.dynlight_style > 3)) diff --git a/paroxysm/quake/hiprot.qc b/paroxysm/quake/hiprot.qc index 2c8a900..c326a65 100644 --- a/paroxysm/quake/hiprot.qc +++ b/paroxysm/quake/hiprot.qc @@ -1094,7 +1094,6 @@ void() rotate_door_group_reversedirection = void() rotate_door_use = { - local entity t; local vector start; if ( ( self.state != STATE_OPEN ) && ( self.state != STATE_CLOSED ) ) diff --git a/paroxysm/quake/items.qc b/paroxysm/quake/items.qc index b80ccf5..12155c8 100644 --- a/paroxysm/quake/items.qc +++ b/paroxysm/quake/items.qc @@ -164,7 +164,6 @@ void() item_health = void() health_touch = { - local float amount; local string s; if (other.classname != "player") @@ -314,7 +313,7 @@ float() W_BestWeapon; void() weapon_touch = { - local float hadammo, best, new, old; + local float hadammo, best, new = 0, old; local entity stemp; local float leave; @@ -843,9 +842,6 @@ KEYS void() key_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -979,9 +975,6 @@ END OF LEVEL RUNES void() sigil_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1053,9 +1046,6 @@ void() powerup_touch; void() powerup_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1341,7 +1331,7 @@ void() BackpackTouch = if (self.healamount) { if (!T_Heal(other, self.healamount, 0)) - SUB_Null; + SUB_Null (); else { if (acount) diff --git a/paroxysm/quake/kascam.qc b/paroxysm/quake/kascam.qc index 91a4cb5..2a603e8 100644 --- a/paroxysm/quake/kascam.qc +++ b/paroxysm/quake/kascam.qc @@ -190,7 +190,7 @@ entity() CamShoot = float(float d, float a) CamHurry = { - local float dd,t,tt; + local float t,tt; if (d<0) a = 0 - a; t = frametime; @@ -394,8 +394,7 @@ vector(entity ent) CamFlybyTarget = void(entity newtarg) CamInitFlybyMode = { local float f, max; - local vector vec, vec2, trg; - local entity ent; + local vector vec; // Keep camera at this point for some time... self.pausetime = time + 0.4; @@ -658,7 +657,6 @@ void() CamImpulses = { local float c; local entity ent; - local string s; //POX - Added so server rules are accessable in autocam mode if (self.impulse == 253) @@ -1005,7 +1003,6 @@ void() CamFlyByThink = local float p0,p1,grad,p; local vector vec; local entity ent; - local float ok; // self.dest1 is set to player // Check if the player is not dead @@ -1094,9 +1091,6 @@ void() CamFlyByThink = void() CamFollowThink = { - local entity ent; - local vector vec; - // Check player death if (self.enemy.deadflag != DEAD_NO) { if (time < 31) { @@ -1133,8 +1127,8 @@ void() CamFixedThink = local float maxlo; // maximum angle of lowers local float minhi; // minimum angle of highers local vector scrv; // onscreen origin sum - local vector hiv; // lower optimum - local vector lov; // higher optimum + local vector hiv = '0 0 0'; // lower optimum + local vector lov = '0 0 0'; // higher optimum local float c; cang = self.v_angle_y; @@ -1294,8 +1288,6 @@ void() CamThink = void() CamClientInit = { - local entity ent; - self.classname = "KasCam"; setmodel (self, string_null); self.weaponmodel = string_null; diff --git a/paroxysm/quake/misc.qc b/paroxysm/quake/misc.qc index 61cae7e..454433c 100644 --- a/paroxysm/quake/misc.qc +++ b/paroxysm/quake/misc.qc @@ -35,8 +35,6 @@ void() Laser_Touch = void(vector org, vector vec) LaunchLaser = { - local vector vec; - if (self.classname == "monster_enforcer") sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); @@ -287,7 +285,7 @@ void() misc_fireball = self.nextthink = time + (random() * 5); self.think = fire_fly; if (!self.speed) - self.speed == 1000; + self.speed = 1000; }; void() fire_fly = @@ -554,7 +552,6 @@ void() bubble_remove = void() bubble_bob = { local float rnd1, rnd2, rnd3; -local vector vtmp1, modi; self.cnt = self.cnt + 1; if (self.cnt == 4) @@ -643,7 +640,7 @@ void() func_illusionary = self.movetype = MOVETYPE_NONE; self.solid = SOLID_NOT; setmodel (self, self.model); - makestatic (); + makestatic (self); }; /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 diff --git a/paroxysm/quake/plats.qc b/paroxysm/quake/plats.qc index dfb183d..64a6999 100644 --- a/paroxysm/quake/plats.qc +++ b/paroxysm/quake/plats.qc @@ -160,8 +160,6 @@ Set "sounds" to one of the following: void() func_plat = { -local entity t; - if (!self.t_length) self.t_length = 80; if (!self.t_width) diff --git a/paroxysm/quake/player.qc b/paroxysm/quake/player.qc index bbbfb10..8bc9aae 100644 --- a/paroxysm/quake/player.qc +++ b/paroxysm/quake/player.qc @@ -614,7 +614,7 @@ void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; void() player_axpain6 = [ $axpain6, player_run ] {}; */ -void() player_pain = +void(entity attacker, float damage) player_pain = { if (self.weaponframe) return; diff --git a/paroxysm/quake/sectrig.qc b/paroxysm/quake/sectrig.qc index 13f9868..2e04a90 100644 --- a/paroxysm/quake/sectrig.qc +++ b/paroxysm/quake/sectrig.qc @@ -634,8 +634,6 @@ void(vector org) launch_shrapnel = void() ShrapnelExplode = { - local float n; - //POX v1.11 if (self.voided) return; @@ -833,12 +831,12 @@ void() W_SecondTrigger = { //already primed if (self.prime_tshot == TRUE) - SUB_Null; + SUB_Null (); //not enough ammo else if (self.ammo_shells < 3) { - SUB_Null; + SUB_Null (); } else { @@ -858,12 +856,12 @@ void() W_SecondTrigger = { //already reloaded if (self.reload_rocket == 0) - SUB_Null; + SUB_Null (); //if no rockets go away else if (self.ammo_rockets < 1) { - SUB_Null; + SUB_Null (); } else { @@ -908,7 +906,7 @@ void() W_SecondTrigger = } else - SUB_Null; + SUB_Null (); } // check for Super Shotgun second Trigger diff --git a/paroxysm/quake/specfx.qc b/paroxysm/quake/specfx.qc index d8f342d..ff095b2 100644 --- a/paroxysm/quake/specfx.qc +++ b/paroxysm/quake/specfx.qc @@ -485,7 +485,7 @@ void() colour_light = //Can be made active by use of a targetname //Must be triggered by touch - if((!self.targetname) || (!self.spawnflags & CLSTART_OFF)) + if((!self.targetname) || !(self.spawnflags & CLSTART_OFF)) self.touch = colourlight_use; else { diff --git a/paroxysm/quake/triggers.qc b/paroxysm/quake/triggers.qc index cf797f0..7107ced 100644 --- a/paroxysm/quake/triggers.qc +++ b/paroxysm/quake/triggers.qc @@ -226,8 +226,6 @@ void() trigger_secret = void() counter_use = { - local string junk; - self.count = self.count - 1; if (self.count < 0) return; diff --git a/paroxysm/quake/wall.qc b/paroxysm/quake/wall.qc index d94dc5b..51c23df 100644 --- a/paroxysm/quake/wall.qc +++ b/paroxysm/quake/wall.qc @@ -221,7 +221,7 @@ void () wall_killed = remove(self); }; -void() wall_pain = +void(entity attacker, float damage) wall_pain = { if(self.health > 0) self.health = self.max_health; diff --git a/paroxysm/quake/weapons.qc b/paroxysm/quake/weapons.qc index 90367b4..0b18b31 100644 --- a/paroxysm/quake/weapons.qc +++ b/paroxysm/quake/weapons.qc @@ -110,8 +110,7 @@ SpawnMeatSpray */ void(vector org, vector vel) SpawnMeatSpray = { - local entity missile, mpuff; - local vector org; + local entity missile; missile = spawn (); missile.owner = self; @@ -735,8 +734,6 @@ Start Plasma Gun Fire void() plasma_touch = { -local float rand; - if (other == self.owner) return; @@ -947,7 +944,6 @@ void(vector org, vector dir) launch_spike = void(float ox) W_FireNails = { local vector dir; - local entity old; self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels @@ -968,7 +964,6 @@ void(float ox) W_FireNails = void() W_FireSuperSpikes = { local vector dir; - local entity old; sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); //self.attack_finished = time + 0.15; @@ -985,7 +980,6 @@ void() W_FireSuperSpikes = void(float ox) W_FireSpikes = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -1305,7 +1299,7 @@ void() W_Attack = } else if (self.st_rocketload > time) // still reloading so do nothing { - SUB_Null; + SUB_Null (); } else { @@ -1323,7 +1317,7 @@ W_ChangeWeapon */ void() W_ChangeWeapon = { - local float it, am, fl; + local float it, am, fl = 0; it = self.items; am = 0; @@ -1347,7 +1341,7 @@ void() W_ChangeWeapon = { am = 1; //POX v1.1 - fix for dm_autoswitch - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) // allow player to select SuperShotgun if he has rockets + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) // allow player to select SuperShotgun if he has rockets { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; @@ -1465,7 +1459,7 @@ void() CycleWeaponCommand = { am = 1; //POX v1.1 - fix for dm_autoswitch - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) // allow player to select SuperShotgun if he has rockets + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) // allow player to select SuperShotgun if he has rockets { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; @@ -1552,7 +1546,7 @@ void() CycleWeaponReverseCommand = if (self.ammo_shells < 2) { am = 1; - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; @@ -1661,8 +1655,6 @@ void() DisplayRules = //POX - stuff added here, bot & camera impulses void() ImpulseCommands = { - local float cells; // used for underwater MegaPlasmaBurst - if (self.impulse >= 1 && self.impulse <= 8) W_ChangeWeapon (); if (self.impulse == 9) diff --git a/paroxysm/quake/world.qc b/paroxysm/quake/world.qc index 3807aa8..53f0cb6 100644 --- a/paroxysm/quake/world.qc +++ b/paroxysm/quake/world.qc @@ -425,8 +425,6 @@ void() bodyque = void() InitBodyQue = { - local entity e; - bodyque_head = spawn(); bodyque_head.classname = "bodyque"; bodyque_head.owner = spawn(); diff --git a/paroxysm/quakeworld/.gitignore b/paroxysm/quakeworld/.gitignore new file mode 100644 index 0000000..5b13a41 --- /dev/null +++ b/paroxysm/quakeworld/.gitignore @@ -0,0 +1,3 @@ +progdefs.h +*.dat +*.sym diff --git a/paroxysm/quakeworld/Makefile b/paroxysm/quakeworld/Makefile new file mode 100644 index 0000000..9d320a8 --- /dev/null +++ b/paroxysm/quakeworld/Makefile @@ -0,0 +1,5 @@ +all: qwprogs.dat +qwprogs.dat: progs.src *.qc + qfcc --traditional -Werror -g +clean: + rm -f core *.dat *.sym progdefs.h diff --git a/paroxysm/quakeworld/buttons.qc b/paroxysm/quakeworld/buttons.qc index c449961..3cb1299 100644 --- a/paroxysm/quakeworld/buttons.qc +++ b/paroxysm/quakeworld/buttons.qc @@ -85,8 +85,6 @@ When a button is touched, it moves some distance in the direction of it's angle, */ void() func_button = { -local float gtemp, ftemp; - if (self.sounds == 0) { precache_sound ("buttons/airbut1.wav"); diff --git a/paroxysm/quakeworld/client.qc b/paroxysm/quakeworld/client.qc index 7cfa79f..ce56640 100644 --- a/paroxysm/quakeworld/client.qc +++ b/paroxysm/quakeworld/client.qc @@ -2,7 +2,7 @@ // prototypes void () W_WeaponFrame; void() W_SetCurrentAmmo; -void() player_pain; +void(entity attacker, float damage) player_pain; void() player_stand1; void (vector org) spawn_tfog; void (vector org, entity death_owner) spawn_tdeath; @@ -192,8 +192,6 @@ void() execute_changelevel = void() changelevel_touch = { - local entity pos; - if (other.classname != "player") return; @@ -320,10 +318,9 @@ Returns the entity to spawn at */ entity() SelectSpawnPoint = { - local entity spot, newspot, thing; + local entity spot, thing; local float numspots, totalspots; - local float rnum, pcount; - local float rs; + local float pcount; local entity spots; numspots = 0; @@ -460,7 +457,6 @@ called each time a player enters a new level void() PutClientInServer = { local entity spot; - local string s; //POX v1.2 - remove items self.items = self.items - (self.items & @@ -726,7 +722,6 @@ go to the next level for deathmatch void() NextLevel = { local entity o; - local string newmap; // + POX if (deathmatch & DM_LMS) @@ -796,7 +791,7 @@ Exit deathmatch games upon conditions void() CheckRules = { //POX - LMS next level is taken care of in ClientObituary and ClientDisconnect - if (!deathmatch & DM_LMS) + if (!(deathmatch & DM_LMS)) { if (timelimit && time >= timelimit) NextLevel (); @@ -821,7 +816,6 @@ void() CheckRules = void() PlayerDeathThink = { - local entity old_self; local float forward; if ((self.flags & FL_ONGROUND)) @@ -864,8 +858,6 @@ void() PlayerDeathThink = void() PlayerJump = { - local vector start, end; - if (self.flags & FL_WATERJUMP) return; @@ -1095,9 +1087,6 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float mspeed, aspeed; - local float r; - if (intermission_running) { IntermissionThink (); // otherwise a button could be missed between @@ -1419,9 +1408,6 @@ Called every frame after physics are run */ void() PlayerPostThink = { - local float mspeed, aspeed; - local float r; - //POX v1.2 - clear overrun v_cshifts! if (time < 1.5) stuffcmd (self, "bf\n"); @@ -1507,7 +1493,7 @@ void() ClientConnect = //sprint (self, PRINT_HIGH, "\n\n---------------\nPOXworld v1.11b\n---------------\n\n"); // + POX LMS late joiners get booted to spectate - if (!deathmatch & DM_LMS) + if (!(deathmatch & DM_LMS)) { bprint (PRINT_HIGH, self.netname); bprint (PRINT_HIGH, " entered the game\n"); @@ -1594,7 +1580,6 @@ void(entity targ, entity attacker) ClientObituary = { local float rnum; local string deathstring, deathstring2; - local string s; local string attackerteam, targteam; rnum = random(); diff --git a/paroxysm/quakeworld/combat.qc b/paroxysm/quakeworld/combat.qc index 51a833b..9ce1fbc 100644 --- a/paroxysm/quakeworld/combat.qc +++ b/paroxysm/quakeworld/combat.qc @@ -111,7 +111,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage= local entity oldself; local float save; local float take; - local string s; local string attackerteam, targteam; diff --git a/paroxysm/quakeworld/defs.qc b/paroxysm/quakeworld/defs.qc index a58c7bf..5fe76b0 100644 --- a/paroxysm/quakeworld/defs.qc +++ b/paroxysm/quakeworld/defs.qc @@ -440,7 +440,7 @@ float teamplay; float timelimit; float fraglimit; float deathmatch; -float rj = 1; +float rj; //================================================ @@ -641,7 +641,7 @@ void() traceoff = #30; void(entity e) eprint = #31; // prints an entire edict float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE // #33 was removed -float(float yaw, float dist) droptofloor= #34; // TRUE if landed on floor +float() droptofloor= #34; // TRUE if landed on floor void(float style, string value) lightstyle = #35; float(float v) rint = #36; // round to nearest int float(float v) floor = #37; // largest integer <= v diff --git a/paroxysm/quakeworld/doors.qc b/paroxysm/quakeworld/doors.qc index 3f912c9..ddc6048 100644 --- a/paroxysm/quakeworld/doors.qc +++ b/paroxysm/quakeworld/doors.qc @@ -585,7 +585,7 @@ void () fd_secret_use = if (!(self.spawnflags & SECRET_NO_SHOOT)) { - self.th_pain = SUB_Null; + //XXX needed? self.th_pain = SUB_Null; self.takedamage = DAMAGE_NO; } self.velocity = '0 0 0'; @@ -619,6 +619,11 @@ void () fd_secret_use = sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); }; +void (entity attacker, float damage) fd_secret_pain = +{ + fd_secret_use (); +}; + // Wait after first movement... void () fd_secret_move1 = { @@ -672,7 +677,7 @@ void () fd_secret_done = { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; self.th_die = fd_secret_use; } sound(self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise3, 1, ATTN_NORM); @@ -780,7 +785,7 @@ void () func_door_secret = { self.health = 10000; self.takedamage = DAMAGE_YES; - self.th_pain = fd_secret_use; + self.th_pain = fd_secret_pain; // + POX self.nobleed = TRUE; diff --git a/paroxysm/quakeworld/dynlight.qc b/paroxysm/quakeworld/dynlight.qc index ed03871..9d037e1 100644 --- a/paroxysm/quakeworld/dynlight.qc +++ b/paroxysm/quakeworld/dynlight.qc @@ -91,8 +91,6 @@ void() dynlight_use = void() dyn_light = { -local float eff; - precache_model ("progs/null.spr"); if (!self.speed) diff --git a/paroxysm/quakeworld/hiprot.qc b/paroxysm/quakeworld/hiprot.qc index 2c8a900..c326a65 100644 --- a/paroxysm/quakeworld/hiprot.qc +++ b/paroxysm/quakeworld/hiprot.qc @@ -1094,7 +1094,6 @@ void() rotate_door_group_reversedirection = void() rotate_door_use = { - local entity t; local vector start; if ( ( self.state != STATE_OPEN ) && ( self.state != STATE_CLOSED ) ) diff --git a/paroxysm/quakeworld/items.qc b/paroxysm/quakeworld/items.qc index 033b1b6..c035b72 100644 --- a/paroxysm/quakeworld/items.qc +++ b/paroxysm/quakeworld/items.qc @@ -40,8 +40,6 @@ void() q_touch; void() q_touch = { -local entity stemp; -local float best; local string s; if (other.classname != "player") @@ -110,8 +108,6 @@ void() r_touch; void() r_touch = { -local entity stemp; -local float best; local string s; if (other.classname != "player") @@ -295,7 +291,6 @@ void() item_health = void() health_touch = { - local float amount; local string s; //if (deathmatch == 4) @@ -466,7 +461,7 @@ float() W_BestWeapon; void() weapon_touch = { - local float hadammo, best, new, old; + local float hadammo, best, new = 0, old; local entity stemp; local float leave; @@ -1068,9 +1063,6 @@ KEYS void() key_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1201,9 +1193,6 @@ END OF LEVEL RUNES void() sigil_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1276,9 +1265,6 @@ void() powerup_touch; void() powerup_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1594,7 +1580,7 @@ void() BackpackTouch = if (self.healamount) { if (!T_Heal(other, self.healamount, 0)) - SUB_Null; + SUB_Null (); else { if (acount) diff --git a/paroxysm/quakeworld/misc.qc b/paroxysm/quakeworld/misc.qc index ca8f79d..0e78d60 100644 --- a/paroxysm/quakeworld/misc.qc +++ b/paroxysm/quakeworld/misc.qc @@ -232,7 +232,7 @@ void() misc_fireball = self.nextthink = time + (random() * 5); self.think = fire_fly; if (!self.speed) - self.speed == 1000; + self.speed = 1000; }; void() fire_fly = @@ -396,8 +396,6 @@ void() Laser_Touch = void(vector org, vector vec) LaunchLaser = { - local vector vec; - if (self.classname == "monster_enforcer") sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); @@ -563,7 +561,6 @@ void() bubble_remove = void() bubble_bob = { local float rnd1, rnd2, rnd3; -local vector vtmp1, modi; self.cnt = self.cnt + 1; if (self.cnt == 4) @@ -652,7 +649,7 @@ void() func_illusionary = self.movetype = MOVETYPE_NONE; self.solid = SOLID_NOT; setmodel (self, self.model); - makestatic (); + makestatic (self); }; /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4 diff --git a/paroxysm/quakeworld/observe.qc b/paroxysm/quakeworld/observe.qc index 5648b01..8baeab0 100644 --- a/paroxysm/quakeworld/observe.qc +++ b/paroxysm/quakeworld/observe.qc @@ -33,7 +33,6 @@ ObserverTeleportTouch void(string destination) ObserverTeleportTouch = { local entity t; -local vector org; if (self.teleport_time > time) return; diff --git a/paroxysm/quakeworld/plats.qc b/paroxysm/quakeworld/plats.qc index e810187..16077aa 100644 --- a/paroxysm/quakeworld/plats.qc +++ b/paroxysm/quakeworld/plats.qc @@ -148,8 +148,6 @@ Set "sounds" to one of the following: void() func_plat = { -local entity t; - if (!self.t_length) self.t_length = 80; if (!self.t_width) diff --git a/paroxysm/quakeworld/player.qc b/paroxysm/quakeworld/player.qc index 1091d74..51f9019 100644 --- a/paroxysm/quakeworld/player.qc +++ b/paroxysm/quakeworld/player.qc @@ -527,7 +527,7 @@ void() player_axpain4 = [ $axpain4, player_axpain5 ] {}; void() player_axpain5 = [ $axpain5, player_axpain6 ] {}; void() player_axpain6 = [ $axpain6, player_run ] {}; -void() player_pain = +void(entity attacker, float damage) player_pain = { if (self.weaponframe) return; diff --git a/paroxysm/quakeworld/sectrig.qc b/paroxysm/quakeworld/sectrig.qc index 8a2d041..6fe58a0 100644 --- a/paroxysm/quakeworld/sectrig.qc +++ b/paroxysm/quakeworld/sectrig.qc @@ -606,8 +606,6 @@ void(vector org) launch_shrapnel = void() ShrapnelExplode = { - local float n; - if (self.voided) { return; } @@ -808,12 +806,12 @@ void() W_SecondTrigger = { //already primed if (self.prime_tshot == TRUE) - SUB_Null; + SUB_Null (); //not enough ammo else if (self.ammo_shells < 3) { - SUB_Null; + SUB_Null (); } else { @@ -833,12 +831,12 @@ void() W_SecondTrigger = { //already reloaded if (self.reload_rocket == 0) - SUB_Null; + SUB_Null (); //if no rockets go away else if (self.ammo_rockets < 1) { - SUB_Null; + SUB_Null (); } else { @@ -883,7 +881,7 @@ void() W_SecondTrigger = } else - SUB_Null; + SUB_Null (); } // check for Super Shotgun second Trigger diff --git a/paroxysm/quakeworld/specfx.qc b/paroxysm/quakeworld/specfx.qc index 053e17d..054d692 100644 --- a/paroxysm/quakeworld/specfx.qc +++ b/paroxysm/quakeworld/specfx.qc @@ -291,7 +291,7 @@ void() colour_light = //Can be made active by use of a targetname //Must be triggered by touch - if((!self.targetname) || (!self.spawnflags & CLSTART_OFF)) + if((!self.targetname) || !(self.spawnflags & CLSTART_OFF)) self.touch = colourlight_use; else { diff --git a/paroxysm/quakeworld/triggers.qc b/paroxysm/quakeworld/triggers.qc index 7a5df7c..bc1fb79 100644 --- a/paroxysm/quakeworld/triggers.qc +++ b/paroxysm/quakeworld/triggers.qc @@ -226,8 +226,6 @@ void() trigger_secret = void() counter_use = { - local string junk; - self.count = self.count - 1; if (self.count < 0) return; diff --git a/paroxysm/quakeworld/wall.qc b/paroxysm/quakeworld/wall.qc index 4e2ecf9..5805f94 100644 --- a/paroxysm/quakeworld/wall.qc +++ b/paroxysm/quakeworld/wall.qc @@ -258,7 +258,7 @@ void () wall_killed = remove(self); }; -void() wall_pain = +void(entity attacker, float damage) wall_pain = { if(self.health > 0) self.health = self.max_health; diff --git a/paroxysm/quakeworld/weapons.qc b/paroxysm/quakeworld/weapons.qc index da3d0a4..63524e2 100644 --- a/paroxysm/quakeworld/weapons.qc +++ b/paroxysm/quakeworld/weapons.qc @@ -97,7 +97,6 @@ SpawnMeatSpray void(vector org, vector vel) SpawnMeatSpray = { local entity missile; - local vector org; missile = spawn (); missile.owner = self; @@ -631,7 +630,6 @@ void() W_FireGrenade = void() plasma_touch = { -local float rand; if (other == self.owner) return; @@ -694,7 +692,6 @@ void(vector org, vector dir) launch_plasma = void(float ox) W_FirePlasma = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -714,7 +711,6 @@ void(float ox) W_FirePlasma = //=========================================================================== void() spike_touch = { -local float rand; if (other == self.owner) return; @@ -755,7 +751,6 @@ local float rand; void() superspike_touch = { -local float rand; if (other == self.owner) return; @@ -828,7 +823,6 @@ void(vector org, vector dir) launch_spike = void(float ox) W_FireNails = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -849,7 +843,6 @@ void(float ox) W_FireNails = void() W_FireSuperSpikes = { local vector dir; - local entity old; sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); self.attack_finished = time + 0.2; @@ -867,7 +860,6 @@ void() W_FireSuperSpikes = void(float ox) W_FireSpikes = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -1157,7 +1149,7 @@ void() W_Attack = } else if (self.st_rocketload > time) // still reloading so do nothing { - SUB_Null; + SUB_Null (); } else { @@ -1174,7 +1166,7 @@ W_ChangeWeapon */ void() W_ChangeWeapon = { - local float it, am, fl; + local float it, am, fl = 0; it = self.items; am = 0; @@ -1196,7 +1188,7 @@ void() W_ChangeWeapon = if (self.ammo_shells < 2) { am = 1; - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) // allow player to select SuperShotgun if he has rockets + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) // allow player to select SuperShotgun if he has rockets { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; @@ -1295,7 +1287,7 @@ void() CycleWeaponCommand = if (self.ammo_shells < 2) { am = 1; - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) // allow player to select SuperShotgun if he has rockets + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) // allow player to select SuperShotgun if he has rockets { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; @@ -1383,7 +1375,7 @@ void() CycleWeaponReverseCommand = if (self.ammo_shells < 2) { am = 1; - if (self.ammo_rockets > 0 && !deathmatch & DM_AUTOSWITCH) + if (self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) { self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells am = 0; diff --git a/paroxysm/quakeworld/world.qc b/paroxysm/quakeworld/world.qc index cd7c69e..b969f32 100644 --- a/paroxysm/quakeworld/world.qc +++ b/paroxysm/quakeworld/world.qc @@ -174,6 +174,8 @@ void() worldspawn = lastspawn = world; InitBodyQue (); + rj = 1; + // custom map attributes if (self.model == "maps/e1m8.bsp") @@ -431,8 +433,6 @@ void() bodyque = void() InitBodyQue = { - local entity e; - bodyque_head = spawn(); bodyque_head.classname = "bodyque"; bodyque_head.owner = spawn();