if(gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT) != me.nItems)
return; // sorry, it would be wrong
- if(me.selectedServer)
- strunzone(me.selectedServer);
- me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
+ strcpy(me.selectedServer, gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
me.ipAddressBox.setText(me.ipAddressBox, me.selectedServer);
me.ipAddressBox.cursorPos = strlen(me.selectedServer);
{
if(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem) != me.selectedServer)
{
- if(me.selectedServer)
- strunzone(me.selectedServer);
- me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
+ strcpy(me.selectedServer, gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
}
found = true;
}
// selected server disappeared, select the last server (scrolling to it)
if(me.selectedItem >= me.nItems)
SUPER(XonoticServerList).setSelected(me, me.nItems - 1);
- if(me.selectedServer)
- strunzone(me.selectedServer);
- me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
+ strcpy(me.selectedServer, gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
}
}