mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
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:
parent
4c26b1a8ae
commit
12355316b3
5 changed files with 67 additions and 66 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue