From bd4c07f6eaa2cca8774e787139a342b3755fca01 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 24 May 2023 00:27:53 +0300 Subject: [PATCH] fix heretic2 like sprite path --- src/files/models.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/files/models.c b/src/files/models.c index 87e7354..1ed083d 100644 --- a/src/files/models.c +++ b/src/files/models.c @@ -1194,6 +1194,13 @@ Mod_LoadSP2 (const char *mod_name, const void *buffer, int modfilelen, memcpy(sprout->frames[i].name, sprin->frames[i].name, MAX_SKINNAME); skins[i] = find_image((char *)sprout->frames[i].name, it_sprite); + if (!skins[i]) + { + /* heretic2 sprites have no "sprites/" prefix */ + snprintf(sprout->frames[i].name, MAX_SKINNAME, + "sprites/%s", sprin->frames[i].name); + skins[i] = find_image(sprout->frames[i].name, it_sprite); + } } *type = mod_sprite; @@ -1298,7 +1305,9 @@ Mod_ReLoadSkins(struct image_s **skins, findimage_t find_image, void *extradata, sprout = (dsprite_t *)extradata; for (i=0 ; inumframes ; i++) - skins[i] = find_image (sprout->frames[i].name, it_sprite); + { + skins[i] = find_image(sprout->frames[i].name, it_sprite); + } return sprout->numframes; } else if (type == mod_alias)