Also reset all entries when freeing TabList component to 0, hopefully fixes a certain plugin crashing

This commit is contained in:
UnknownShadow200 2020-09-07 14:36:07 +10:00
parent 0877f01775
commit 391c385c2f
2 changed files with 5 additions and 6 deletions

View File

@ -747,8 +747,7 @@ void TabList_Set(EntityID id, const String* player, const String* list, const St
Event_RaiseInt(events, id);
}
static void TabList_Free(void) { StringsBuffer_Clear(&TabList._buffer); }
static void TabList_Reset(void) {
static void TabList_Clear(void) {
Mem_Set(TabList.NameOffsets, 0, sizeof(TabList.NameOffsets));
Mem_Set(TabList.GroupRanks, 0, sizeof(TabList.GroupRanks));
StringsBuffer_Clear(&TabList._buffer);
@ -756,8 +755,8 @@ static void TabList_Reset(void) {
struct IGameComponent TabList_Component = {
NULL, /* Init */
TabList_Free, /* Free */
TabList_Reset /* Reset */
TabList_Clear, /* Free */
TabList_Clear /* Reset */
};