mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
Also reset all entries when freeing TabList component to 0, hopefully fixes a certain plugin crashing
This commit is contained in:
parent
0877f01775
commit
391c385c2f
@ -747,17 +747,16 @@ 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);
|
||||
}
|
||||
|
||||
struct IGameComponent TabList_Component = {
|
||||
NULL, /* Init */
|
||||
TabList_Free, /* Free */
|
||||
TabList_Reset /* Reset */
|
||||
NULL, /* Init */
|
||||
TabList_Clear, /* Free */
|
||||
TabList_Clear /* Reset */
|
||||
};
|
||||
|
||||
|
||||
|
@ -757,7 +757,7 @@ void Waitable_WaitFor(void* handle, cc_uint32 milliseconds) {
|
||||
gettimeofday(&tv, NULL);
|
||||
|
||||
/* absolute time for some silly reason */
|
||||
ts.tv_sec = tv.tv_sec + milliseconds / 1000;
|
||||
ts.tv_sec = tv.tv_sec + milliseconds / 1000;
|
||||
ts.tv_nsec = 1000 * (tv.tv_usec + 1000 * (milliseconds % 1000));
|
||||
ts.tv_sec += ts.tv_nsec / NS_PER_SEC;
|
||||
ts.tv_nsec %= NS_PER_SEC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user