Skip to content

Commit

Permalink
Add default stack size for buying items to CommonStruct
Browse files Browse the repository at this point in the history
  • Loading branch information
vilarion committed Aug 10, 2012
1 parent 299c011 commit 7a8c598
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions TableStructs.hpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct CommonStruct {
TYPE_OF_ITEM_ID AfterInfiniteRot; TYPE_OF_ITEM_ID AfterInfiniteRot;
TYPE_OF_BRIGHTNESS Brightness; TYPE_OF_BRIGHTNESS Brightness;
TYPE_OF_WORTH Worth; TYPE_OF_WORTH Worth;
TYPE_OF_BUY_STACK BuyStack;
bool rotsInInventory; bool rotsInInventory;
bool isStackable; bool isStackable;


Expand All @@ -52,6 +53,7 @@ struct CommonStruct {
AfterInfiniteRot = 0; AfterInfiniteRot = 0;
Brightness = 0; Brightness = 0;
Worth = 0; Worth = 0;
BuyStack = 1;
rotsInInventory = false; rotsInInventory = false;
isStackable = false; isStackable = false;
} }
Expand All @@ -64,6 +66,7 @@ struct CommonStruct {
AfterInfiniteRot = source.AfterInfiniteRot; AfterInfiniteRot = source.AfterInfiniteRot;
Brightness = source.Brightness; Brightness = source.Brightness;
Worth = source.Worth; Worth = source.Worth;
BuyStack = source.BuyStack;
rotsInInventory = source.rotsInInventory; rotsInInventory = source.rotsInInventory;
isStackable = source.isStackable; isStackable = source.isStackable;
} }
Expand All @@ -78,6 +81,7 @@ struct CommonStruct {
AfterInfiniteRot = source.AfterInfiniteRot; AfterInfiniteRot = source.AfterInfiniteRot;
Brightness = source.Brightness; Brightness = source.Brightness;
Worth = source.Worth; Worth = source.Worth;
BuyStack = source.BuyStack;
rotsInInventory = source.rotsInInventory; rotsInInventory = source.rotsInInventory;
isStackable = source.isStackable; isStackable = source.isStackable;
} }
Expand Down
4 changes: 3 additions & 1 deletion data/CommonObjectTable.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void CommonObjectTable::reload() {
query.addColumn("common", "com_script"); query.addColumn("common", "com_script");
query.addColumn("common", "com_brightness"); query.addColumn("common", "com_brightness");
query.addColumn("common", "com_worth"); query.addColumn("common", "com_worth");
query.addColumn("common", "com_buystack");
query.addServerTable("common"); query.addServerTable("common");
query.addOrderBy("common", "com_itemid", Database::SelectQuery::ASC); query.addOrderBy("common", "com_itemid", Database::SelectQuery::ASC);


Expand Down Expand Up @@ -107,7 +108,8 @@ void CommonObjectTable::reload() {
temprecord.isStackable = (*itr)["com_stackable"].as<bool>(); temprecord.isStackable = (*itr)["com_stackable"].as<bool>();
temprecord.rotsInInventory = (*itr)["com_rotsininventory"].as<bool>(); temprecord.rotsInInventory = (*itr)["com_rotsininventory"].as<bool>();
temprecord.Brightness = (TYPE_OF_BRIGHTNESS)((*itr)["com_brightness"].as<int16_t>()); 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())) { if (!((*itr)["com_script"].is_null())) {
std::string scriptname = ((*itr)["com_script"].as<std::string>()); std::string scriptname = ((*itr)["com_script"].as<std::string>());
Expand Down

0 comments on commit 7a8c598

Please sign in to comment.