Skip to content

Commit

Permalink
SecondaryInventory: Fix off by one error
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed Aug 11, 2018
1 parent f4d874b commit de03cef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/hud/SecondaryInventory.cpp
Expand Up @@ -312,7 +312,7 @@ Entity * SecondaryInventoryHud::getObj(const Vec2s & pos) {
if(SecondaryInventory != NULL) {
Vec2s t = (pos + Vec2s(checked_range_cast<short>(m_fadePosition), 0) - Vec2s(Vec2f(2.f, 13.f) * m_scale))
/ s16(32 * m_scale);
if(t.x >= 0 && t.x <= SecondaryInventory->m_size.x && t.y >= 0 && t.y <= SecondaryInventory->m_size.y) {
if(t.x >= 0 && t.x < SecondaryInventory->m_size.x && t.y >= 0 && t.y < SecondaryInventory->m_size.y) {
Entity * io = SecondaryInventory->slot[t.x][t.y].io;
if(!io || !(io->gameFlags & GFLAG_INTERACTIVITY)) {
return NULL;
Expand Down

0 comments on commit de03cef

Please sign in to comment.