|
@@ -639,14 +639,13 @@ class StoreProc {
|
|
|
public static function AddMultiItemInStore($goodsStr, $src = 1, $mask = 0) {
|
|
|
$user = req()->userInfo->game;
|
|
|
$ary = explode(";", $goodsStr);
|
|
|
- $unlockNum = $user->privateState->expandNum * 5;
|
|
|
- $n = self::countStoreNum();
|
|
|
+ //$unlockNum = $user->privateState->expandNum * 5;
|
|
|
+ //$n = self::countStoreNum();
|
|
|
foreach ($ary as $value) {
|
|
|
$val = explode(",", $value);
|
|
|
$cid = "";
|
|
|
my_Assert(count($val) > 1, "解析奖励字符串出错");
|
|
|
- my_Assert($n < $unlockNum + 50, "背包容量不够请扩容");
|
|
|
-
|
|
|
+
|
|
|
list( $itemId, $num) = $val; # ID, 数量
|
|
|
$smItem = GameConfig::item_base_getItem($itemId); # 道具mo
|
|
|
switch ($smItem->subType) { # 根据类型分别添加到容器中
|
|
@@ -803,8 +802,12 @@ class StoreProc {
|
|
|
* 将装备放入背包
|
|
|
* @param type $itemId
|
|
|
*/
|
|
|
- static function PutEquipInStore($itemId) {
|
|
|
+ static function PutEquipInStore($itemId) {
|
|
|
$privateState = req()->userInfo->game->privateState;
|
|
|
+ $unlockNum = $privateState->expandNum * 5;
|
|
|
+ $n = self::countStoreNum();
|
|
|
+ my_Assert($n<$unlockNum+50, "背包容量不够请扩容");
|
|
|
+
|
|
|
if (!CommUtil::isPropertyExists($privateState, "currentId")) { // 如果仓库中已经有这种元素,则其数目+1
|
|
|
req()->userInfo->game->privateState->currentId = 1;
|
|
|
}
|
|
@@ -825,8 +828,12 @@ class StoreProc {
|
|
|
* @param type $itemId
|
|
|
*/
|
|
|
static function PutYanLingInStore($itemId) {
|
|
|
- my_Assert(count((array) req()->userInfo->game->store->yanling) < 100, ErrCode::store_yanling_bagfull);
|
|
|
+ //my_Assert(count((array) req()->userInfo->game->store->yanling) < 100, ErrCode::store_yanling_bagfull);
|
|
|
$privateState = req()->userInfo->game->privateState;
|
|
|
+ $unlockNum = $privateState->expandNum * 5;
|
|
|
+ $n = self::countStoreNum();
|
|
|
+ my_Assert($n<$unlockNum+50, "背包容量不够请扩容");
|
|
|
+
|
|
|
if (!CommUtil::isPropertyExists($privateState, "currentId")) { # 如果仓库中已经有这种元素,则其数目+1
|
|
|
req()->userInfo->game->privateState->currentId = 1;
|
|
|
}
|
|
@@ -847,6 +854,10 @@ class StoreProc {
|
|
|
*/
|
|
|
static function PutTaskCardInStore($itemId) {
|
|
|
$privateState = req()->userInfo->game->privateState;
|
|
|
+ $unlockNum = $privateState->expandNum * 5;
|
|
|
+ $n = self::countStoreNum();
|
|
|
+ my_Assert($n<$unlockNum+50, "背包容量不够请扩容");
|
|
|
+
|
|
|
if (!CommUtil::isPropertyExists($privateState, "currentId")) { # 如果仓库中已经有这种元素,则其数目+1
|
|
|
req()->userInfo->game->privateState->currentId = 1;
|
|
|
}
|
|
@@ -892,6 +903,10 @@ class StoreProc {
|
|
|
* @param int $num
|
|
|
*/
|
|
|
static function PutOverlyingItemInStore($itemId, $num = 1) {
|
|
|
+ $unlockNum = req()->userInfo->game->privateState->expandNum * 5;
|
|
|
+ $n = self::countStoreNum();
|
|
|
+ my_Assert($n < $unlockNum+50, "背包容量不够请扩容");
|
|
|
+
|
|
|
$items = req()->userInfo->game->store->items; # dic: itemid=>number
|
|
|
if (CommUtil::isPropertyExists($items, $itemId)) { # 如果仓库中已经有这种元素,则其数目+=num
|
|
|
$items->$itemId += $num;
|