|
@@ -80,16 +80,16 @@ class StoreProc {
|
|
|
$dic = GameConfig::predicate();
|
|
|
$pList = array();
|
|
|
foreach ($dic as $id => $pMo) {
|
|
|
- if($pMo->positions != null){
|
|
|
+ if($pMo->positions != null && $pMo->qual != null){
|
|
|
$list = explode(',',$pMo->positions);
|
|
|
if($pMo->id != $gem->predicateId && $pMo->qual == $gem->mo()->qual && in_array($gem->mo()->position, $list)){
|
|
|
$pList[] = $pMo->id;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- $rand = random_int(0, count($list)-1);
|
|
|
- $pId = $list[$rand];
|
|
|
+ my_Assert(count($pList) > 0, ErrCode::user_store_GemNotXilian);
|
|
|
+ $rand = random_int(0, count($pList)-1);
|
|
|
+ $pId = $pList[$rand];
|
|
|
ctx()->store->gemStore->$uid->predicateId = $pId;
|
|
|
|
|
|
ctx()->baseInfo->xilianStone -= $needStone;
|