git-svn-id: https://svn.eduke32.com/eduke32@5623 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-02-13 21:06:18 +00:00
parent 04b975f3d4
commit 9da0c09505
1 changed files with 18 additions and 0 deletions

View File

@ -42,6 +42,24 @@ dukeanim_t * g_animPtr;
dukeanim_t *Anim_Find(const char *s)
{
intptr_t ptr = hash_findcase(&h_dukeanim, s);
if (ptr == -1)
{
int const siz = Bstrlen(s) + 5;
char * const str = (char *)Xcalloc(1, siz);
maybe_append_ext(str, siz, s, ".anm");
ptr = hash_findcase(&h_dukeanim, str);
if (ptr == -1)
{
maybe_append_ext(str, siz, s, ".ivf");
ptr = hash_findcase(&h_dukeanim, str);
}
Bfree(str);
}
return (dukeanim_t *)(ptr == -1 ? NULL : (dukeanim_t *)ptr);
}