From 47e0dbb02869909b451fba3dac49eae449706c3f Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 11 Jan 2026 20:38:20 -0600 Subject: [PATCH] chore(object): tidy up ExtractDirtyMasks --- src/object/client/Mirror.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/object/client/Mirror.cpp b/src/object/client/Mirror.cpp index eac065d..1168d88 100644 --- a/src/object/client/Mirror.cpp +++ b/src/object/client/Mirror.cpp @@ -8,14 +8,15 @@ #include "object/client/CGPlayer.hpp" #include "object/client/CGUnit.hpp" #include "object/client/ObjMgr.hpp" +#include "object/Types.hpp" #include -#define MAX_DIRTY_MASKS 42 +#define MAX_CHANGE_MASKS 42 /** - * Given a message data store, extract the dirty masks contained inside. Any masks not present are - * zeroed out. This function assumes the provided masks pointer has enough space for - * MAX_DIRTY_MASKS. + * Given a message data store, extract the dirty change masks contained inside. Any masks not + * present are zeroed out. This function assumes the provided masks pointer has enough space for + * MAX_CHANGE_MASKS. */ int32_t ExtractDirtyMasks(CDataStore* msg, uint8_t* maskCount, uint32_t* masks) { uint8_t count; @@ -23,7 +24,7 @@ int32_t ExtractDirtyMasks(CDataStore* msg, uint8_t* maskCount, uint32_t* masks) *maskCount = count; - if (count > MAX_DIRTY_MASKS) { + if (count > MAX_CHANGE_MASKS) { return 0; } @@ -31,8 +32,8 @@ int32_t ExtractDirtyMasks(CDataStore* msg, uint8_t* maskCount, uint32_t* masks) msg->Get(masks[i]); } - // Zero out unused masks - memset(&masks[count], 0, (MAX_DIRTY_MASKS - count) * sizeof(uint32_t)); + // Zero out masks that aren't present + memset(&masks[count], 0, (MAX_CHANGE_MASKS - count) * sizeof(uint32_t)); return 1; }