]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
use player's inventory slot directly in interface
[blank.git] / src / ui / ui.cpp
index 8563f7ded08409344be3957f7620640268ca7e3f..263245cd79bfe61ccdeb57e710bc1f5951c67fd0 100644 (file)
@@ -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);
 }