forked from mirrors/webxoss-core
🐛 fix moving trap when rearrange signis
This commit is contained in:
parent
3fa794e683
commit
785ba75b1c
2 changed files with 8 additions and 2 deletions
4
Card.js
4
Card.js
|
@ -1141,8 +1141,8 @@ Card.prototype.changeSigniZone = function (zone) {
|
||||||
|
|
||||||
// 交换 zone.cards
|
// 交换 zone.cards
|
||||||
var oldZone = this.zone;
|
var oldZone = this.zone;
|
||||||
var tmp = oldZone.cards;
|
var tmp = oldZone.getNonTrapCards().concat(zone.trap || []);
|
||||||
oldZone.cards = zone.cards;
|
oldZone.cards = zone.getNonTrapCards().concat(oldZone.trap || []);
|
||||||
zone.cards = tmp;
|
zone.cards = tmp;
|
||||||
// 设置 card.zone
|
// 设置 card.zone
|
||||||
oldZone.cards.forEach(function (card) {
|
oldZone.cards.forEach(function (card) {
|
||||||
|
|
6
Zone.js
6
Zone.js
|
@ -59,6 +59,12 @@ Zone.prototype.getActualCards = function () {
|
||||||
},this);
|
},this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Zone.prototype.getNonTrapCards = function() {
|
||||||
|
return this.cards.filter(function (card) {
|
||||||
|
return (card !== this.trap);
|
||||||
|
},this);
|
||||||
|
};
|
||||||
|
|
||||||
Zone.prototype.getSigni = function() {
|
Zone.prototype.getSigni = function() {
|
||||||
return this.player.signis.filter(function (signi) {
|
return this.player.signis.filter(function (signi) {
|
||||||
return signi.zone === this;
|
return signi.zone === this;
|
||||||
|
|
Loading…
Reference in a new issue