Skip to content
Browse files

Add default stack size for buying items to CommonStruct

  • Loading branch information...
1 parent 299c011 commit 7a8c59840843566630f21d958a5fde59d8c73e1c @vilarion vilarion committed Aug 10, 2012
Showing with 7 additions and 1 deletion.
  1. +4 −0 TableStructs.hpp
  2. +3 −1 data/CommonObjectTable.cpp
View
4 TableStructs.hpp
@@ -41,6 +41,7 @@ struct CommonStruct {
TYPE_OF_ITEM_ID AfterInfiniteRot;
TYPE_OF_BRIGHTNESS Brightness;
TYPE_OF_WORTH Worth;
+ TYPE_OF_BUY_STACK BuyStack;
bool rotsInInventory;
bool isStackable;
@@ -52,6 +53,7 @@ struct CommonStruct {
AfterInfiniteRot = 0;
Brightness = 0;
Worth = 0;
+ BuyStack = 1;
rotsInInventory = false;
isStackable = false;
}
@@ -64,6 +66,7 @@ struct CommonStruct {
AfterInfiniteRot = source.AfterInfiniteRot;
Brightness = source.Brightness;
Worth = source.Worth;
+ BuyStack = source.BuyStack;
rotsInInventory = source.rotsInInventory;
isStackable = source.isStackable;
}
@@ -78,6 +81,7 @@ struct CommonStruct {
AfterInfiniteRot = source.AfterInfiniteRot;
Brightness = source.Brightness;
Worth = source.Worth;
+ BuyStack = source.BuyStack;
rotsInInventory = source.rotsInInventory;
isStackable = source.isStackable;
}
View
4 data/CommonObjectTable.cpp
@@ -80,6 +80,7 @@ void CommonObjectTable::reload() {
query.addColumn("common", "com_script");
query.addColumn("common", "com_brightness");
query.addColumn("common", "com_worth");
+ query.addColumn("common", "com_buystack");
query.addServerTable("common");
query.addOrderBy("common", "com_itemid", Database::SelectQuery::ASC);
@@ -107,7 +108,8 @@ void CommonObjectTable::reload() {
temprecord.isStackable = (*itr)["com_stackable"].as<bool>();
temprecord.rotsInInventory = (*itr)["com_rotsininventory"].as<bool>();
temprecord.Brightness = (TYPE_OF_BRIGHTNESS)((*itr)["com_brightness"].as<int16_t>());
- temprecord.Worth = (TYPE_OF_WORTH)((*itr)["com_worth"].as<int16_t>());
+ temprecord.Worth = (TYPE_OF_WORTH)((*itr)["com_worth"].as<TYPE_OF_WORTH>());
+ temprecord.BuyStack = (TYPE_OF_BUY_STACK)((*itr)["com_buystack"].as<TYPE_OF_BUY_STACK>());
if (!((*itr)["com_script"].is_null())) {
std::string scriptname = ((*itr)["com_script"].as<std::string>());

0 comments on commit 7a8c598

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