diff --git a/ctf/src/Makefile b/ctf/src/Makefile new file mode 100644 index 0000000..fefb58a --- /dev/null +++ b/ctf/src/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/ctf/src/buttons.qc b/ctf/src/buttons.qc index b9de60e..0021bf3 100644 --- a/ctf/src/buttons.qc +++ b/ctf/src/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/src/client.qc b/ctf/src/client.qc index 04cb464..34e2ab4 100644 --- a/ctf/src/client.qc +++ b/ctf/src/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; @@ -388,7 +388,6 @@ void() execute_changelevel = void() changelevel_touch = { - local entity pos; local float noexit; if (other.classname != "player") @@ -887,7 +886,6 @@ void() CheckRules = void() PlayerDeathThink = { - local entity old_self; local float forward; if ((self.flags & FL_ONGROUND)) @@ -922,8 +920,6 @@ void() PlayerDeathThink = void() PlayerJump = { - local vector start, end; - if (self.flags & FL_WATERJUMP) return; @@ -1095,10 +1091,6 @@ Called every frame before physics are run */ void() PlayerPreThink = { - local float mspeed, aspeed; - local float r; - local string s; - if (intermission_running) { IntermissionThink (); // otherwise a button could be missed between @@ -1359,11 +1351,6 @@ Called every frame after physics are run */ void() PlayerPostThink = { - local float mspeed, aspeed; - local float r; - local string num; - - if (self.view_ofs == '0 0 0') return; // intermission or finale @@ -1765,6 +1752,7 @@ void(entity targ, entity attacker) ClientObituary = // offset the one frag penalty for dying. TeamDeathPenalty(targ, attacker); + what = deathstring = deathstring2 = "uninit"; rnum = attacker.weapon; if (rnum == IT_AXE) { diff --git a/ctf/src/ctfgame.qc b/ctf/src/ctfgame.qc index 27b87e5..2d68e5a 100644 --- a/ctf/src/ctfgame.qc +++ b/ctf/src/ctfgame.qc @@ -161,8 +161,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/src/defs.qc b/ctf/src/defs.qc index 4bbe5eb..3c4086b 100644 --- a/ctf/src/defs.qc +++ b/ctf/src/defs.qc @@ -683,7 +683,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/src/doors.qc b/ctf/src/doors.qc index aa7c360..0a4b55a 100644 --- a/ctf/src/doors.qc +++ b/ctf/src/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,8 @@ 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_VOICE, self.noise3, 1, ATTN_NORM); }; @@ -798,7 +804,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/src/ident.qc b/ctf/src/ident.qc index 5538811..7bbdd9b 100644 --- a/ctf/src/ident.qc +++ b/ctf/src/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/src/items.qc b/ctf/src/items.qc index 9c876d5..b3d1353 100644 --- a/ctf/src/items.qc +++ b/ctf/src/items.qc @@ -173,7 +173,6 @@ void() item_health = void() health_touch = { - local float amount; local string s; if (other.classname != "player") @@ -265,7 +264,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; @@ -440,7 +439,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 @@ -943,9 +942,6 @@ KEYS void() key_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1079,9 +1075,6 @@ END OF LEVEL RUNES void() sigil_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1152,9 +1145,6 @@ void() powerup_touch; void() powerup_touch = { -local entity stemp; -local float best; - if (other.classname != "player") return; if (other.health <= 0) @@ -1483,10 +1473,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/src/misc.qc b/ctf/src/misc.qc index 16820d2..8f69f7a 100644 --- a/ctf/src/misc.qc +++ b/ctf/src/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 = @@ -352,8 +352,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); @@ -528,7 +526,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) @@ -620,7 +617,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/src/observ.qc b/ctf/src/observ.qc index bf6ecf2..3b47f8b 100644 --- a/ctf/src/observ.qc +++ b/ctf/src/observ.qc @@ -32,7 +32,7 @@ void(entity player,entity door) ObserverDoor = local entity d,d_master; local vector dmin,dmax; local float is_x,is_y,is_z,set; - local vector dir,or; + local vector dir = '0 0 0',or; d_master = d = door.owner; if (d_master) { @@ -169,14 +169,13 @@ float() DoObserverImpulse = void () ObserverThink = { local entity e; - local float cont; self.weaponmodel = ""; self.weaponframe = 0; self.flags = self.flags | FL_ONGROUND; { - local float invcos,nv,nvp,nvpmax,nvs,nsp,sp,svz; + local float invcos,nvp,nvpmax,sp,svz; local vector f,vp,vs; svz = self.velocity_z * 0.75; diff --git a/ctf/src/plats.qc b/ctf/src/plats.qc index 0966737..714bcdb 100644 --- a/ctf/src/plats.qc +++ b/ctf/src/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/src/player.qc b/ctf/src/player.qc index 7dfb3fd..1259d12 100644 --- a/ctf/src/player.qc +++ b/ctf/src/player.qc @@ -396,7 +396,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/src/status.qc b/ctf/src/status.qc index 87acad0..38035ef 100644 --- a/ctf/src/status.qc +++ b/ctf/src/status.qc @@ -202,7 +202,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/src/teamplay.qc b/ctf/src/teamplay.qc index fe1b87f..2964b2a 100644 --- a/ctf/src/teamplay.qc +++ b/ctf/src/teamplay.qc @@ -712,7 +712,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)) @@ -912,7 +912,6 @@ void () TeamCaptureRegenFlags = void(entity flg) TeamDropFlag = { - local entity item, f, oself; local entity p; p = flg.owner; @@ -961,7 +960,7 @@ void(entity player) TeamCaptureDropFlagOfPlayer = void() TeamCaptureFlagTouch = { - local entity p, oself; + local entity p; if (other.classname != "player") return; @@ -1107,7 +1106,6 @@ void() TeamCaptureFlagThink = local entity e; local vector v; local float f; - local string s; self.nextthink = time + 0.1; diff --git a/ctf/src/triggers.qc b/ctf/src/triggers.qc index 126910d..011f965 100644 --- a/ctf/src/triggers.qc +++ b/ctf/src/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/src/weapons.qc b/ctf/src/weapons.qc index 8fb8ef2..a2601f1 100644 --- a/ctf/src/weapons.qc +++ b/ctf/src/weapons.qc @@ -133,8 +133,7 @@ SpawnMeatSpray */ void(vector org, vector vel) SpawnMeatSpray = { - local entity missile, mpuff; - local vector org; + local entity missile; missile = spawn (); missile.owner = self; @@ -418,7 +417,7 @@ W_FireRocket */ void() W_FireRocket = { - local entity missile, mpuff; + local entity missile; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; @@ -593,7 +592,7 @@ W_FireGrenade */ void() W_FireGrenade = { - local entity missile, mpuff; + local entity missile; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; @@ -672,7 +671,6 @@ void(vector org, vector dir, float spd) 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; @@ -692,7 +690,6 @@ void() W_FireSuperSpikes = void(float ox) W_FireSpikes = { local vector dir; - local entity old; makevectors (self.v_angle); @@ -727,7 +724,6 @@ void(float ox) W_FireSpikes = .float hit_z; void() spike_touch = { -local float rand; if (other == self.owner) return; @@ -767,7 +763,6 @@ local float rand; void() superspike_touch = { -local float rand; if (other == self.owner) return; @@ -1052,7 +1047,7 @@ W_ChangeWeapon */ void() W_ChangeWeapon = { - local float it, am, fl; + local float it, am, fl = 0; it = self.items; am = 0; @@ -1452,7 +1447,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/src/world.qc b/ctf/src/world.qc index ea071fd..7a1b307 100644 --- a/ctf/src/world.qc +++ b/ctf/src/world.qc @@ -399,8 +399,6 @@ void() bodyque = void() InitBodyQue = { - local entity e; - bodyque_head = spawn(); bodyque_head.classname = "bodyque"; bodyque_head.owner = spawn();