25.09.2009, 08:03
if((newkeys & key) && !(oldkeys & key)) and if(newkeys - oldkeys == KEY_JUMP) Same
If the player has clamped KEY_SPRINT (8 ) and at this time has pressed KEY_JUMP (32) in public will return:
newkeys = KEY_SPRINT (8 ) + KEY_JUMP (32) = 40
oldkeys = KEY_SPRINT (8 )
newkeys - oldkeys = 40 - KEY_SPRINT (8 ) = KEY_JUMP (32) - Key pressing
oldkeys - newkeys = 40 - KEY_SPRINT (8 ) = KEY_JUMP (32) - Key unpressing
All is considered
If the player has clamped KEY_SPRINT (8 ) and at this time has pressed KEY_JUMP (32) in public will return:
newkeys = KEY_SPRINT (8 ) + KEY_JUMP (32) = 40
oldkeys = KEY_SPRINT (8 )
newkeys - oldkeys = 40 - KEY_SPRINT (8 ) = KEY_JUMP (32) - Key pressing
oldkeys - newkeys = 40 - KEY_SPRINT (8 ) = KEY_JUMP (32) - Key unpressing
All is considered