-
Notifications
You must be signed in to change notification settings - Fork 29
Fix aimZ invisible
Nexius edited this page Oct 14, 2024
·
11 revisions
#if !defined IsNaN
#define IsNaN(%0) ((%0) != (%0))
#endif
const AIM_SYNC = 203;
IPacket:AIM_SYNC(playerid, BitStream:bs)
{
new aimData[PR_AimSync];
BS_IgnoreBits(bs, 8); // ignore packetid (byte)
BS_ReadAimSync(bs, aimData);
if (IsNaN(aimData[PR_aimZ])) {
return 0; // ignore bad packet
}
return 1;
}
#if !defined IsNaN
#define IsNaN(%0) ((%0) != (%0))
#endif
const AIM_SYNC = 203;
IPacket:AIM_SYNC(playerid, BitStream:bs)
{
new aimData[PR_AimSync];
BS_IgnoreBits(bs, 8); // ignore packetid (byte)
BS_ReadAimSync(bs, aimData);
if (IsNaN(aimData[PR_aimZ])) {
aimData[PR_aimZ] = 0.0;
BS_SetWriteOffset(bs, 8);
BS_WriteAimSync(bs, aimData); // rewrite
}
return 1;
}
- Refer to BrunoBM16's RPC and Packet lists