fix some more uninitialized vars found by qfcc

This commit is contained in:
Bill Currie 2001-10-19 03:31:30 +00:00
parent 23d81b1e8c
commit c01e44c7a4
12 changed files with 21 additions and 22 deletions

8
ai.qc
View file

@ -711,11 +711,9 @@ float() FindTarget =
if (!client)
return FALSE; // current check entity isn't in PVS
} */
if (random() < 0.6) // don't always look around to save processor power
client = LookAround(self); // search for targets
else
return FALSE; //WK They missed a base condition here.*/
// SB they did not miss a base condition, LookAround returns self if none
if (random() >= 0.6) // don't always look around to save processor power
return FALSE;
client = LookAround(self); // search for targets
if (client == self)
return FALSE;

View file

@ -102,8 +102,8 @@ float() DoorShouldOpen =
{
local entity ptr;
local float plyrcount;
local entity plyr1;
local entity plyr2;
local entity plyr1 = NIL;
local entity plyr2 = NIL;
if (coop != 2)
return TRUE;

View file

@ -531,7 +531,7 @@ float(entity obj, entity builder) CheckArea =
// rehashed version of TF_Build
void(float objtobuild) TeamFortress_Build =
{
local float btime;
local float btime = time - 0.1;
local entity obj;
obj = spawn();

View file

@ -332,7 +332,7 @@ ARMOR
void() armor_touch =
{
local float type, value, bit = 0;
local float type = 0, value = 0, bit = 0;
local string s;
local entity oldself;
@ -662,7 +662,8 @@ float() W_BestWeapon;
void() weapon_touch =
{
local float hadammo, best, new, old;
local float hadammo, best, old;
local float new = 0; //XXX needed until qfcc has "noreturn"
local entity stemp;
local float leave;

View file

@ -253,7 +253,7 @@ void() ConcussionGrenadeTimer =
void(float scanrange,float inAuto) TeamFortress_Scan =
{
local string power;
local entity list;
local entity list = NIL;
local float scen, scfr;
local vector lightningvec;

View file

@ -602,7 +602,7 @@ void(float res) StatusRes =
string(entity pl) ClipSizeToString100 =
//CH edited b/c nothing has over 20
{
local float num;
local float num = 0; //XXX qfcc isn't smart enough for the return yet
if (pl.current_weapon == WEAP_SHOTGUN)
{

View file

@ -405,7 +405,7 @@ float (vector where) DoorsAt =
float() Tesla_Fire =
{
local float damage;
local float damage = 0;
local float cheater = FALSE;
local vector below;

View file

@ -1007,7 +1007,7 @@ void() TeamFortress_GrenadePrimed;
// Primes a grenade of the type corresponding to the player's impulse
void() TeamFortress_PrimeGrenade =
{
local float gtype;
local float gtype = GR_TYPE_NONE;
local string gs, ptime;
local entity tGrenade;
@ -1461,7 +1461,7 @@ void() TeamFortress_ThrowGrenade =
// Return TRUE is this class is allowed on this map
float(float pc) IsLegalClass =
{
local float bit;
local float bit = 0;
// Spy may be turned off
if (spy_off == TRUE && pc == PC_SPY)
@ -2942,7 +2942,7 @@ void() TeamFortress_CheckClassStats =
// Throw an ammo box with 10 shells, 10 nails, 5 cells or 5 rockets
void (float type) TeamFortress_DropAmmo =
{
local float ammo;
local float ammo = 0;
if (type == 1)
{

View file

@ -1090,7 +1090,7 @@ float (entity targ, entity attacker, float damage) TeamEqualiseDamage =
if (Teammate(targ.team_no, attacker.team_no))
return damage;
local float adv, newdam;
local float adv = 0, newdam;
// increase damage done by attacker's team advantage
if (attacker.team_no == 1)

View file

@ -19,7 +19,7 @@ void () BadTinker = {
};
void () DoTinker = {
local float prob, thresh, enough;
local float prob, thresh, enough = FALSE;
if (self.building.has_sentry > 0) {
sprint(self,PRINT_HIGH,"You have to fully upgrade before tinkering\n");

View file

@ -391,7 +391,7 @@ void(float inp) Menu_Demon_Input =
//Returns a random name for a demon, or pulls it from one's localinfo
void(entity demon) custom_demon_name =
{
local string happy;
local string happy = "FIXME:custom_demon_name";
local float r;
// Why doesn't this work? When people set their own names,

View file

@ -255,7 +255,7 @@ void() W_FireAxe =
{
local vector source;
local vector org, def;
local vector dir;
local vector dir = NIL; //XXX false +ve on uninit
if (self.classname == "player")
makevectors(self.v_angle);
@ -1715,7 +1715,7 @@ W_FireRocket
void() W_FireRocket =
{
local float loops;
local vector olorigin, dir;
local vector olorigin, dir = NIL; //XXX false +ve for dir
loops = 0;
if (self.tf_items & NIT_CLUSTER_ROCKETS && self.cluster_mode == TRUE)
loops = 5;
@ -4752,7 +4752,7 @@ Combination conc, krac and RL
#define BOUNCE 120
void() T_DaedalusTouch =
{
local float points;
local float points = 0; //XXX false +ve
local vector org;
local entity head;