|
@@ -830,10 +830,29 @@ class PetProc {
|
|
public static function Pet_ChangeFightPosition() {
|
|
public static function Pet_ChangeFightPosition() {
|
|
list($type, $uid, $index) = req()->paras;
|
|
list($type, $uid, $index) = req()->paras;
|
|
|
|
|
|
|
|
+ $dic = ctx()->store(true)->petUids_supportFight_position;
|
|
if ($type == 1) {//出战、替换
|
|
if ($type == 1) {//出战、替换
|
|
ctx()->store(true)->petUid_fight_position = $uid;
|
|
ctx()->store(true)->petUid_fight_position = $uid;
|
|
|
|
+
|
|
|
|
+ foreach ($dic as $k => $petUid) {
|
|
|
|
+ if($petUid == $uid){
|
|
|
|
+ ctx()->store(true)->petUids_supportFight_position->$k = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else if ($type == 2) {
|
|
} else if ($type == 2) {
|
|
|
|
+ $tag = false;
|
|
|
|
+ foreach ($dic as $k => $petUid) {
|
|
|
|
+ if($petUid == $uid && $k != $index){
|
|
|
|
+ $tag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ my_Assert(!$tag, ErrCode::user_store_NoReplacePet);
|
|
|
|
+
|
|
ctx()->store(true)->petUids_supportFight_position->$index = $uid;
|
|
ctx()->store(true)->petUids_supportFight_position->$index = $uid;
|
|
|
|
+ if(ctx()->store(true)->petUid_fight_position == $uid){
|
|
|
|
+ ctx()->store(true)->petUid_fight_position = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// if ($type == 0 && $index == 0 && $uid != 0) {//上阵点击空白的地方
|
|
// if ($type == 0 && $index == 0 && $uid != 0) {//上阵点击空白的地方
|