]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Workaround for occasional crashes caused by the hud code (please test)
authorterencehill <piuntn@gmail.com>
Sat, 1 Jun 2013 14:09:33 +0000 (16:09 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 1 Jun 2013 14:09:33 +0000 (16:09 +0200)
qcsrc/client/hud.qc
qcsrc/client/hud.qh

index 469fe67fa27d1524e8f541adaf86602b46f3be90..273f427e49d11b182662b0a9566c80734e1051f7 100644 (file)
@@ -264,7 +264,7 @@ HUD panels
 
 // draw the background/borders
 #define HUD_Panel_DrawBg(theAlpha)\
-if(panel_bg != "0")\
+if(panel_bg != "0" && panel_bg != "")\
        draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER))
 
 //basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
index 19cd36ddb0b0551bd4bc6833ef5b73f8be5da9d4..5a7e603351c4cfb292de7697d0c65c4b84d3fdff 100644 (file)
@@ -340,8 +340,13 @@ if(panel.update_time <= time) { \
        } \
        panel.current_panel_pos = panel_pos; \
        panel.current_panel_size = panel_size; \
-       if(panel.current_panel_bg != "") \
+       if(panel.current_panel_bg) \
                strunzone(panel.current_panel_bg); \
+       if(panel_bg == "")\
+       {\
+               print(sprintf("^xf08 %s panel: panel_bg is empty\n", panel.panel_name));\
+               panel_bg = "0";\
+       }\
        panel.current_panel_bg = strzone(panel_bg); \
        panel.current_panel_bg_alpha = panel_bg_alpha; \
        panel.current_panel_bg_border = panel_bg_border; \
@@ -354,6 +359,11 @@ if(panel.update_time <= time) { \
        panel_pos = panel.current_panel_pos; \
        panel_size = panel.current_panel_size; \
        panel_bg = panel.current_panel_bg; \
+       if(panel.current_panel_bg == "")\
+       {\
+               print(sprintf("^xf08 %s panel: panel.current_panel_bg is empty\n", panel.panel_name));\
+               panel_bg = "0";\
+       }\
        panel_bg_alpha = panel.current_panel_bg_alpha; \
        panel_bg_border = panel.current_panel_bg_border; \
        panel_bg_color = panel.current_panel_bg_color; \