aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index e82d99e..795fb55 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -142,12 +142,12 @@ const char *getItemTexturePath(std::string name){
}
GLuint getItemTexture(std::string name){
- for(auto &i : itemMap){
- if(i->name == name)
- return Texture::loadTexture(i->texloc);
+ for ( int i = itemMap.size(); i--; ) {
+ if ( itemMap[i]->name == name )
+ return itemtex[i];
}
-
- return Texture::loadTexture("assets/items/ITEM_TEST.png");
+ DEBUG_printf("Failed to find texture for item %s!", name.c_str() );
+ return 0;
}
float getItemWidth(std::string name){