Commit 269d16dc authored by nanahira's avatar nanahira

fix card count

parent 3bf0ddfd
...@@ -1452,15 +1452,15 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)-> ...@@ -1452,15 +1452,15 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
#track card count #track card count
#todo: track card count in tag mode #todo: track card count in tag mode
if ygopro.constants.MSG[msg] == 'MOVE' and client.pos == 0 and room.hostinfo.mode != 2 if ygopro.constants.MSG[msg] == 'MOVE' and room.hostinfo.mode != 2
pos = buffer.readUInt8(5) pos = buffer.readUInt8(5)
pos = 1 - pos unless client.is_first pos = 1 - pos unless client.is_first
loc = buffer.readUInt8(6) loc = buffer.readUInt8(6)
room.dueling_players[pos].card_count-- if (loc & 0xe) client.card_count-- if (loc & 0xe) and pos == 0
pos = buffer.readUInt8(9) pos = buffer.readUInt8(9)
pos = 1 - pos unless client.is_first pos = 1 - pos unless client.is_first
loc = buffer.readUInt8(10) loc = buffer.readUInt8(10)
room.dueling_players[pos].card_count++ if (loc & 0xe) client.card_count++ if (loc & 0xe) and pos == 0
if ygopro.constants.MSG[msg] == 'DRAW' and room.hostinfo.mode != 2 if ygopro.constants.MSG[msg] == 'DRAW' and room.hostinfo.mode != 2
pos = buffer.readUInt8(1) pos = buffer.readUInt8(1)
......
...@@ -1767,22 +1767,22 @@ ...@@ -1767,22 +1767,22 @@
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK); ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK);
} }
} }
if (ygopro.constants.MSG[msg] === 'MOVE' && client.pos === 0 && room.hostinfo.mode !== 2) { if (ygopro.constants.MSG[msg] === 'MOVE' && room.hostinfo.mode !== 2) {
pos = buffer.readUInt8(5); pos = buffer.readUInt8(5);
if (!client.is_first) { if (!client.is_first) {
pos = 1 - pos; pos = 1 - pos;
} }
loc = buffer.readUInt8(6); loc = buffer.readUInt8(6);
if (loc & 0xe) { if ((loc & 0xe) && pos === 0) {
room.dueling_players[pos].card_count--; client.card_count--;
} }
pos = buffer.readUInt8(9); pos = buffer.readUInt8(9);
if (!client.is_first) { if (!client.is_first) {
pos = 1 - pos; pos = 1 - pos;
} }
loc = buffer.readUInt8(10); loc = buffer.readUInt8(10);
if (loc & 0xe) { if ((loc & 0xe) && pos === 0) {
room.dueling_players[pos].card_count++; client.card_count++;
} }
} }
if (ygopro.constants.MSG[msg] === 'DRAW' && room.hostinfo.mode !== 2) { if (ygopro.constants.MSG[msg] === 'DRAW' && room.hostinfo.mode !== 2) {
......
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