修复变更势力在录像和联机重连中的问题
This commit is contained in:
parent
b32d9388f6
commit
28b5206aa7
|
@ -2988,6 +2988,11 @@ export class Game {
|
|||
player.node["avatar" + map.name.slice(4)].show();
|
||||
if (goon) delete lib.character[map.to];
|
||||
},
|
||||
changeGroup: function (player, targetGroup) {
|
||||
if (!player || !targetGroup) return;
|
||||
player.group = targetGroup;
|
||||
player.node.name.dataset.nature = get.groupnature(targetGroup);
|
||||
},
|
||||
skill: function (player, content) {
|
||||
if (typeof content == "string") {
|
||||
if (lib.skill[content]) lib.skill[content].video(player);
|
||||
|
@ -3313,7 +3318,21 @@ export class Game {
|
|||
},
|
||||
removeGaintag: function (player, content) {
|
||||
if (player && content) {
|
||||
if (Array.isArray(content)) player.removeGaintag.apply(player, content);
|
||||
if (Array.isArray(content)) {
|
||||
const checkMatch = function (l1, l2) {
|
||||
for (var i = 0; i < l1.length; i++) {
|
||||
for (var j = 0; j < l2.length; j++) {
|
||||
if (l2[j].suit == l1[i][0] && l2[j].number == l1[i][1] && l2[j].name == l1[i][2]) {
|
||||
l2[j].addGaintag(content[0]);
|
||||
l2.splice(j--, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// player.removeGaintag.apply(player, content);
|
||||
checkMatch(content[1], player.getCards("h"));
|
||||
}
|
||||
else player.removeGaintag(content);
|
||||
} else {
|
||||
console.log(player);
|
||||
|
|
|
@ -640,6 +640,7 @@ export const Content = {
|
|||
event.originGroup = player.group;
|
||||
if (!event.group) event.group = player.group;
|
||||
var group = event.group;
|
||||
game.addVideo("changeGroup", player, group);
|
||||
player.getHistory("custom").push(event);
|
||||
if (event.broadcast !== false) {
|
||||
game.broadcast(
|
||||
|
|
|
@ -12812,7 +12812,8 @@ export class Library {
|
|||
}
|
||||
player.playerid = i;
|
||||
player.nickname = info.nickname;
|
||||
player.changeGroup(info.group, false, "nobroadcast");
|
||||
player.group = info.group;
|
||||
player.node.name.dataset.nature = get.groupnature(info.group);
|
||||
player.identity = info.identity;
|
||||
player.identityShown = info.identityShown;
|
||||
player.hp = info.hp;
|
||||
|
|
Loading…
Reference in New Issue