}
void XonoticGametypeList_configureXonoticGametypeList(entity me)
{
- float i;
me.configureXonoticListBox(me);
me.nItems = GameType_GetCount();
// we want the pics mipmapped
- for(i = 0; i < GameType_GetCount(); ++i)
+ for(int i = 0; i < GameType_GetCount(); ++i)
draw_PreloadPictureWithFlags(GameType_GetIcon(i), PRECACHE_PIC_MIPMAP);
me.loadCvars(me);
}
void XonoticGametypeList_saveCvars(entity me)
{
- float t;
- t = GameType_GetID(me.selectedItem);
- if(t == MapInfo_CurrentGametype())
+ int t = GameType_GetID(me.selectedItem);
+ if (t == MapInfo_CurrentGametype()) {
return;
+ }
MapInfo_SwitchGameType(t);
- me.parent.gameTypeChangeNotify(me.parent);
+ entity owner = me.parent;
+ if (owner) { // not set immediately
+ owner.gameTypeChangeNotify(owner);
+ }
}
void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
{