X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FInventory.cpp;h=275de538f49f83eb344b549d55f1b41fad81f10f;hb=ee953c3847abc32c3e369672b7c35424f061765c;hp=d8ba20c08af5a35c0af1d1311ab2474259634449;hpb=a115853500fdaf2715ce3dceef568fed3884d163;p=l2e.git diff --git a/src/common/Inventory.cpp b/src/common/Inventory.cpp index d8ba20c..275de53 100644 --- a/src/common/Inventory.cpp +++ b/src/common/Inventory.cpp @@ -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); }