diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 7400f89..e82d99e 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -68,7 +68,7 @@ int Inventory::takeItem(std::string name,uint count){ } if(id == 999999) - return -1; + return -1; //if no such item exists /* * Inventory lookup @@ -141,6 +141,15 @@ const char *getItemTexturePath(std::string name){ return NULL; } +GLuint getItemTexture(std::string name){ + for(auto &i : itemMap){ + if(i->name == name) + return Texture::loadTexture(i->texloc); + } + + return Texture::loadTexture("assets/items/ITEM_TEST.png"); +} + float getItemWidth(std::string name){ for(auto &i : itemMap){ if(i->name == name) |