X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fplayermodel.qc;h=08518d1312a6fd3f59351ca38fcc8daa229c9a8d;hb=abf4b5a430d71fc83abbe90da9b17b457a65e149;hp=1a90fa737827bc8e2afaa6b074306d815439d046;hpb=edf01df130d0d1877461561178b8833a9ab6051c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/playermodel.qc b/qcsrc/menu/xonotic/playermodel.qc index 1a90fa737..08518d131 100644 --- a/qcsrc/menu/xonotic/playermodel.qc +++ b/qcsrc/menu/xonotic/playermodel.qc @@ -27,7 +27,7 @@ void XonoticPlayerModelSelector_loadModels(entity me) int i; string fn; - float glob = search_begin(language_filename(get_model_datafilename(string_null, -1, "txt")), true, true); + float glob = search_begin(get_model_datafilename(string_null, -1, "txt"), true, true); if (glob < 0) return; @@ -38,6 +38,8 @@ void XonoticPlayerModelSelector_loadModels(entity me) fn = search_getfilename(glob, i); if(!get_model_parameters(fn, -1)) continue; + if(get_model_parameters_hidden) + continue; bufstr_add(sortbuf, sprintf("%-128s%s", get_model_parameters_name, fn), 1); } search_end(glob); @@ -49,6 +51,8 @@ void XonoticPlayerModelSelector_loadModels(entity me) fn = substring(bufstr_get(sortbuf, i), 128, -1); if(!get_model_parameters(fn, -1)) error("But it JUST worked!"); + if(get_model_parameters_hidden) + continue; bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_TITLE, get_model_parameters_name); bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_IMAGE, strcat("/", substring(get_model_datafilename(get_model_parameters_modelname, get_model_parameters_modelskin, "tga"), 0, -5))); bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_MODEL, get_model_parameters_modelname); @@ -109,21 +113,12 @@ void XonoticPlayerModelSelector_go(entity me, float d) { me.idxModels = mod(me.idxModels + d + me.numModels, me.numModels); - if(me.currentModel) - strunzone(me.currentModel); - if(me.currentModelTitle) - strunzone(me.currentModelTitle); - if(me.currentModelImage) - strunzone(me.currentModelImage); - if(me.currentModelDescription) - strunzone(me.currentModelDescription); - // select model #i! - me.currentModelTitle = strzone(bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_TITLE)); - me.currentModelImage = strzone(bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_IMAGE)); + strcpy(me.currentModelTitle, bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_TITLE)); + strcpy(me.currentModelImage, bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_IMAGE)); me.currentSkin = stof(bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_SKIN)); - me.currentModel = strzone(bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_MODEL)); - me.currentModelDescription = strzone(bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_DESC)); + strcpy(me.currentModel, bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_MODEL)); + strcpy(me.currentModelDescription, bufstr_get(me.bufModels, BUFMODELS_COUNT*me.idxModels+BUFMODELS_DESC)); // fix the image if(draw_PictureSize(me.currentModelImage) == '0 0 0')