Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14998/GUIScript
Modified Files:
GUIScript.cpp
Log Message:
changed literals to symbolic constants (this fixed at least one bug as well)
Index: GUIScript.cpp
===================================================================
RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v
retrieving revision 1.454
retrieving revision 1.455
diff -C2 -d -r1.454 -r1.455
*** GUIScript.cpp 29 Jan 2007 22:41:57 -0000 1.454
--- GUIScript.cpp 30 Jan 2007 19:07:38 -0000 1.455
***************
*** 4771,4776 ****
goto item_is_gold;
}
! res = actor->inventory.AddSlotItem(item, -3);
! if (res !=2) { //putting it back
container->AddItem(item);
}
--- 4771,4776 ----
goto item_is_gold;
}
! res = actor->inventory.AddSlotItem(item, SLOT_ONLYINVENTORY);
! if (res !=ASI_SUCCESS) { //putting it back
container->AddItem(item);
}
***************
*** 5014,5021 ****
}
//the amount of items is stored in si->PurchasedAmount
actor->inventory.AddStoreItem(si, action);
! if ((si->InfiniteSupply==-1) || si->AmountInStock) {
si->Flags &= ~IE_INV_ITEM_SELECTED;
- si->PurchasedAmount=0;
} else {
store->RemoveItem( Slot );
--- 5014,5025 ----
}
//the amount of items is stored in si->PurchasedAmount
+ //it will adjust AmountInStock/PurchasedAmount
actor->inventory.AddStoreItem(si, action);
! if (si->PurchasedAmount) {
! //was not able to buy it due to lack of space
! break;
! }
! if (si->InfiniteSupply==-1) {
si->Flags &= ~IE_INV_ITEM_SELECTED;
} else {
store->RemoveItem( Slot );
***************
*** 6142,6146 ****
if (res) {
//release it only when fully placed
! if (res==2) {
core->ReleaseDraggedItem ();
}
--- 6146,6150 ----
if (res) {
//release it only when fully placed
! if (res==ASI_SUCCESS) {
core->ReleaseDraggedItem ();
}
***************
*** 6162,6170 ****
core->ReleaseDraggedItem ();
DragItem(tmp);
! res = 3;
actor->RefreshEffects();
actor->ReinitQuickSlots();
} else {
! res = 0;
}
}
--- 6166,6175 ----
core->ReleaseDraggedItem ();
DragItem(tmp);
! // switched items, not returned by normal AddSlotItem
! res = ASI_SWAPPED;
actor->RefreshEffects();
actor->ReinitQuickSlots();
} else {
! res = ASI_FAILED;
}
}
|