]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Inventory.cpp
added scenario items to inventory
[l2e.git] / src / common / Inventory.cpp
index d8ba20c08af5a35c0af1d1311ab2474259634449..275de538f49f83eb344b549d55f1b41fad81f10f 100644 (file)
@@ -14,7 +14,8 @@
 
 namespace common {
 
-Inventory::Inventory() {
+Inventory::Inventory()
+: scenarioEnd(0) {
 
 }
 
@@ -71,6 +72,17 @@ bool Inventory::SloteFree(int offset) const {
 }
 
 
+bool Inventory::AddScenarioItem(const Item *i) {
+       if (scenarioEnd < MaxScenarioItems()) {
+               scenario[scenarioEnd] = i;
+               ++scenarioEnd;
+               return true;
+       } else {
+               return false;
+       }
+}
+
+
 void Inventory::Sort() {
        std::sort(entries, entries + 96, Entry::Less);
 }