|
@@ -54,12 +54,14 @@ class ActiveProc {
|
|
|
my_Assert($num < $mo->exchangeNum,ErrCode::active_lotteryExchangeNumLimit);
|
|
|
|
|
|
$itemNum = 0;
|
|
|
- if(StlUtil::dictHasProperty(ctx()->store->items, $id)){
|
|
|
- $itemNum = ctx()->store->items->$id;
|
|
|
- }
|
|
|
$cost = explode(',',$mo->cost);
|
|
|
+ $costId = $cost[0];
|
|
|
+ if(StlUtil::dictHasProperty(ctx()->store->items, $costId)){
|
|
|
+ $itemNum = ctx()->store->items->$costId;
|
|
|
+ }
|
|
|
+
|
|
|
my_Assert($itemNum >= $cost[1],ErrCode::notenough_item);
|
|
|
- ctx()->store->removeItem($cost[0], $cost[1]);
|
|
|
+ ctx()->store->removeItem($costId, $cost[1]);
|
|
|
|
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
|
ctx()->privateState->lotteryExchange[] = $id;
|