Commit 49381e01 authored by nanahira's avatar nanahira

fix

parent ec5fc11b
......@@ -1435,7 +1435,8 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
if settings.modules.dialogues.enabled
if ygopro.constants.MSG[msg] == 'SUMMONING' or ygopro.constants.MSG[msg] == 'SPSUMMONING' or ygopro.constants.MSG[msg] == 'CHAINING'
card = buffer.readUInt32LE(1)
if dialogues.dialogues[card] and (ygopro.constants.MSG[msg] != 'CHAINING' or (buffer.readUInt8(4) & 0x8) != 0)
trigger_location = buffer.readUInt8(4)
if dialogues.dialogues[card] and (ygopro.constants.MSG[msg] != 'CHAINING' or (trigger_location & 0x8) != 0 and (trigger_location & 0x200) == 0)
for line in _.lines dialogues.dialogues[card][Math.floor(Math.random() * dialogues.dialogues[card].length)]
ygopro.stoc_send_chat(client, line, ygopro.constants.COLORS.PINK)
return
......
......@@ -1609,7 +1609,7 @@
}
ygopro.stoc_follow('GAME_MSG', false, function(buffer, info, client, server) {
var card, j, len, line, msg, oppo_pos, playertype, pos, reason, ref, ref1, ref2, room, val;
var card, j, len, line, msg, oppo_pos, playertype, pos, reason, ref, ref1, ref2, room, trigger_location, val;
room = ROOM_all[client.rid];
if (!room) {
return;
......@@ -1740,7 +1740,8 @@
if (settings.modules.dialogues.enabled) {
if (ygopro.constants.MSG[msg] === 'SUMMONING' || ygopro.constants.MSG[msg] === 'SPSUMMONING' || ygopro.constants.MSG[msg] === 'CHAINING') {
card = buffer.readUInt32LE(1);
if (dialogues.dialogues[card] && (ygopro.constants.MSG[msg] !== 'CHAINING' || (buffer.readUInt8(4) & 0x8) !== 0)) {
trigger_location = buffer.readUInt8(4);
if (dialogues.dialogues[card] && (ygopro.constants.MSG[msg] !== 'CHAINING' || (trigger_location & 0x8) !== 0 && (trigger_location & 0x200) === 0)) {
ref2 = _.lines(dialogues.dialogues[card][Math.floor(Math.random() * dialogues.dialogues[card].length)]);
for (j = 0, len = ref2.length; j < len; j++) {
line = ref2[j];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment