From a4ccbd75da12da9090f3d25ad4dc9edd0efe3060 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 26 Apr 2012 17:09:52 +0200 Subject: [PATCH] fix more uninitialized stuff and a few bugs, one regarding g_weaponarena all --- qcsrc/server/bot/bot.qc | 3 +++ qcsrc/server/bot/havocbot/havocbot.qc | 9 ++++---- qcsrc/server/bot/havocbot/role_ctf.qc | 24 ++++++++++----------- qcsrc/server/bot/havocbot/role_onslaught.qc | 6 ++++-- qcsrc/server/bot/navigation.qc | 2 ++ qcsrc/server/bot/scripting.qc | 6 +++--- qcsrc/server/cl_client.qc | 4 ++-- qcsrc/server/command/getreplies.qc | 7 ++++-- qcsrc/server/g_subs.qc | 4 +--- qcsrc/server/g_triggers.qc | 2 ++ qcsrc/server/item_key.qc | 7 ++++-- qcsrc/server/miscfunctions.qc | 9 ++++++-- qcsrc/server/mode_onslaught.qc | 1 + qcsrc/server/mutators/gamemode_keyhunt.qc | 4 +++- qcsrc/server/mutators/gamemode_nexball.qc | 2 +- qcsrc/server/mutators/sandbox.qc | 3 ++- qcsrc/server/pathlib.qc | 2 ++ qcsrc/server/pathlib/expandnode.qc | 1 + qcsrc/server/pathlib/utility.qc | 2 +- qcsrc/server/race.qc | 9 ++++---- qcsrc/server/steerlib.qc | 12 +++++------ qcsrc/server/t_items.qc | 23 +++++++++++--------- qcsrc/server/t_jumppads.qc | 2 +- qcsrc/server/tturrets/system/system_main.qc | 2 +- qcsrc/server/tturrets/system/system_misc.qc | 4 ++-- qcsrc/server/tturrets/units/unit_hk.qc | 2 ++ qcsrc/server/tturrets/units/unit_tessla.qc | 2 +- qcsrc/server/vehicles/raptor.qc | 2 +- 28 files changed, 93 insertions(+), 63 deletions(-) diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 039e21dae..b06d578d1 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -128,7 +128,10 @@ void bot_setnameandstuff() file = fopen(autocvar_bot_config_file, FILE_READ); if(file < 0) + { print(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n")); + readfile = ""; + } else { RandomSelection_Init(); diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 18e434171..e03cbac66 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -493,8 +493,8 @@ void havocbot_movetogoal() { if(fabs(self.velocity_z)<50) { - entity head, newgoal; - float distance, bestdistance; + entity head, newgoal = world; + float distance, bestdistance = 0; for (head = findchain(classname, "waypoint"); head; head = head.chain) { @@ -908,7 +908,7 @@ void havocbot_chooseenemy() self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; - for(;;) + for(i = 0; ; ++i) { while (head) { @@ -939,7 +939,6 @@ void havocbot_chooseenemy() self.dphitcontentsmask |= DPCONTENTS_OPAQUE; head = head2; - ++i; } // Restore hit flags @@ -960,7 +959,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon) // if this weapon is scheduled for reloading, don't switch to it during combat if (self.weapon_load[new_weapon] < 0) { - float i, other_weapon_available; + float i, other_weapon_available = FALSE; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { // if we are out of ammo for all other weapons, it's an emergency to switch to anything else diff --git a/qcsrc/server/bot/havocbot/role_ctf.qc b/qcsrc/server/bot/havocbot/role_ctf.qc index 74c611ea1..178ee0da6 100644 --- a/qcsrc/server/bot/havocbot/role_ctf.qc +++ b/qcsrc/server/bot/havocbot/role_ctf.qc @@ -60,7 +60,7 @@ float havocbot_ctf_teamcount(entity bot, vector org, float radius) if not(teamplay) return 0; - float c; + float c = 0; entity head; FOR_EACH_PLAYER(head) @@ -562,9 +562,8 @@ void havocbot_role_ctf_defense() navigation_goalrating_start(); // if enemies are closer to our base, go there - entity head, closestplayer; - float distance, bestdistance; - distance = 10000; + entity head, closestplayer = world; + float distance, bestdistance = 10000; FOR_EACH_PLAYER(head) { if(head.deadflag!=DEAD_NO) @@ -596,20 +595,21 @@ void havocbot_role_ctf_defense() void havocbot_calculate_middlepoint() { entity f; - vector p1, p2; + vector s = '0 0 0'; + vector fo = '0 0 0'; + float n = 0; f = ctf_worldflaglist; while (f) { - if(p1) - p2 = f.origin; - else - p1 = f.origin; - + fo = f.origin; + s = s + fo; f = f.ctf_worldflagnext; } - havocbot_ctf_middlepoint = p1 + ((p2-p1) * 0.5); - havocbot_ctf_middlepoint_radius = vlen(p2-p1) * 0.5; + if(!n) + return; + havocbot_ctf_middlepoint = s * (1.0 / n); + havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint); } void havocbot_ctf_reset_role(entity bot) diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qc b/qcsrc/server/bot/havocbot/role_onslaught.qc index 90150e2ab..b17697d2f 100644 --- a/qcsrc/server/bot/havocbot/role_onslaught.qc +++ b/qcsrc/server/bot/havocbot/role_onslaught.qc @@ -28,13 +28,14 @@ void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplay void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float sradius) { entity head; - float t, i, c, needarmor, needweapons; + float t, i, c, needarmor = FALSE, needweapons = FALSE; // Needs armor/health? if(self.health<100) needarmor = TRUE; // Needs weapons? + c = 0; for(i = WEP_FIRST; i <= WEP_LAST ; ++i) { // Find weapon @@ -98,7 +99,7 @@ void havocbot_role_ons_setrole(entity bot, float role) float havocbot_ons_teamcount(entity bot, float role) { - float c; + float c = 0; entity head; FOR_EACH_PLAYER(head) @@ -152,6 +153,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale) // We'll consider only the best case bestvalue = 99999999999; + cp = world; for (; cp1; cp1 = cp1.chain) { if not(cp1.wpconsidered) diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index bf963bc7c..a5c60e393 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -27,6 +27,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float dir = normalize(move); stepdist = 32; ignorehazards = FALSE; + swimming = FALSE; // Analyze starting point traceline(start, start, MOVE_NORMAL, e); @@ -1218,6 +1219,7 @@ void debuggoalstack() else if(self.goalcounter==29)goal=self.goalstack29; else if(self.goalcounter==30)goal=self.goalstack30; else if(self.goalcounter==31)goal=self.goalstack31; + else goal=world; if(goal==world) { diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 63a6cb336..5752e2f49 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -38,9 +38,9 @@ void bot_queuecommand(entity bot, string cmdstring) { parm = substring(cmdstr, sp + 1, -1); cmdstr = substring(cmdstr, 0, sp); + if(cmdstr == "sound") + precache_sound(cmdstr); } - if(cmdstr == "sound") - precache_sound(cmdstr); } bot.bot_cmdqueuebuf_end += 1; @@ -292,7 +292,7 @@ entity find_bot_by_name(string name) entity find_bot_by_number(float number) { entity bot; - float c; + float c = 0; if(!number) return world; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index e95e93324..fcc1cca97 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2377,7 +2377,7 @@ float nJoinAllowed(entity ignore) { // TODO simplify this entity e; - float totalClients; + float totalClients = 0; FOR_EACH_CLIENT(e) if(e != ignore) totalClients += 1; @@ -2385,7 +2385,7 @@ float nJoinAllowed(entity ignore) { if (!autocvar_g_maxplayers) return maxclients - totalClients; - float currentlyPlaying; + float currentlyPlaying = 0; FOR_EACH_REALPLAYER(e) currentlyPlaying += 1; diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index be4928e8a..0bedd6d5e 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -14,6 +14,8 @@ string getrecords(float page) // 50 records per page { float rec = 0, r, i; string h, s; + + s = ""; if (g_ctf) { @@ -85,6 +87,7 @@ string getrankings() map = GetMapname(); + s = ""; for (i = 1; i <= RANKINGS_CNT; ++i) { t = race_readTime(map, i); @@ -107,7 +110,7 @@ string getrankings() string getladder() { - float i, j, k, uidcnt, thiscnt; + float i, j, k, uidcnt = 0, thiscnt; string s, temp_s, rr, myuid, thisuid; if(g_cts) @@ -281,4 +284,4 @@ string getladder() return "No ladder on this server!\n"; else return strcat("Top ", ftos(LADDER_SIZE), " ladder rankings:\n", s); -} \ No newline at end of file +} diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index e119e5aba..f8aad6724 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -382,11 +382,9 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma, lag = 0; // only antilag for clients // change shooter to SOLID_BBOX so the shot can hit corpses + oldsolid = source.dphitcontentsmask; if(source) - { - oldsolid = source.dphitcontentsmask; source.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; - } if (lag) { diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 4e97136ce..af7c10561 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -1390,6 +1390,8 @@ void trigger_impulse_touch1() return; } + str = min(self.radius, vlen(self.origin - other.origin)); + if(self.falloff == 1) str = (str / self.radius) * self.strength; else if(self.falloff == 2) diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index e39f28134..7b386ec97 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -36,6 +36,8 @@ string item_keys_keylist(float keylist) { if ((keylist & (keylist-1)) != 0) return strcat("the ", item_keys_names[lowestbit(keylist)]); + n = ""; + base = 0; while (keylist) { l = lowestbit(keylist); if (n) @@ -181,12 +183,13 @@ void spawnfunc_item_key() { break; default: + _netname = "FLUFFY PINK keycard"; + _colormod = '1 1 1'; + if (!self.netname) { objerror("item_key doesn't have a default name for this key and a custom one was not specified!"); remove(self); return; - } else if (!self.colormod) { - _colormod = '1 1 1'; } break; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index df175ac8d..1b8585eb6 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -860,8 +860,11 @@ void readplayerstartcvars() g_weaponarena = 1; g_weaponarena_list = "All Weapons"; for (j = WEP_FIRST; j <= WEP_LAST; ++j) + { + e = get_weaponinfo(j); if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) WEPSET_OR_AW(g_weaponarena_weapons, j); + } } else if (s == "most") { @@ -1018,6 +1021,8 @@ void readplayerstartcvars() warmup_start_health = cvar("g_warmup_start_health"); warmup_start_armorvalue = cvar("g_warmup_start_armor"); WEPSET_CLEAR_A(warmup_start_weapons); + WEPSET_CLEAR_A(warmup_start_weapons_default); + WEPSET_CLEAR_A(warmup_start_weapons_defaultmask); for (i = WEP_FIRST; i <= WEP_LAST; ++i) { e = get_weaponinfo(i); @@ -1694,7 +1699,7 @@ void make_safe_for_remove(entity e) { if (e.initialize_entity) { - entity ent, prev; + entity ent, prev = world; for (ent = initialize_entity_first; ent; ) { if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e))) @@ -2117,7 +2122,7 @@ void race_writeTime(string map, float t, string myuid) float newpos; newpos = race_readPos(map, t); - float i, prevpos; + float i, prevpos = 0; for(i = 1; i <= RANKINGS_CNT; ++i) { if(race_readUID(map, i) == myuid) diff --git a/qcsrc/server/mode_onslaught.qc b/qcsrc/server/mode_onslaught.qc index 2e0443c8c..ebca6ee2b 100644 --- a/qcsrc/server/mode_onslaught.qc +++ b/qcsrc/server/mode_onslaught.qc @@ -952,6 +952,7 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float if (attacker.classname == "player") { + nag = FALSE; if(self.team == COLOR_TEAM1) { if(time - ons_notification_time_team1 > 10) diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index bc8e85f35..d6413d33f 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -545,6 +545,8 @@ void kh_WinnerTeam(float teem) // runs when a team wins first = TRUE; midpoint = '0 0 0'; + firstorigin = '0 0 0'; + lastorigin = '0 0 0'; FOR_EACH_KH_KEY(key) { vector thisorigin; @@ -935,7 +937,7 @@ void kh_StartRound() // runs at the start of each round { teem = kh_Team_ByID(i); players = 0; - entity my_player; + entity my_player = world; FOR_EACH_PLAYER(player) if(player.deadflag == DEAD_NO) if(!player.BUTTON_CHAT) diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index fe6024186..aa56d7647 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -418,7 +418,7 @@ void nb_spawnteam(string teamname, float teamcolor) void nb_spawnteams(void) { - float t_r, t_b, t_y, t_p; + float t_r = 0, t_b = 0, t_y = 0, t_p = 0; entity e; for(e = world; (e = find(e, classname, "nexball_goal"));) { diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index ce66b233f..d7fec1326 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -205,7 +205,7 @@ string port_string[MAX_STORAGE_ATTACHMENTS]; // fteqcc crashes if this isn't def string sandbox_ObjectPort_Save(entity e, float database) { // save object properties, and return them as a string - float i; + float i = 0; string s; entity head; @@ -268,6 +268,7 @@ string sandbox_ObjectPort_Save(entity e, float database) } // now apply the array to a simple string, with the ; symbol separating objects + s = ""; for(i = 0; i <= MAX_STORAGE_ATTACHMENTS; ++i) { if(port_string[i]) diff --git a/qcsrc/server/pathlib.qc b/qcsrc/server/pathlib.qc index 95aa2f965..ce4c2b4b8 100644 --- a/qcsrc/server/pathlib.qc +++ b/qcsrc/server/pathlib.qc @@ -598,6 +598,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go { pathlib_expandnode = pathlib_expandnode_box; pathlib_movenode = pathlib_swimnode; + doedge = 0; } else { @@ -605,6 +606,7 @@ float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector go { pathlib_expandnode = pathlib_expandnode_box; pathlib_movenode = pathlib_swimnode; + doedge = 0; } else { diff --git a/qcsrc/server/pathlib/expandnode.qc b/qcsrc/server/pathlib/expandnode.qc index 4647fea13..a08c66b3a 100644 --- a/qcsrc/server/pathlib/expandnode.qc +++ b/qcsrc/server/pathlib/expandnode.qc @@ -49,6 +49,7 @@ float pathlib_expandnode_starf(entity node, vector start, vector goal) plib_points2[0] = plib_points[0]; vector bp; bp = plib_points[0]; + fc2 = 0; for(i = 0; i < 8; ++i) { c = 0; diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 5d9fc3d97..0a5ea42b1 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -156,7 +156,7 @@ float tile_check_plus(vector where) float tile_check_plus2(vector where) { vector p,f,r; - float i,e; + float i = 0, e = 0; f = PLIB_FORWARD * pathlib_gridsize; r = PLIB_RIGHT * pathlib_gridsize; diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 911106a30..c7c38165d 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -141,6 +141,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) newpos = race_readPos(map, t); float i; + player_prevpos = 0; for(i = 1; i <= RANKINGS_CNT; ++i) { if(race_readUID(map, i) == myuid) @@ -490,8 +491,8 @@ void checkpoint_passed() self.race_checkpoint = other.race_checkpoint; } - float largest_cp_id; - float cp_amount; + float largest_cp_id = 0; + float cp_amount = 0; for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) { cp_amount += 1; if(cp.race_checkpoint > largest_cp_id) // update the finish id if someone hit a new checkpoint @@ -664,7 +665,7 @@ void trigger_race_checkpoint_verify() g_race_qualifying = 1; self.race_place = race_lowest_place_spawn; if(!Spawn_FilterOutBadSpots(findchain(classname, "info_player_deathmatch"), 0, FALSE)) - error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out")); + error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(self.race_place), " (used for qualifying) - bailing out")); } else { @@ -710,7 +711,7 @@ void trigger_race_checkpoint_verify() } if(defragcpexists != -1){ - float largest_cp_id; + float largest_cp_id = 0; for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) if(cp.race_checkpoint > largest_cp_id) largest_cp_id = cp.race_checkpoint; diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index a58625255..2f59924df 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -172,8 +172,8 @@ vector steerlib_dodge(vector point,vector dodge_dir,float min_distance) vector steerlib_flock(float radius, float standoff,float separation_force,float flock_force) { entity flock_member; - vector push,pull; - float ccount; + vector push = '0 0 0', pull = '0 0 0'; + float ccount = 0; flock_member = findradius(self.origin,radius); while(flock_member) @@ -198,8 +198,8 @@ vector steerlib_flock(float radius, float standoff,float separation_force,float vector steerlib_flock2d(float radius, float standoff,float separation_force,float flock_force) { entity flock_member; - vector push,pull; - float ccount; + vector push = '0 0 0', pull = '0 0 0'; + float ccount = 0; flock_member = findradius(self.origin,radius); while(flock_member) @@ -229,8 +229,8 @@ vector steerlib_flock2d(float radius, float standoff,float separation_force,floa vector steerlib_swarm(float radius, float standoff,float separation_force,float swarm_force) { entity swarm_member; - vector force,center; - float ccount; + vector force = '0 0 0', center = '0 0 0'; + float ccount = 0; swarm_member = findradius(self.origin,radius); diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 40f52695d..ac029e657 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -674,7 +674,8 @@ float weapon_pickupevalfunc(entity player, entity item) float commodity_pickupevalfunc(entity player, entity item) { - float c, i, need_shells, need_nails, need_rockets, need_cells, need_fuel; + float c, i; + float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_fuel = FALSE; entity wi; c = 0; @@ -1427,19 +1428,21 @@ void spawnfunc_target_items (void) else if(argv(i) == "jetpack") self.items |= IT_JETPACK; else if(argv(i) == "fuel_regen") self.items |= IT_FUEL_REGEN; else - for(j = WEP_FIRST; j <= WEP_LAST; ++j) { - e = get_weaponinfo(j); - if(argv(i) == e.netname) + for(j = WEP_FIRST; j <= WEP_LAST; ++j) { - WEPSET_OR_EW(self, j); - if(self.spawnflags == 0 || self.spawnflags == 2) - weapon_action(e.weapon, WR_PRECACHE); - break; + e = get_weaponinfo(j); + if(argv(i) == e.netname) + { + WEPSET_OR_EW(self, j); + if(self.spawnflags == 0 || self.spawnflags == 2) + weapon_action(e.weapon, WR_PRECACHE); + break; + } } + if(j > WEP_LAST) + print("target_items: invalid item ", argv(i), "\n"); } - if(j > WEP_LAST) - print("target_items: invalid item ", argv(i), "\n"); } string itemprefix, valueprefix; diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index cce0aab32..eef4d28b8 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -286,7 +286,7 @@ void trigger_push_findtarget() else if(n == 1) { // exactly one dest - bots love that - self.enemy = find(e, targetname, self.target); + self.enemy = find(world, targetname, self.target); } else { diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index 7247a3a34..c8bbf537c 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -726,7 +726,7 @@ entity turret_select_target() m_score = self.turret_score_target(self,e_enemy) * self.target_select_samebias; } else - self.enemy = world; + e_enemy = self.enemy = world; e = findradius(self.origin, self.target_range); diff --git a/qcsrc/server/tturrets/system/system_misc.qc b/qcsrc/server/tturrets/system/system_misc.qc index 1c0a3bad5..5a94b4423 100644 --- a/qcsrc/server/tturrets/system/system_misc.qc +++ b/qcsrc/server/tturrets/system/system_misc.qc @@ -60,7 +60,7 @@ vector shortangle_vxy(vector ang1, vector ang2) vector real_origin(entity ent) { entity e; - vector v; + vector v = ((ent.absmin + ent.absmax) * 0.5); e = ent.tag_entity; while(e) @@ -68,7 +68,7 @@ vector real_origin(entity ent) v = v + ((e.absmin + e.absmax) * 0.5); e = e.tag_entity; } - v = v + ((ent.absmin + ent.absmax) * 0.5); + return v; } diff --git a/qcsrc/server/tturrets/units/unit_hk.qc b/qcsrc/server/tturrets/units/unit_hk.qc index d61289dcb..aa80e0d6b 100644 --- a/qcsrc/server/tturrets/units/unit_hk.qc +++ b/qcsrc/server/tturrets/units/unit_hk.qc @@ -108,6 +108,8 @@ void turret_hk_missile_think() } else { + edist = 0; + ve = '0 0 0'; fe = 0; } diff --git a/qcsrc/server/tturrets/units/unit_tessla.qc b/qcsrc/server/tturrets/units/unit_tessla.qc index 6c2cce6a7..85fb8bb18 100644 --- a/qcsrc/server/tturrets/units/unit_tessla.qc +++ b/qcsrc/server/tturrets/units/unit_tessla.qc @@ -5,7 +5,7 @@ void turret_tesla_fire(); entity toast(entity from, float range, float damage) { entity e; - entity etarget; + entity etarget = world; float d,dd; float r; diff --git a/qcsrc/server/vehicles/raptor.qc b/qcsrc/server/vehicles/raptor.qc index ab0d38815..ad5252dfd 100644 --- a/qcsrc/server/vehicles/raptor.qc +++ b/qcsrc/server/vehicles/raptor.qc @@ -311,7 +311,7 @@ float raptor_takeoff() float raptor_frame() { entity player, raptor; - float ftmp, ftmp2; + float ftmp = 0, ftmp2; vector df; if(intermission_running) -- 2.39.2