Hello

I am trying to make sure that on a weapon with 1 bullet in the magazine and 1 bullet in the reserve it goes into the magazine and no more, like: 1/1 to 2/0 once reloaded.
I turn the problem around and it gives me pretty funny results. The best I managed to do and have 1/1 and when recharging 30/0 ... yes I do not understand why he gives me 30 which is a full charger. But it is a value given during an operation.
In the case of 1/1. After press Reload
Float operator
Float 1: Ammo (which has 30 base)
30.0 <- have 1 before press R
Float 2: 30
Operation: subtract
Store: difference
-29.0
Float Add
Float variable: Total ammo. (which in the fsm at this time cannot be higher than 30 because I separated in 2 parts because above 30 it works well, and for debug too)
0.0
Add: Difference
-29.0
Float Subtract
Float variable: Ammo
30.0
Subtract: Difference
-29.0
The result 30/0
I have tried several ways, some even I do not know where I went to look for them.
I had to do 10 ways, inverted the variables, actions, do several operations to define (tried) what remains and what we put. But the result is that ......... I'm not good at math it seems.
There you go, thank you for taking the time to read this.
ps translate by google