diff --git a/src/BlockPhysics.c b/src/BlockPhysics.c index 280f8381a..4e577746f 100644 --- a/src/BlockPhysics.c +++ b/src/BlockPhysics.c @@ -12,6 +12,7 @@ #include "Game.h" #include "ErrorHandler.h" #include "Vectors.h" +#include "Chat.h" /* Data for a resizable queue, used for liquid physic tick entries. */ struct TickQueue { @@ -40,7 +41,9 @@ static void TickQueue_Clear(struct TickQueue* queue) { static void TickQueue_Resize(struct TickQueue* queue) { if (queue->BufferSize >= (Int32_MaxValue / 4)) { - ErrorHandler_Fail("TickQueue - too large to resize."); + Chat_AddRaw("&cTickQueue too large, clearing"); + TickQueue_Clear(queue); + return; } UInt32 capacity = queue->BufferSize * 2; diff --git a/src/Physics.c b/src/Physics.c index ae642c914..239410134 100644 --- a/src/Physics.c +++ b/src/Physics.c @@ -158,8 +158,8 @@ Int32 Searcher_FindReachableBlocks(struct Entity* entity, struct AABB* entityBB, UInt32 elements = (max.X - min.X + 1) * (max.Y - min.Y + 1) * (max.Z - min.Z + 1); if (elements > Searcher_StatesMax) { Searcher_Free(); - Searcher_StatesCount = elements; - Searcher_States = Mem_Alloc(elements, sizeof(struct SearcherState), "collision search states"); + Searcher_StatesMax = elements; + Searcher_States = Mem_Alloc(elements, sizeof(struct SearcherState), "collision search states"); } /* Order loops so that we minimise cache misses */ diff --git a/src/Platform.c b/src/Platform.c index 4197b2165..9db8a28ad 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -127,7 +127,7 @@ void* Mem_Realloc(void* mem, UInt32 numElems, UInt32 elemsSize, const UChar* pla } void Mem_Free(void* mem) { - if (mem) free(*mem); + if (mem) free(mem); } #endif