Skip to content
Permalink
Browse files

Discard texture lookups for other models when quickly loading differe…

…nt models
  • Loading branch information...
Marlamin committed Oct 8, 2019
1 parent 5adf101 commit d72606b7f6a82fbb90e62616d01c3372ea9421da
Showing with 8 additions and 3 deletions.
  1. +8 −3 mv/modelviewer.js
@@ -331,9 +331,15 @@ function loadModel(type, filedataid, buildconfig, cdnconfig){
function loadModelTextures() {
//TODO build, fix wrong skin showing up after initial load
var loadedTextures = Array();

var currentFDID = Current.fileDataID;
$.ajax({url: "https://wow.tools/api/texture/" + Current.fileDataID + "?build=" + Current.buildName}).done( function(data) {
console.log(data);
console.log("Texture lookup", data);
var forFDID = this.url.replace("https://wow.tools/api/texture/", "").replace("?build=" + Current.buildName, "");
if(Current.fileDataID != forFDID){
console.log("This request is not for this filedataid, discarding..");
return;
}

var i = 0;
$("#skinSelect").empty();
for (let displayId in data) {
@@ -363,7 +369,6 @@ function loadModelTextures() {

loadedTextures.push(data[displayId].join(','));

console.log(loadedTextures);
$.ajax({
type: 'GET',
url: "https://wow.tools/files/scripts/filedata_api.php",

0 comments on commit d72606b

Please sign in to comment.
You can’t perform that action at this time.