Some bugfixes from Xonotic, regarding features I ported in VT
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 23 Mar 2011 17:16:15 +0000 (19:16 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 23 Mar 2011 17:16:15 +0000 (19:16 +0200)
data/qcsrc/client/Main.qc
data/qcsrc/client/View.qc
data/qcsrc/server/cl_weaponsystem.qc

index 06bb675..d93869b 100644 (file)
@@ -143,6 +143,9 @@ void CSQC_Init(void)
                cl_announcer_prev = strzone(cvar_string("cl_announcer"));\r
        }\r
 \r
+       if(cvar("cl_reticle_item_normal")) precache_pic("gfx/reticle_normal");\r
+       if(cvar("cl_reticle_item_nex")) precache_pic("gfx/reticle_nex");\r
+\r
 #ifdef UID\r
        {\r
                // find the user ID\r
index af6ebd6..5e9d75c 100644 (file)
@@ -474,35 +474,36 @@ void CSQC_UpdateView(float w, float h)
        else if(button_zoom || zoomscript_caught)\r
                reticle_type = 1; // normal zoom\r
 \r
-       if(cvar("cl_reticle_stretch"))\r
+       if (reticle_type)\r
        {\r
-               reticle_size_x = vid_conwidth;\r
-               reticle_size_y = vid_conheight;\r
-               reticle_pos_x = 0;\r
-               reticle_pos_y = 0;\r
-       }\r
-       else\r
-       {\r
-               reticle_size_x = max(vid_conwidth, vid_conheight);\r
-               reticle_size_y = max(vid_conwidth, vid_conheight);\r
-               reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;\r
-               reticle_pos_y = (vid_conheight - reticle_size_y) / 2;\r
-       }\r
+               if(cvar("cl_reticle_stretch"))\r
+               {\r
+                       reticle_size_x = vid_conwidth;\r
+                       reticle_size_y = vid_conheight;\r
+                       reticle_pos_x = 0;\r
+                       reticle_pos_y = 0;\r
+               }\r
+               else\r
+               {\r
+                       reticle_size_x = max(vid_conwidth, vid_conheight);\r
+                       reticle_size_y = max(vid_conwidth, vid_conheight);\r
+                       reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;\r
+                       reticle_pos_y = (vid_conheight - reticle_size_y) / 2;\r
+               }\r
 \r
-       f = current_zoomfraction;\r
-       if(zoomscript_caught)\r
-               f = 1;\r
-       if(cvar("cl_reticle_item_normal"))\r
-       {\r
-               precache_pic("gfx/reticle_normal");\r
-               if(reticle_type == 1 && f)\r
-                       drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * cvar("cl_reticle_item_normal"), DRAWFLAG_NORMAL);\r
-       }\r
-       if(cvar("cl_reticle_item_weapon"))\r
-       {\r
-               precache_pic("gfx/reticle_weapon");\r
-               if(reticle_type == 2 && f)\r
-                       drawpic(reticle_pos, "gfx/reticle_weapon", reticle_size, '1 1 1', f * cvar("cl_reticle_item_weapon"), DRAWFLAG_NORMAL);\r
+               f = current_zoomfraction;\r
+               if(zoomscript_caught)\r
+                       f = 1;\r
+               if(cvar("cl_reticle_item_normal"))\r
+               {\r
+                       if(reticle_type == 1 && f)\r
+                               drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * cvar("cl_reticle_item_normal"), DRAWFLAG_NORMAL);\r
+               }\r
+               if(cvar("cl_reticle_item_weapon"))\r
+               {\r
+                       if(reticle_type == 2 && f)\r
+                               drawpic(reticle_pos, "gfx/reticle_weapon", reticle_size, '1 1 1', f * cvar("cl_reticle_item_weapon"), DRAWFLAG_NORMAL);\r
+               }\r
        }\r
 \r
        // screen effects\r
index b2706ec..10fef52 100644 (file)
@@ -1574,15 +1574,14 @@ void W_ReloadedAndReady()
        self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading\r
 \r
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load\r
-       if(!self.reload_ammo_min)\r
+       if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO)\r
                self.clip_load = self.reload_ammo_amount;\r
        else\r
        {\r
                while(self.clip_load < self.reload_ammo_amount && self.(self.current_ammo)) // make sure we don't add more ammo than we have\r
                {\r
                        self.clip_load += 1;\r
-                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
-                               self.(self.current_ammo) -= 1;\r
+                       self.(self.current_ammo) -= 1;\r
                }\r
        }\r
        self.weapon_load[self.weapon] = self.clip_load;\r
@@ -1626,6 +1625,7 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
 \r
        // no ammo, so nothing to load\r
        if(!self.(self.current_ammo) && self.reload_ammo_min)\r
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
        {\r
                if(clienttype(self) == CLIENTTYPE_REAL && self.reload_complain < time)\r
                {\r