CleanJK / cleanjk

GNU General Public License v2.0
7 stars 3 forks source link

Assert in MSG_WriteDeltaEntity() being wrong cause of bool change #45

Open Yberion opened 4 years ago

Yberion commented 4 years ago

Since we now use bool instead of qboolean, 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.