From 465bd7f96fbae44067bd342649e52c9187853b39 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 30 Oct 2015 14:05:05 +0100 Subject: [PATCH] use player's inventory slot directly in interface --- src/ui/Interface.hpp | 1 - src/ui/ui.cpp | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ui/Interface.hpp b/src/ui/Interface.hpp index 92d1c94..9a6e927 100644 --- a/src/ui/Interface.hpp +++ b/src/ui/Interface.hpp @@ -42,7 +42,6 @@ private: ClientController &client_ctrl; glm::ivec3 fwd, rev; - int slot; int num_slots; bool locked; 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); } -- 2.39.2