lv_tempBits=libWASD_gv_wASDState[lp_player];if(lv_tempBits==0x0001){//W pressed//W is pressed}elseif(lv_tempBits==0x0010){//A pressedreturnUnitGetFacing(libWASD_gv_controlledUnits[lp_player])+2;}elseif(lv_tempBits==0x0100){//S pressed//S is pressed}elseif(lv_tempBits==0x1000){//D pressedreturnUnitGetFacing(libWASD_gv_controlledUnits[lp_player])-2;}return0;
I'm a bit confused right now. I don't understand what's the purpose of this function in combination with what you want.
I've looked at rrowland's library a while ago and I remember it's using bits to save the movement keys, so I got that. But looking at your modification it seems that the only thing you want to do is to get a unit's facing. Why modify that function?
If I remember correctly the original purpose of this function was not to return a unit's facing angle, but to turn the bit number into a degree angle.
So doesn't this solve your problem:
I'm a bit confused right now. I don't understand what's the purpose of this function in combination with what you want.
I've looked at rrowland's library a while ago and I remember it's using bits to save the movement keys, so I got that. But looking at your modification it seems that the only thing you want to do is to get a unit's facing. Why modify that function?
If I remember correctly the original purpose of this function was not to return a unit's facing angle, but to turn the bit number into a degree angle.