]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_ctf.qc
fix most uninitialized stuff in svqc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_ctf.qc
index b9bcd5ba097eb8d75d12bbf40502c5b83ea5b385..5d97b2af955d0ac00c66924277b90fb4f5eccbce 100644 (file)
@@ -23,7 +23,7 @@ void ctf_EventLog(string mode, float flagteam, entity actor) // use an alias for
 string ctf_CaptureRecord(entity flag, entity player)
 {
        float cap_time, cap_record, success;
-       string cap_message, refername;
+       string cap_message = string_null, refername;
        
        if((autocvar_g_ctf_captimerecord_always) || (player_count - currentbots)) 
        {
@@ -587,10 +587,10 @@ void ctf_CheckFlagReturn(entity flag, float returntype)
 void ctf_CheckStalemate(void)
 {
        // declarations
-       float stale_red_flags, stale_blue_flags;
+       float stale_red_flags = 0, stale_blue_flags = 0;
        entity tmp_entity;
 
-       entity ctf_staleflaglist; // reset the list, we need to build the list each time this function runs
+       entity ctf_staleflaglist = world; // reset the list, we need to build the list each time this function runs
 
        // build list of stale flags
        for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
@@ -1823,7 +1823,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                // pass the flag to a team mate
                if(autocvar_g_ctf_pass)
                {
-                       entity head, closest_target;
+                       entity head, closest_target = world;
                        head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, TRUE);
                        
                        while(head) // find the closest acceptable target to pass to