From 98756df9f75ffaf11a7dc3bffc108cb85289b3bf Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 9 Mar 2020 18:03:25 +0900 Subject: [PATCH] [gamecode] Set final resource map free list pointer The sub-tables were being properly linked together, but the very final table was not properly terminated. --- include/QF/progs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/QF/progs.h b/include/QF/progs.h index ea17f533e..1ef71aeb2 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -1491,6 +1491,8 @@ void *PR_Resources_Find (progs_t *pr, const char *name); Any memory allocated to the resource must be freed before freeing the resource. + A reset resource map is guaranteed to allocate elements sequentially. + \param type The type of the resource. Must match the \c type parameter used for PR_RESMAP. \param map The resource map. @@ -1505,6 +1507,8 @@ void *PR_Resources_Find (progs_t *pr, const char *name); *(type **) &map._free[j] = &map._free[j + 1]; \ if (i < map._size - 1) \ *(type **) &map._free[j] = &map._map[i + 1][0]; \ + else \ + *(type **) &map._free[j] = 0; \ } \ map._free = map._map[0];