refactor: add Packet::hasData(), replace 52 position checks and 14 more Lua guards

Add Packet::hasData() for 'has remaining data' checks, replacing 52
verbose getReadPos()<getSize() comparisons across 3 files. Also replace
14 more standalone Lua return patterns with luaReturnNil/Zero helpers.
This commit is contained in:
Kelsi 2026-03-25 14:39:01 -07:00
parent 4c26b1a8ae
commit 12355316b3
5 changed files with 67 additions and 66 deletions

View file

@ -46,6 +46,7 @@ public:
return getRemainingSize() >= guidBytes;
}
void setReadPos(size_t pos) { readPos = pos; }
bool hasData() const { return readPos < data.size(); }
void skipAll() { readPos = data.size(); }
private: