aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
commit0a06697db87063b77b71388278933807899568ef (patch)
treebb8d876e266761c7aac8656c2d75793855826bd0 /src/inventory.cpp
parent5fadac5d0f37f574ca160107d832d11b421ad559 (diff)
parent30dd8efe8d71648bea7604ebee5afc4d55b25a6b (diff)
merge
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp11
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)