mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-12-21 23:08:49 -05:00
Fix weapon switching
This commit is contained in:
parent
4c3fe7167a
commit
46d7b003de
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
8
main.c
8
main.c
@ -1120,13 +1120,13 @@ void SFG_getPlayerWeaponInfo(
|
||||
|
||||
void SFG_playerRotateWeapon(uint8_t next)
|
||||
{
|
||||
RCL_Unit initialWeapon = SFG_player.weapon;
|
||||
RCL_Unit increment = next ? 1 : -1;
|
||||
uint8_t initialWeapon = SFG_player.weapon;
|
||||
int8_t increment = next ? 1 : -1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
SFG_player.weapon =
|
||||
RCL_wrap(SFG_player.weapon + increment,SFG_WEAPONS_TOTAL);
|
||||
SFG_player.weapon =
|
||||
(SFG_WEAPONS_TOTAL + SFG_player.weapon + increment) % SFG_WEAPONS_TOTAL;
|
||||
|
||||
if (SFG_player.weapon == initialWeapon)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user