It's because they assumed that all fields were 4 bytes and aligned properly as in 32bits.
But here sizeof(bool) != 4
We should find another way to count the number of fields. The code remains valid since they use offsetof on each fields when checking/sending the state.
Since we now use
bool
instead ofqboolean
, the assert here is wrong :https://github.com/CleanJK/CleanJK/blob/master/codemp/qcommon/msg.cpp#L1492
It's because they assumed that all fields were 4 bytes and aligned properly as in 32bits.
But here
sizeof(bool) != 4
We should find another way to count the number of fields. The code remains valid since they use
offsetof
on each fields when checking/sending the state.