diff --git a/ctf/qwsrc/Makefile b/ctf/qwsrc/Makefile new file mode 100644 index 0000000..9d320a8 --- /dev/null +++ b/ctf/qwsrc/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/ctf/qwsrc/buttons.qc b/ctf/qwsrc/buttons.qc index b9de60e..0021bf3 100644 --- a/ctf/qwsrc/buttons.qc +++ b/ctf/qwsrc/buttons.qc @@ -109,8 +109,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/ctf/qwsrc/client.qc b/ctf/qwsrc/client.qc index 9f1b326..a6a6920 100644 --- a/ctf/qwsrc/client.qc +++ b/ctf/qwsrc/client.qc @@ -26,7 +26,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; @@ -306,8 +306,6 @@ void() execute_changelevel = void() changelevel_touch = { - local entity pos; - if (other.classname != "player") return; @@ -430,8 +428,7 @@ Returns the entity to spawn at */ entity() SelectSpawnPoint = { - local entity spot, thing; - local float pcount; + local entity spot; // testinfo_player_start is only found in regioned levels spot = find (world, classname, "testplayerstart"); @@ -811,7 +808,6 @@ void() CheckRules = void() PlayerDeathThink = { - local entity old_self; local float forward; if ((self.flags & FL_ONGROUND)) @@ -846,8 +842,6 @@ void() PlayerDeathThink = void() PlayerJump = { - local vector start, end; - if (self.flags & FL_WATERJUMP) return; @@ -1006,9 +1000,6 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float mspeed, aspeed; - local float r; - if (intermission_running > 0) { IntermissionThink (); // otherwise a button could be missed between @@ -1260,9 +1251,6 @@ Called every frame after physics are run */ void() PlayerPostThink = { - local float mspeed, aspeed; - local float r; - //dprint ("post think\n"); if (self.view_ofs == '0 0 0') return; // intermission or finale @@ -1610,6 +1598,7 @@ void(entity targ, entity attacker) ClientObituary = // offset the one frag penalty for dying. TeamDeathPenalty(targ, attacker); + deathstring = deathstring2 = "uninit"; rnum = attacker.weapon; if (rnum == IT_AXE) { diff --git a/ctf/qwsrc/ctfgame.qc b/ctf/qwsrc/ctfgame.qc index aff9019..efc0fb7 100644 --- a/ctf/qwsrc/ctfgame.qc +++ b/ctf/qwsrc/ctfgame.qc @@ -162,8 +162,6 @@ create an object with a "targetname" field that matches. */ void() trigger_voteexit = { - local vector o; - InitTrigger (); self.touch = voteexit_touch; self.cnt = 0; diff --git a/ctf/qwsrc/defs.qc b/ctf/qwsrc/defs.qc index 8e6e2a2..686b77d 100644 --- a/ctf/qwsrc/defs.qc +++ b/ctf/qwsrc/defs.qc @@ -715,7 +715,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/ctf/qwsrc/doors.qc b/ctf/qwsrc/doors.qc index 72b3dbb..ed5b5c7 100644 --- a/ctf/qwsrc/doors.qc +++ b/ctf/qwsrc/doors.qc @@ -606,7 +606,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'; @@ -640,6 +640,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 = { @@ -693,7 +698,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); @@ -798,7 +803,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; } self.oldorigin = self.origin; diff --git a/ctf/qwsrc/grapple.qc b/ctf/qwsrc/grapple.qc index 6dbe0c2..d6a1c88 100644 --- a/ctf/qwsrc/grapple.qc +++ b/ctf/qwsrc/grapple.qc @@ -114,7 +114,7 @@ void () Grapple_Track = // // MakeLink - spawns the chain link entities // -entity (float head) MakeLink = +entity () MakeLink = { newmis = spawn (); @@ -254,8 +254,6 @@ float () Check_Overhead = // void () Anchor_Grapple = { - local float test; - if (other == self.owner) return; @@ -393,7 +391,7 @@ void () Throw_Grapple = // void () Service_Grapple = { - local vector hook_dir; + local vector hook_dir = '0 0 0'; // drop the hook if player lets go of button if (!self.button0) diff --git a/ctf/qwsrc/ident.qc b/ctf/qwsrc/ident.qc index 5538811..7bbdd9b 100644 --- a/ctf/qwsrc/ident.qc +++ b/ctf/qwsrc/ident.qc @@ -35,7 +35,7 @@ entity(float disp) identify_player = { // e is a temp entity; guy is our current best guess // as to at whom the player is pointing - local entity e, guy; + local entity e, guy = world; // The best "closeness" heuristic so far. local float closeness = -1; @@ -43,7 +43,6 @@ entity(float disp) identify_player = // Temp vars. local vector diff, point; local float currclose; - local string s1, s2, s3; // Walk the list of players... e=find(world, classname, "player"); diff --git a/ctf/qwsrc/items.qc b/ctf/qwsrc/items.qc index a188414..ea2880f 100644 --- a/ctf/qwsrc/items.qc +++ b/ctf/qwsrc/items.qc @@ -173,7 +173,6 @@ void() item_health = void() health_touch = { - local float amount; local string s; if (other.classname != "player") @@ -261,7 +260,7 @@ void() armor_touch; void() armor_touch = { - local float type, value, bit; + local float type = 0, value = 0, bit = 0; if (other.health <= 0) return; @@ -435,7 +434,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; //McBain: added prevweapon local variable @@ -936,9 +935,6 @@ KEYS void() key_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1069,9 +1065,6 @@ END OF LEVEL RUNES void() sigil_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1142,9 +1135,6 @@ void() powerup_touch; void() powerup_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1294,7 +1284,7 @@ void() BackpackTouch = local float best, old, new; local entity stemp; local float acount; - local float b_switch; + local float b_switch = 0; // XXX eh? if (other.classname != "player") return; @@ -1478,10 +1468,6 @@ entity() SelectRuneSpawnPoint = void() RuneTouch = { - local string s; - local float best; - local entity stemp; - if (other.classname != "player") return; if (other.health <= 0) diff --git a/ctf/qwsrc/misc.qc b/ctf/qwsrc/misc.qc index d70b3e3..b767189 100644 --- a/ctf/qwsrc/misc.qc +++ b/ctf/qwsrc/misc.qc @@ -200,7 +200,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 = @@ -355,8 +355,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); @@ -524,7 +522,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) @@ -616,7 +613,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/ctf/qwsrc/plats.qc b/ctf/qwsrc/plats.qc index 2b5968b..aa1ca0a 100644 --- a/ctf/qwsrc/plats.qc +++ b/ctf/qwsrc/plats.qc @@ -174,8 +174,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/ctf/qwsrc/player.qc b/ctf/qwsrc/player.qc index 524e4a2..dfa3e26 100644 --- a/ctf/qwsrc/player.qc +++ b/ctf/qwsrc/player.qc @@ -402,7 +402,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/ctf/qwsrc/status.qc b/ctf/qwsrc/status.qc index 103c1e7..31a1bf6 100644 --- a/ctf/qwsrc/status.qc +++ b/ctf/qwsrc/status.qc @@ -199,7 +199,7 @@ void() TeamCapturePlayerUpdate = if (vote_leader == world) centerprint2(self, res, " Choose an exit..."); else { - res = TeamSetStatRes2(); + res = TeamSetStatRes2(vote_leader); n = ftos(voteexit_time - time); centerprint5(self, res, vote_leader.message, " leads\n", n, " seconds until exit"); diff --git a/ctf/qwsrc/teamplay.qc b/ctf/qwsrc/teamplay.qc index 7f0c55f..621ef59 100644 --- a/ctf/qwsrc/teamplay.qc +++ b/ctf/qwsrc/teamplay.qc @@ -518,7 +518,7 @@ Check for team changing and perform whatever actions are neccessary. void() TeamCheckLock = { local float n; - local string s, t; + local string s; local float pteam; // Don't do anything if teamplay is negative @@ -827,7 +827,7 @@ void() TossBackpack = void() Team_weapon_touch = { - local float hadammo, best, new, old; + local float hadammo, best, new = 0, old; local entity stemp; if (!(other.flags & FL_CLIENT)) @@ -1028,7 +1028,6 @@ void () TeamCaptureRegenFlags = void(entity flg) TeamDropFlag = { - local entity item, f, oself; local entity p; p = flg.owner; @@ -1139,7 +1138,7 @@ void() LoopThroughPlayersAfterCapture = void() TeamCaptureFlagTouch = { - local entity p, oself; + local entity p; if (other.classname != "player") return; @@ -1234,11 +1233,6 @@ void() TeamCaptureFlagTouch = void() TeamCaptureFlagThink = { - local entity e; - local vector v; - local float f; - local string s; - self.nextthink = time + 0.1; if (self.cnt == FLAG_AT_BASE) diff --git a/ctf/qwsrc/triggers.qc b/ctf/qwsrc/triggers.qc index 1911908..d78a10a 100644 --- a/ctf/qwsrc/triggers.qc +++ b/ctf/qwsrc/triggers.qc @@ -245,8 +245,6 @@ void() trigger_secret = void() counter_use = { - local string junk; - self.count = self.count - 1; if (self.count < 0) return; diff --git a/ctf/qwsrc/weapons.qc b/ctf/qwsrc/weapons.qc index 7f26124..083dd5b 100644 --- a/ctf/qwsrc/weapons.qc +++ b/ctf/qwsrc/weapons.qc @@ -139,7 +139,6 @@ SpawnMeatSpray void(vector org, vector vel) SpawnMeatSpray = { local entity missile; - local vector org; missile = spawn (); missile.owner = self; @@ -716,7 +715,6 @@ void(vector org, vector dir) launch_spike = 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; @@ -734,7 +732,6 @@ void() W_FireSuperSpikes = void(float ox) W_FireSpikes = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -766,7 +763,6 @@ void(float ox) W_FireSpikes = .float hit_z; void() spike_touch = { -local float rand; if (other == self.owner) return; @@ -811,7 +807,6 @@ local float rand; void() superspike_touch = { -local float rand; if (other == self.owner) return; @@ -1101,7 +1096,7 @@ W_ChangeWeapon */ void() W_ChangeWeapon = { - local float it, am, fl; + local float it, am, fl = 0; it = self.items; am = 0; @@ -1438,7 +1433,7 @@ void() ImpulseCommands = TeamFlagStatusReport(); else if (self.impulse == 141) - identify_player(); + identify_player(1); else if (self.impulse == 70) { if (self.statstate < 0) { diff --git a/ctf/qwsrc/world.qc b/ctf/qwsrc/world.qc index cc1788c..dd12e96 100644 --- a/ctf/qwsrc/world.qc +++ b/ctf/qwsrc/world.qc @@ -400,8 +400,6 @@ void() bodyque = void() InitBodyQue = { - local entity e; - bodyque_head = spawn(); bodyque_head.classname = "bodyque"; bodyque_head.owner = spawn();