]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix more uninitialized stuff and a few bugs, one regarding g_weaponarena all
authorRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 15:09:52 +0000 (17:09 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 15:09:52 +0000 (17:09 +0200)
28 files changed:
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_ctf.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_triggers.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mode_onslaught.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/expandnode.qc
qcsrc/server/pathlib/utility.qc
qcsrc/server/race.qc
qcsrc/server/steerlib.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/system/system_misc.qc
qcsrc/server/tturrets/units/unit_hk.qc
qcsrc/server/tturrets/units/unit_tessla.qc
qcsrc/server/vehicles/raptor.qc

index 039e21daed025bf588322272997456ed3f2fb240..b06d578d1813b096ea7a49e2475e3ce59dfea55c 100644 (file)
@@ -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();
index 18e4341718e67e698e12c76045a8d035418e8af8..e03cbac66a5937baa08cea8a4cd3575a6675c057 100644 (file)
@@ -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
index 74c611ea18ddf6bdfe8f54dc94c3de1c29c59c57..178ee0da6e8cfe236be697a433ba96a6c4a4cb55 100644 (file)
@@ -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)
index 90150e2ab3c4d027b6219c905497ea821563c858..b17697d2f8524d6ae21bc3c9dee8205161a07cf3 100644 (file)
@@ -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)
index bf963bc7cd703be9d53cacf49c422d0f84c726bd..a5c60e3935bca171b1e16e30971d2b34997141cd 100644 (file)
@@ -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)
        {
index 63a6cb336d4054c90d3aa0283be057005139bed0..5752e2f499c506e42686b8770e22a925dfe18473 100644 (file)
@@ -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;
index e95e9332440c91e6989539256f0de9d82c72880b..fcc1cca97914ab03ecb4ff69ee10afc57bf377df 100644 (file)
@@ -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;
 
index be4928e8a76296568f1aa21ab2d7270f9ec42d0b..0bedd6d5e21f3ce44f0b2d479eed092a59029b65 100644 (file)
@@ -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
+}
index e119e5aba40040a359eca73d26d6a909f6f5d128..f8aad67240f4d5fdb41624a33e7cd09519bd0e74 100644 (file)
@@ -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)
        {
index 4e97136ce8b45354b0a1f695ff36ba9f06fad634..af7c105617769463262f0759e1b392a2463e8abe 100644 (file)
@@ -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)
index e39f2813450abfad76fd6a9750cee7bee470770f..7b386ec97514ef571a9aa7ab5186e50c1773ee0a 100644 (file)
@@ -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;
                
index df175ac8d3d6d2b7d46953e385de59f71f974c20..1b8585eb60c9fd2e36819745406198c320ed4e71 100644 (file)
@@ -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)
index 2e0443c8c101c4280a7622aa7bc5d82218808ebe..ebca6ee2b7b4353ba16afe6b76a941973e1ffcc5 100644 (file)
@@ -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)
index bc8e85f35da34fcec837b503c38df659ac5eacea..d6413d33fab9d1500219fbd0e934d6357aa27507 100644 (file)
@@ -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)
index fe60241864171fd786fd935f6a1ffdf57f0f9072..aa56d7647772ac4c5c5593bb6d324ce39b69dcf2 100644 (file)
@@ -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"));)
        {
index ce66b233f33289b2439349216bf4e3e5bca2af6d..d7fec13264e5cc70bdfa10e02a21570d0b1d7c50 100644 (file)
@@ -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])
index 95aa2f9658909983c085061cd5079d5d030af413..ce4c2b4b8d74a40c13455b05d9020f05473e7cfc 100644 (file)
@@ -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
         {
index 4647fea1392abdba4013b61f2b2c6c99fdde31bb..a08c66b3ae5f48fd657adf5ee61ac53282177c92 100644 (file)
@@ -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;
index 5d9fc3d9788c38aab12173b5c7054e3b45e7d2b2..0a5ea42b1c22e7e996665ee98238dd55a6eb3307 100644 (file)
@@ -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;
index 911106a30560358e6ae03054ab21526dc0e6ad8a..c7c38165dd9845225420660ddede82ae65de8dd5 100644 (file)
@@ -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;
index a586252555dcf58beaa904975135ba0e5e71e4c3..2f59924df6e894c9a4d96a8281fb671bec802abb 100644 (file)
@@ -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);
 
index 40f52695dc1f5e5c3b8e05274b9ad1b1372e7090..ac029e6577659f3e243a610219b9a3f290d15bc4 100644 (file)
@@ -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;
index cce0aab32bb5f062ca66a853f2a7996dfafef5c4..eef4d28b8c67d644b9e3fc51b5efda64dda6febe 100644 (file)
@@ -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
                {
index 7247a3a3476816e6c116019903975c4e48365661..c8bbf537c336ba548310dc896b9680ac41e21f20 100644 (file)
@@ -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);
 
index 1c0a3bad5269ef4552a0b71686b6a8c0d44c6599..5a94b442343832f8ebceef28639d72cd9e277ae0 100644 (file)
@@ -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;
 }
 
index d61289dcbe62e50a458c92f482c30cd5ba0ec0de..aa80e0d6b93a985a996a151f75d2eca69652bff3 100644 (file)
@@ -108,6 +108,8 @@ void turret_hk_missile_think()
     }
     else
     {
+       edist = 0;
+       ve = '0 0 0';
         fe = 0;
     }
 
index 6c2cce6a73341ad4d3b80fcd25a19233b269b688..85fb8bb18205bb367dd194b7e800ea9499d1c554 100644 (file)
@@ -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;
 
index ab0d388155bf7ca8d17c674d31507770656533e4..ad5252dfd868c83a4805d1e75fe2b05c4a25eec8 100644 (file)
@@ -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)