From 638da49aa93f1d8dc018be4eaf1af12918ce1aa6 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 18 Feb 2003 23:12:03 +0000 Subject: [PATCH] qfcc fixes --- fbxa/bot_ai.qc | 3 +- fbxa/bot_fight.qc | 8 ++-- fbxa/bot_misc.qc | 4 +- fbxa/bot_move.qc | 10 ++--- fbxa/bot_phys.qc | 14 +++---- fbxa/bot_qw.qc | 102 +++++++++++++++++++++++----------------------- fbxa/bot_way.qc | 6 +-- fbxa/map_dm1.qc | 2 +- fbxa/map_dm2.qc | 2 +- fbxa/map_dm4.qc | 2 +- fbxa/map_dm5.qc | 2 +- fbxa/map_dm6.qc | 2 +- 12 files changed, 77 insertions(+), 80 deletions(-) diff --git a/fbxa/bot_ai.qc b/fbxa/bot_ai.qc index f5bcde6..ef78fd6 100644 --- a/fbxa/bot_ai.qc +++ b/fbxa/bot_ai.qc @@ -503,7 +503,6 @@ void() bot_path = { local entity jj, tele; - local vector org; bot_check_lost(self.target1); if (!self.target1) @@ -723,7 +722,7 @@ float(entity thing) priority_for_thing = void(float scope) bot_look_for_crap = { - local entity foe, best; + local entity foe, best = world; local float thatp, bestp, dist; if (scope == 1) diff --git a/fbxa/bot_fight.qc b/fbxa/bot_fight.qc index 8098b9f..8f8383e 100644 --- a/fbxa/bot_fight.qc +++ b/fbxa/bot_fight.qc @@ -77,7 +77,7 @@ float(entity e) bot_size_player = void() bot_dodge_stuff = { local entity foe; - local float foedist, avdist, scandist, foesz, flen, tsz; + local float foedist, avdist, scandist = 0, foesz, flen, tsz; local vector v; if (waypoint_mode > WM_LOADED) @@ -258,7 +258,7 @@ Pick a weapon based on range / ammo void(float brange) bot_weapon_switch = { - local float it, flag, pulse; + local float it, flag = 0, pulse = 0; local vector v; it = self.items & 127; @@ -352,7 +352,7 @@ attacking an enemy. void() bot_fight_style = { - local vector v, v1, v2, org; + local vector v, v1 = '0 0 0', v2 = '0 0 0', org; local float foedist, mysz, foesz; @@ -430,7 +430,7 @@ void() bot_fight_style = else frik_walkmove(v1); } - else if (!self.enemy.flags & FL_MONSTER) + else if (!(self.enemy.flags & FL_MONSTER)) { if (foedist + 32 < v_x) frik_walkmove(self.origin - org); diff --git a/fbxa/bot_misc.qc b/fbxa/bot_misc.qc index 31d37e2..1b21ddb 100644 --- a/fbxa/bot_misc.qc +++ b/fbxa/bot_misc.qc @@ -581,7 +581,7 @@ of the bounding boxes float (entity targ) fisible = { local vector spot1, org; - local float thruwater, pc1, pc2; + local float thruwater = 0, pc1 = 0, pc2 = 0; org = realorigin(targ); spot1 = self.origin + self.view_ofs; @@ -774,4 +774,4 @@ frik_anglemod float(float v) frik_anglemod = { return v - floor(v/360) * 360; -}; \ No newline at end of file +}; diff --git a/fbxa/bot_move.qc b/fbxa/bot_move.qc index 1ad345e..6316130 100644 --- a/fbxa/bot_move.qc +++ b/fbxa/bot_move.qc @@ -149,7 +149,7 @@ manuever around. void(vector whichway, float danger) frik_obstructed = { local float dist; - local vector disway, org; + local vector disway = '0 0 0', org; // TODO: something if (self.b_aiflags & AI_BLIND) return; @@ -182,7 +182,7 @@ void(vector whichway, float danger) frik_obstructed = dist = vlen(org - (self.origin + disway)); disway_x = whichway_y; disway_y = whichway_x * -1; - self.wallhug = vlen(org - (self.origin + disway)) > dist; + self.wallhug = (float) (vlen(org - (self.origin + disway)) > dist); self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; } @@ -193,7 +193,7 @@ void(vector whichway, float danger) frik_obstructed = dist = vlen(disway - self.obs_dir); disway_x = whichway_y; disway_y = whichway_x * -1; - self.wallhug = vlen(disway - self.obs_dir) < dist; + self.wallhug = (float) (vlen(disway - self.obs_dir) < dist); self.obs_dir = whichway; self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; @@ -348,7 +348,7 @@ I have no idea how well it will work void() frik_dodge_obstruction = { - local vector way, org; + local vector way = '0 0 0', org; local float oflags, yaw; if (!(self.b_aiflags & AI_OBSTRUCTED)) @@ -406,7 +406,7 @@ blah void() frik_movetogoal = { - local vector way, start, stop, ang; + local vector way; local float g; if (self.target1 == world) diff --git a/fbxa/bot_phys.qc b/fbxa/bot_phys.qc index dd7c835..528f289 100644 --- a/fbxa/bot_phys.qc +++ b/fbxa/bot_phys.qc @@ -56,13 +56,13 @@ Stuff mimicking cl_input.c code */ float(float key) CL_KeyState = { - return ((self.keys & key) > 0); + return (float)((self.keys & key) > 0); }; void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles { local float anglespeed; - local vector view; + local vector view = '0 0 0'; if (self.keys != self.oldkeys) { self.movevect = '0 0 0'; @@ -78,7 +78,7 @@ void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles // 200 is the default cl_upspeed self.movevect_z = self.movevect_z - (200 * CL_KeyState(KEY_MOVEDOWN)); // 200 is the default cl_upspeed - if (!self.b_aiflags & AI_PRECISION) + if (!(self.b_aiflags & AI_PRECISION)) self.movevect = self.movevect * 2; // 2 is the default cl_movespeedkey & bot always has +speed } @@ -392,7 +392,7 @@ float() SV_CheckWater = self.waterlevel = 3; } } - return (self.waterlevel > 1); + return (float) (self.waterlevel > 1); }; void() RemoveThud = // well sometimes @@ -446,7 +446,7 @@ void() SV_CheckOnGround = self.flags = self.flags - FL_ONGROUND; else if ((trace_plane_normal_z <= 0.7) && (trace_fraction != 1)) self.flags = self.flags - FL_ONGROUND; - else if (!droptofloor(0,0)) + else if (!droptofloor ()) self.flags = self.flags - FL_ONGROUND; else if (org_z - self.origin_z < 2) self.flags = self.flags | FL_ONGROUND; @@ -468,7 +468,7 @@ float(vector dir) botCheckForStep = yaw = vectoyaw(dir); if(walkmove(yaw, 3)) { - if(droptofloor(0,0)) + if(droptofloor ()) { stepdistance = self.origin_z - currentorigin_z; v = self.origin - currentorigin; @@ -489,7 +489,7 @@ float(vector dir) botCheckForStep = void(vector dir) BruteForceStep = { local vector currentorigin; - local float currentflags, i, len; + local float currentflags, i = 0, len; currentorigin = self.origin; currentflags = self.flags; diff --git a/fbxa/bot_qw.qc b/fbxa/bot_qw.qc index 77846e7..41c271f 100644 --- a/fbxa/bot_qw.qc +++ b/fbxa/bot_qw.qc @@ -584,7 +584,7 @@ BotInit void() BotInit = { local entity ent, fisent; - local float numents; + local float numents = 0; // spawn entities for the physics ent = nextent(world); @@ -641,19 +641,19 @@ void(entity who) UpdateClient = WriteByte(2, 40 ); // update userinfo WriteByte(2, who.b_clientno); // client number WriteLong(2, who.b_userid); // client userid - WriteByte(2, 92); // \ - WriteByte(2, 98); // b - WriteByte(2, 111); // o - WriteByte(2, 116); // t - WriteByte(2, 116); // t - WriteByte(2, 111); // o - WriteByte(2, 109); // m - WriteByte(2, 99); // c - WriteByte(2, 111); // o - WriteByte(2, 108); // l - WriteByte(2, 111); // o - WriteByte(2, 114); // r - WriteByte(2, 92); // \ + WriteByte(2, 92); // '\' + WriteByte(2, 98); // 'b' + WriteByte(2, 111); // 'o' + WriteByte(2, 116); // 't' + WriteByte(2, 116); // 't' + WriteByte(2, 111); // 'o' + WriteByte(2, 109); // 'm' + WriteByte(2, 99); // 'c' + WriteByte(2, 111); // 'o' + WriteByte(2, 108); // 'l' + WriteByte(2, 111); // 'o' + WriteByte(2, 114); // 'r' + WriteByte(2, 92); // '\' if(who.b_pants > 9) { WriteByte(2, 49); @@ -661,16 +661,16 @@ void(entity who) UpdateClient = } else WriteByte(2, 48 + who.b_pants); - WriteByte(2, 92); // \ - WriteByte(2, 116); // t - WriteByte(2, 111); // o - WriteByte(2, 112); // p - WriteByte(2, 99); // c - WriteByte(2, 111); // o - WriteByte(2, 108); // l - WriteByte(2, 111); // o - WriteByte(2, 114); // r - WriteByte(2, 92); // \ + WriteByte(2, 92); // '\' + WriteByte(2, 116); // 't' + WriteByte(2, 111); // 'o' + WriteByte(2, 112); // 'p' + WriteByte(2, 99); // 'c' + WriteByte(2, 111); // 'o' + WriteByte(2, 108); // 'l' + WriteByte(2, 111); // 'o' + WriteByte(2, 114); // 'r' + WriteByte(2, 92); // '\' if(who.b_shirt > 9) { WriteByte(2, 49); @@ -678,33 +678,33 @@ void(entity who) UpdateClient = } else WriteByte(2, 48 + who.b_shirt); - WriteByte(2, 92); // \ - WriteByte(2, 116); // t - WriteByte(2, 101); // e - WriteByte(2, 97); // a - WriteByte(2, 109); // m - WriteByte(2, 92); // \ - WriteByte(2, 98); // b - WriteByte(2, 111); // o - WriteByte(2, 116); // t + WriteByte(2, 92); // '\' + WriteByte(2, 116); // 't' + WriteByte(2, 101); // 'e' + WriteByte(2, 97); // 'a' + WriteByte(2, 109); // 'm' + WriteByte(2, 92); // '\' + WriteByte(2, 98); // 'b' + WriteByte(2, 111); // 'o' + WriteByte(2, 116); // 't' // FIXME: do teams properly // note this has no effect on infokey - WriteByte(2, 92 ); // \ - WriteByte(2, 115); // s - WriteByte(2, 107); // k - WriteByte(2, 105); // i - WriteByte(2, 110); // n - WriteByte(2, 92); // \ - WriteByte(2, 98); // b - WriteByte(2, 97); // a - WriteByte(2, 115); // s - WriteByte(2, 101); // e - WriteByte(2, 92); // \ - WriteByte(2, 110); // n - WriteByte(2, 97); // a - WriteByte(2, 109); // m - WriteByte(2, 101); // e - WriteByte(2, 92); // \ + WriteByte(2, 92 ); // '\' + WriteByte(2, 115); // 's' + WriteByte(2, 107); // 'k' + WriteByte(2, 105); // 'i' + WriteByte(2, 110); // 'n' + WriteByte(2, 92); // '\' + WriteByte(2, 98); // 'b' + WriteByte(2, 97); // 'a' + WriteByte(2, 115); // 's' + WriteByte(2, 101); // 'e' + WriteByte(2, 92); // '\' + WriteByte(2, 110); // 'n' + WriteByte(2, 97); // 'a' + WriteByte(2, 109); // 'm' + WriteByte(2, 101); // 'e' + WriteByte(2, 92); // '\' WriteString( 2, who.netname); }; @@ -761,7 +761,6 @@ entity(float num) GetClientEntity = void(float whatbot, float whatskill) BotConnect = { local float f; - local string h; local entity uself; f = ClientNextAvailable(); @@ -804,7 +803,6 @@ void(float whatbot, float whatskill) BotConnect = void(entity bot) BotDisconnect = { - local string h; local entity uself; uself = self; self = bot; @@ -941,4 +939,4 @@ void() BotImpulses = else return; self.impulse = 0; -}; \ No newline at end of file +}; diff --git a/fbxa/bot_way.qc b/fbxa/bot_way.qc index 9002982..26e091f 100644 --- a/fbxa/bot_way.qc +++ b/fbxa/bot_way.qc @@ -292,11 +292,11 @@ very good all things considered. void() DynamicWaypoint = { local entity t; - local float dist, dynlink, dynpoint, editor; + local float dist, dynlink = 0, dynpoint = 0, editor = 0; if (self.teleport_time > self.portal_time) { - if (!self.flags & FL_WATERJUMP) + if (!(self.flags & FL_WATERJUMP)) { self.dyn_flags = 2; if (!self.ishuman) @@ -998,4 +998,4 @@ void(vector org) SpawnTempWaypoint = setorigin(tep, org); target_add(tep); setsize(tep, VEC_HULL_MIN, VEC_HULL_MAX); // FIXME: convert these to numerical -}; \ No newline at end of file +}; diff --git a/fbxa/map_dm1.qc b/fbxa/map_dm1.qc index 788feb7..4970ee7 100644 --- a/fbxa/map_dm1.qc +++ b/fbxa/map_dm1.qc @@ -50,4 +50,4 @@ void() map_dm1 = make_way('599.9 1309.0 46.0', '4 5 7', 6, 0); make_way('-321.9 1006.5 -98.0', '17 35 0', 0, 0); make_way('-542.5 1222.3 46.0', '30 36 0', 0, 0); -}; \ No newline at end of file +}; diff --git a/fbxa/map_dm2.qc b/fbxa/map_dm2.qc index c5df74b..abf47ac 100644 --- a/fbxa/map_dm2.qc +++ b/fbxa/map_dm2.qc @@ -95,4 +95,4 @@ void() map_dm2 = make_way('2431.5 -2115.8 142.0', '51 0 0', 0, 32784); }; -// End dump \ No newline at end of file +// End dump diff --git a/fbxa/map_dm4.qc b/fbxa/map_dm4.qc index 8b367fa..913cd78 100644 --- a/fbxa/map_dm4.qc +++ b/fbxa/map_dm4.qc @@ -47,4 +47,4 @@ void() map_dm4 = make_way('964.6 -623.9 -82.0', '0 24 22', 0, 0); make_way('150.1 -191.5 -50.0', '31 0 0', 0, 384); make_way('502.7 -271.1 -82.0', '15 0 0', 0, 0); -}; \ No newline at end of file +}; diff --git a/fbxa/map_dm5.qc b/fbxa/map_dm5.qc index 36264c2..45b1d17 100644 --- a/fbxa/map_dm5.qc +++ b/fbxa/map_dm5.qc @@ -53,4 +53,4 @@ void() map_dm5 = make_way('547.8 -309.4 -90.0', '45 43 0', 0, 0); make_way('544.3 -52.9 -90.0', '9 8 44', 0, 0); make_way('488.5 -769.3 238.0', '25 24 0', 0, 0); -}; \ No newline at end of file +}; diff --git a/fbxa/map_dm6.qc b/fbxa/map_dm6.qc index 31090d5..9ca08c1 100644 --- a/fbxa/map_dm6.qc +++ b/fbxa/map_dm6.qc @@ -68,4 +68,4 @@ void() map_dm6 = make_way('194.1 -1234.7 134.0', '38 41 0', 0, 0); make_way('150.9 -1784.8 70.0', '44 43 55', 41, 8); make_way('323.0 -1785.1 78.0', '42 54 37', 41, 8); -}; \ No newline at end of file +};