mirror of https://gitlab.com/drummyfish/anarch.git
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)
|
void SFG_playerRotateWeapon(uint8_t next)
|
||||||
{
|
{
|
||||||
RCL_Unit initialWeapon = SFG_player.weapon;
|
uint8_t initialWeapon = SFG_player.weapon;
|
||||||
RCL_Unit increment = next ? 1 : -1;
|
int8_t increment = next ? 1 : -1;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
SFG_player.weapon =
|
SFG_player.weapon =
|
||||||
RCL_wrap(SFG_player.weapon + increment,SFG_WEAPONS_TOTAL);
|
(SFG_WEAPONS_TOTAL + SFG_player.weapon + increment) % SFG_WEAPONS_TOTAL;
|
||||||
|
|
||||||
if (SFG_player.weapon == initialWeapon)
|
if (SFG_player.weapon == initialWeapon)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue