Skip to content

Fix "Unoccupied" crasher

urShadow edited this page Aug 18, 2018 · 4 revisions

by Михаил Иванович & Альберт Миронов

const UNOCCUPIED_SYNC = 209;

IPacket:UNOCCUPIED_SYNC(playerid, BitStream:bs)
{
    new unoccupiedData[PR_UnoccupiedSync];
 
    BS_IgnoreBits(bs, 8);
    BS_ReadUnoccupiedSync(bs, unoccupiedData);
 
    if(floatcmp(floatabs(unoccupiedData[PR_roll][0]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_roll][1]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_roll][2]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_direction][0]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_direction][1]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_direction][2]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_position][0]), 20000.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_position][1]), 20000.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_position][2]), 20000.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_angularVelocity][0]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_angularVelocity][1]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_angularVelocity][2]), 1.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_velocity][0]), 100.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_velocity][1]), 100.00000) == 1
        || floatcmp(floatabs(unoccupiedData[PR_velocity][2]), 100.00000) == 1
    ) {
        return false;
    }

    return true;
}
You can’t perform that action at this time.