aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-06-08 08:47:31 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-06-08 08:47:31 -0400
commit6882786999581e2280c870249ae448c744767e73 (patch)
tree665eb129c395250e3f390d5e86ac8896ac636322 /src/inventory.cpp
parent7110a4ab054341c9f41972b06044853138f526a8 (diff)
parenta978ddfb98734514874231ed28d0395533afa25d (diff)
merge; lights, xmls
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index e235f51..ede5eeb 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -91,6 +91,11 @@ void items(void)
ItemMap.push_back(new Food());
+ // light
+ } else if (strCaseCmp(name, "light")) {
+
+ ItemMap.push_back(new ItemLight());
+
// if type was not specified make it a base item
} else {
@@ -98,7 +103,9 @@ void items(void)
}
// set how much of the item we can stack
- ItemMap.back()->maxStackSize = exml->UnsignedAttribute("maxStackSize");
+ if(exml->QueryUnsignedAttribute("maxStackSize", &ItemMap.back()->maxStackSize) != XML_NO_ERROR) {
+ ItemMap.back()->maxStackSize = 1;
+ }
// set all of the texture frames we can use
ItemMap.back()->tex = new Texturec(1, exml->Attribute("sprite"));