diff --git a/code/q3_ui/ui_gameinfo.c b/code/q3_ui/ui_gameinfo.c index 14e0c7d9..d839723c 100644 --- a/code/q3_ui/ui_gameinfo.c +++ b/code/q3_ui/ui_gameinfo.c @@ -659,7 +659,7 @@ Returns the next level the player has not won */ int UI_GetCurrentGame( void ) { int level; - int rank; + int rank = 0; int skill; const char *info; diff --git a/code/q3_ui/ui_players.c b/code/q3_ui/ui_players.c index b91073a9..7a04fb1c 100644 --- a/code/q3_ui/ui_players.c +++ b/code/q3_ui/ui_players.c @@ -689,12 +689,12 @@ UI_DrawPlayer */ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time ) { refdef_t refdef; - refEntity_t legs; - refEntity_t torso; - refEntity_t head; - refEntity_t gun; - refEntity_t barrel; - refEntity_t flash; + refEntity_t legs = {0}; + refEntity_t torso = {0}; + refEntity_t head = {0}; + refEntity_t gun = {0}; + refEntity_t barrel = {0}; + refEntity_t flash = {0}; vec3_t origin; int renderfx; vec3_t mins = {-16, -16, -24}; diff --git a/code/q3_ui/ui_preferences.c b/code/q3_ui/ui_preferences.c index ca0f628f..b65728a5 100644 --- a/code/q3_ui/ui_preferences.c +++ b/code/q3_ui/ui_preferences.c @@ -353,7 +353,6 @@ static void Preferences_MenuInit( void ) { s_preferences.allowdownload.generic.x = PREFERENCES_X_POS; s_preferences.allowdownload.generic.y = y; - y += BIGCHAR_HEIGHT+2; s_preferences.back.generic.type = MTYPE_BITMAP; s_preferences.back.generic.name = ART_BACK0; s_preferences.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; diff --git a/code/q3_ui/ui_team.c b/code/q3_ui/ui_team.c index e15dde63..220bc856 100644 --- a/code/q3_ui/ui_team.c +++ b/code/q3_ui/ui_team.c @@ -150,7 +150,6 @@ void TeamMain_MenuInit( void ) { s_teammain.spectate.string = "SPECTATE"; s_teammain.spectate.style = UI_CENTER|UI_SMALLFONT; s_teammain.spectate.color = colorRed; - y += 20; trap_GetConfigString(CS_SERVERINFO, info, MAX_INFO_STRING); gametype = atoi( Info_ValueForKey( info,"g_gametype" ) ); diff --git a/code/q3_ui/ui_video.c b/code/q3_ui/ui_video.c index d37a8149..9d92e91e 100644 --- a/code/q3_ui/ui_video.c +++ b/code/q3_ui/ui_video.c @@ -1138,7 +1138,6 @@ void GraphicsOptions_MenuInit( void ) s_graphicsoptions.driverinfo.string = "Driver Info"; s_graphicsoptions.driverinfo.style = UI_CENTER|UI_SMALLFONT; s_graphicsoptions.driverinfo.color = color_red; - y += BIGCHAR_HEIGHT+2; s_graphicsoptions.back.generic.type = MTYPE_BITMAP; s_graphicsoptions.back.generic.name = GRAPHICSOPTIONS_BACK0; diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c index f200202d..a5f8582c 100644 --- a/code/ui/ui_shared.c +++ b/code/ui/ui_shared.c @@ -4203,12 +4203,12 @@ void Menu_HandleMouseMove(menuDef_t *menu, float x, float y) { } } } - } else if (menu->items[i]->window.flags & WINDOW_MOUSEOVER) { - Item_MouseLeave(menu->items[i]); - Item_SetMouseOver(menu->items[i], qfalse); - } - } - } + } else if (menu->items[i] && menu->items[i]->window.flags & WINDOW_MOUSEOVER) { + Item_MouseLeave(menu->items[i]); + Item_SetMouseOver(menu->items[i], qfalse); + } + } + } } @@ -5518,6 +5518,9 @@ qboolean MenuParse_itemDef( itemDef_t *item, int handle ) { menuDef_t *menu = (menuDef_t*)item; if (menu->itemCount < MAX_MENUITEMS) { menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t)); + if (!menu->items[menu->itemCount]) { + return qfalse; + } Item_Init(menu->items[menu->itemCount]); if (!Item_Parse(handle, menu->items[menu->itemCount])) { return qfalse;