X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2Fui.cpp;h=263245cd79bfe61ccdeb57e710bc1f5951c67fd0;hb=465bd7f96fbae44067bd342649e52c9187853b39;hp=8563f7ded08409344be3957f7620640268ca7e3f;hpb=b4e5dad2ed5c7e77573de413f3bf5be88577856d;p=blank.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 8563f7d..263245c 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -511,7 +511,6 @@ Interface::Interface( , client_ctrl(cc) , fwd(0) , rev(0) -, slot(0) , num_slots(10) , locked(false) { @@ -711,7 +710,7 @@ void Interface::UpdateMovement() { } void Interface::InvAbs(int s) { - slot = s % num_slots; + int slot = s % num_slots; while (slot < 0) { slot += num_slots; } @@ -719,7 +718,7 @@ void Interface::InvAbs(int s) { } void Interface::InvRel(int delta) { - InvAbs(slot + delta); + InvAbs(player_ctrl.GetPlayer().GetInventorySlot() + delta); }