Don't apply downloaded texture pack if the URL changes, fixes #426

This can happen if texture pack takes a long time to download and the user changes maps.
This commit is contained in:
UnknownShadow200 2019-06-21 20:36:13 +10:00
parent 0f425a8a70
commit d78b31a941

View File

@ -734,8 +734,10 @@ void TexturePack_Extract_Req(struct HttpRequest* item) {
bool png;
ReturnCode res;
url = String_FromRawArray(item->URL);
String_Copy(&World_TextureUrl, &url);
url = String_FromRawArray(item->URL);
/* Took too long to download and is no longer active texture pack */
if (!String_Equals(&World_TextureUrl, &url)) return;
data = item->Data;
len = item->Size;
Stream_ReadonlyMemory(&mem, data, len);