]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix a bunch of uninitialized stuff
authorRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 09:10:17 +0000 (11:10 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 26 Apr 2012 09:10:17 +0000 (11:10 +0200)
12 files changed:
qcsrc/common/mapinfo.qh
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/command/banning.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/csqcprojectile.qc
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/mutators/base.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_common.qc

index 698bd7e40ace811727cf2588b1c62e92ee4213e9..bd67f67a825104abcd3108d8096d501fa8a27762 100644 (file)
@@ -1,4 +1,4 @@
-var float MAPINFO_TYPE_ALL = 0;
+float MAPINFO_TYPE_ALL;
 entity MapInfo_Type_first;
 entity MapInfo_Type_last;
 .entity enemy; // internal next pointer
index 7c2509d21a514c550e2d453e106573cc49ae3333..b69e0fbe097479687200957a1f8bef54fda96c89 100644 (file)
@@ -183,7 +183,7 @@ void CampaignPreIntermission()
        float lost;
        string savevar;
 
-       won = 0;
+       won = lost = 0;
 
        head = findchain(classname, "player");
        while(head)
index 19ee93868a59f04b69c5dd061a80a79e7e668ca9..2f6a660cb203f4debee868d307f05fd4c018e4d4 100644 (file)
@@ -749,6 +749,7 @@ float CheatFrame()
 
                                float drag;
                                crosshair_trace_plusvisibletriggers(self);
+                               drag = FALSE;
                                if(vlen(self.origin - trace_ent.origin) <= autocvar_g_grab_range)
                                {
                                        switch(trace_ent.grab)
index 7a6138283f5c8ed466dfd91b238078b4b68779cb..8e3ecb7ba0369ab674ac56ccc2198c9bf01c11a6 100644 (file)
@@ -3,7 +3,7 @@
 //  Last updated: December 29th, 2011
 // =====================================
 
-#define GET_BAN_ARG(v,d) if((argc > reason_arg) && ((v = stof(argv(reason_arg))) != 0)) ++reason_arg; else v = d
+#define GET_BAN_ARG(v,d) if(argc > reason_arg) { if((v = stof(argv(reason_arg))) != 0) ++reason_arg; else v = d; } else v = d
 #define GET_BAN_REASON(v,d) if(argc > reason_arg) v = substring(command, argv_start_index(reason_arg), strlen(command) - argv_start_index(reason_arg)); else v = d
 
 void Ban_KickBanClient(entity client, float bantime, float masksize, string reason);
@@ -12,4 +12,4 @@ float Ban_Insert(string ip, float bantime, string reason, float dosync);
 float Ban_Delete(float i);
 
 // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
-void BanCommand_macro_write_aliases(float fh)
\ No newline at end of file
+void BanCommand_macro_write_aliases(float fh)
index 32bd688d3bdbd26c2460157eca266974873ae203..f5510d73f92bf5156cfe1f9e3ebd9f18c937b97e 100644 (file)
@@ -324,7 +324,7 @@ void ClientCommand_selectteam(float request, float argc)
                                                                        case "pink": selection = COLOR_TEAM4; break;
                                                                        case "auto": selection = (-1); break;
                                                                        
-                                                                       default: break;
+                                                                       default: selection = 0; break;
                                                                }
                                                                
                                                                if(selection)
index 99313b38bf4f9e3b2331fcc5a6d75fb09622b6b4..d26f3279c87b17b65d38eb0a5a29a60fbf79bfd3 100644 (file)
@@ -614,6 +614,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                        print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), 
                                "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
                        
+                       total_listed_players = 0;
                        FOR_EACH_CLIENT(tmp_player)
                        {
                                is_bot = (clienttype(tmp_player) == CLIENTTYPE_BOT);
@@ -759,4 +760,4 @@ void CommonCommand_macro_write_aliases(float fh)
        #undef COMMON_COMMAND
        
        return;
-}
\ No newline at end of file
+}
index d5b6697f25932c34ca6936951f6283fd235f9acd..fea89005aa980cf3ba4cf3316c453c18f83cc446 100644 (file)
@@ -13,6 +13,7 @@ float CSQCProjectile_SendEntity(entity to, float sf)
        if(self.flags & FL_ONGROUND)
                sf |= 0x40;
 
+       ft = fr = 0;
        if(self.fade_time != 0 || self.fade_rate != 0)
        {
                ft = (self.fade_time - time) / sys_frametime;
index c2f895c48243707e166dc4fa8b823f81499bff1a..0f28806a0b2a9595b2d233060930072689d076a5 100644 (file)
@@ -1441,6 +1441,8 @@ void DumpStats(float final)
                print(s, "\n");
        if(to_eventlog)
                GameLogEcho(s);
+
+       file = -1;
        if(to_file)
        {
                file = fopen(autocvar_sv_logscores_filename, FILE_APPEND);
index 91416b8352f9ae450e5688e12532f9ea474272f9..38a1e249d7847a954e20a9df455dd2dfa8289b67 100644 (file)
@@ -324,6 +324,7 @@ void Ban_View()
        
        print("^2Listing all existing active bans:\n");
        
+       n = 0;
        for(i = 0; i < ban_count; ++i)
        {
                if(time > ban_expire[i])
index fdf24edb75a399a526e085a7f28c11b6791c349c..9be5745cb5e4ec24afbde80bee85c4e58bf94097 100644 (file)
@@ -59,6 +59,7 @@ float CallbackChain_Remove(entity cb, float() func)
        entity e;
        float n;
        n = 0;
+       order = 0;
        for(e = cb; e.cbc_next; e = e.cbc_next)
        {
                while(e.cbc_next.cbc_func == func)
index 960e59d67492f8ddf5ad3959515d303932c9f043..f37d3071fe69852a6bb00ba1b6e1677f97a51982 100644 (file)
@@ -462,6 +462,7 @@ void CheckAllowedTeams (entity for_whom)
        c1 = c2 = c3 = c4 = -1;
        cb1 = cb2 = cb3 = cb4 = 0;
 
+       teament_name = string_null;
        if(g_onslaught)
        {
                // onslaught is special
index bcf12afa9a8c2eda4bfd36b2afdf9dfb602f488f..1cd8b812cee7e1bc324b824d964459269820bd9d 100644 (file)
@@ -38,6 +38,8 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        entity pseudoprojectile;
        float f, ffs;
 
+       pseudoprojectile = world;
+
        railgun_start = start;
        railgun_end = end;