Skip to content
Browse files

pst has no "stolen" bit in items, but it instead denotes "steel"

lazily fixes not being able to sell many magic items
discovered by chiv
  • Loading branch information...
1 parent 9d5e6bf commit 9cbbd996456cc522f3a2504a1132fa1e2666231c @lynxlynxlynx lynxlynxlynx committed May 1, 2014
Showing with 6 additions and 4 deletions.
  1. +1 −0 gemrb/GUIScripts/GUIDefines.py
  2. +2 −1 gemrb/core/Interface.cpp
  3. +2 −2 gemrb/core/Inventory.cpp
  4. +1 −1 gemrb/core/Inventory.h
View
1 gemrb/GUIScripts/GUIDefines.py
@@ -258,6 +258,7 @@
IE_INV_ITEM_IDENTIFIED = 0x01
IE_INV_ITEM_UNSTEALABLE = 0x02
IE_INV_ITEM_STOLEN = 0x04
+IE_INV_ITEM_STEEL = 0x04 # pst only
IE_INV_ITEM_UNDROPPABLE = 0x08
# GemRB extensions
IE_INV_ITEM_ACQUIRED = 0x10
View
3 gemrb/core/Interface.cpp
@@ -4894,7 +4894,8 @@ void Interface::SanitizeItem(CREItem *item) const
item->Flags |= IE_INV_ITEM_UNDROPPABLE;
}
- if (item->Flags & IE_INV_ITEM_STOLEN2) {
+ // pst has no stolen flag, but "steel" in its place
+ if ((item->Flags & IE_INV_ITEM_STOLEN2) && !HasFeature(GF_PST_STATE_FLAGS)) {
item->Flags |= IE_INV_ITEM_STOLEN;
}
View
4 gemrb/core/Inventory.cpp
@@ -651,8 +651,8 @@ int Inventory::AddStoreItem(STOItem* item, int action)
memcpy( temp, item, sizeof( CREItem ) );
//except the Expired flag
temp->Expired=0;
- if (action==STA_STEAL) {
- temp->Flags |= IE_INV_ITEM_STOLEN;
+ if (action==STA_STEAL && !core->HasFeature(GF_PST_STATE_FLAGS)) {
+ temp->Flags |= IE_INV_ITEM_STOLEN; // "steel" in pst
}
temp->Flags &= ~IE_INV_ITEM_SELECTED;
View
2 gemrb/core/Inventory.h
@@ -85,7 +85,7 @@ typedef enum ieInventoryType {
typedef enum ieCREItemFlagBits {
IE_INV_ITEM_IDENTIFIED = 1,
IE_INV_ITEM_UNSTEALABLE = 2,
- IE_INV_ITEM_STOLEN = 4,
+ IE_INV_ITEM_STOLEN = 4, // denotes steel items in pst
//in iwd/iwd2 this flag means 'magical', some hack is needed
IE_INV_ITEM_UNDROPPABLE =8,
//just recently acquired

0 comments on commit 9cbbd99

Please sign in to comment.
Something went wrong with that request. Please try again.