for(i = 0; i < category_ent_count; ++i) \
{ \
s = categories[i].override_string; \
- if((s != "") && (s != categories[i].cat_name)) \
+ if(s != "" && s != categories[i].cat_name) \
{ \
catnum = 0; \
for(x = 0; x < category_ent_count; ++x) \
- { if(categories[x].cat_name == s) { \
- catnum = (x+1); \
- break; \
- } } \
+ { \
+ if(categories[x].cat_name == s) \
+ { \
+ catnum = x + 1; \
+ break; \
+ } \
+ } \
if(catnum) \
{ \
- strunzone(categories[i].override_string); \
- categories[i].override_string = string_null; \
+ strfree(categories[i].override_string); \
categories[i].override_field = catnum; \
continue; \
} \
); \
} \
} \
- strunzone(categories[i].override_string); \
- categories[i].override_string = string_null; \
+ strfree(categories[i].override_string); \
categories[i].override_field = 0; \
}
PROCESS_OVERRIDE(cat_enoverride_string, cat_enoverride)
else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); }
me.connectButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+ me.disconnectButton.disabled = (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)));
me.infoButton.disabled = (me.lockedSelectedItem || me.nItems == 0 || !owned);
me.favoriteButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
}
void ServerList_Filter_Change(entity box, entity me)
{
- if(me.filterString)
- strunzone(me.filterString);
+ strfree(me.filterString);
if(box.text != "")
me.filterString = strzone(box.text);
- else
- me.filterString = string_null;
me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
me.ipAddressBox.setText(me.ipAddressBox, "");
me.sortButton4.forcePressed = 0;
me.sortButton5.forcePressed = (fld == SLIST_FIELD_NUMHUMANS);
me.selectedItem = 0;
- if(me.selectedServer)
- strunzone(me.selectedServer);
- me.selectedServer = string_null;
+ strfree(me.selectedServer);
me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
}
void XonoticServerList_positionSortButton(entity me, entity btn, float theOrigin, float theSize, string theTitle, void(entity, entity) theFunc)
vector oldscale = draw_scale;
vector oldshift = draw_shift;
#define SET_YRANGE(start,end) \
- draw_scale = boxToGlobalSize(eX * 1 + eY * (end - start), oldscale); \
+ draw_scale = boxToGlobalSize(eX + eY * (end - start), oldscale); \
draw_shift = boxToGlobal(eY * start, oldshift, oldscale);
for (j = 0; j < category_draw_count; ++j) {