Skip to content

Commit

Permalink
NWN2: Include an infinite-supply flag for an item in a Store inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
rjshae committed Mar 24, 2019
1 parent 76b000a commit ba98728
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/engines/nwn2/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace NWN2 {

Item::Item(const Aurora::GFF3Struct &item) :
Object(kObjectTypeItem), Inventory(item),
_stackSize(1), _droppable(true), _identified(true), _pickpocketable(true) {
_stackSize(1), _droppable(true), _identified(true), _pickpocketable(true), _infinite(false) {

load(item);
}
Expand Down Expand Up @@ -117,6 +117,10 @@ bool Item::getStolenFlag() const {
return _stolen;
}

bool Item::getInfinite() const {
return _infinite;
}

void Item::setDroppableFlag(bool droppable) {
_droppable = droppable;
}
Expand All @@ -141,6 +145,10 @@ void Item::setStolenFlag(bool stolen) {
_stolen = stolen;
}

void Item::setInfinite(bool infinite) {
_infinite = infinite;
}

ItemType Item::getBaseItemType() const {
return _baseItem;
}
Expand Down Expand Up @@ -257,6 +265,7 @@ void Item::loadProperties(const Aurora::GFF3Struct &gff) {
_identified = gff.getBool("Identified", _identified);
_pickpocketable = gff.getBool("Pickpocketable", _pickpocketable);
_container = gff.getBool("Container", _container);
_infinite = gff.getBool("Infinite", _infinite);

// Item properties
loadItemProperties(gff);
Expand Down
3 changes: 3 additions & 0 deletions src/engines/nwn2/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ class Item : public Object, public Inventory {
bool getPickpocketableFlag() const;
bool getPlotFlag() const;
bool getStolenFlag() const;
bool getInfinite() const;

void setDroppableFlag(bool droppable);
void setIdentified(bool identified);
void setItemCursedFlag(bool cursed);
void setPickpocketableFlag(bool pickpocketable);
void setPlotFlag(bool plotFlag);
void setStolenFlag(bool stolen);
void setInfinite(bool infinite);

ItemType getBaseItemType() const;
uint32 getItemIcon() const;
Expand Down Expand Up @@ -94,6 +96,7 @@ class Item : public Object, public Inventory {
bool _droppable; ///< Is the item dropped as loot?
bool _identified; ///< Have the item's properties been identified?
bool _pickpocketable; ///< Can the item be pick-pocketed?
bool _infinite; ///< Is a store item available in infinite supply?

ItemProperties _itemProperties; ///< The item's properties.

Expand Down

0 comments on commit ba98728

Please sign in to comment.