Commit 96fe8f96 authored by nanahira's avatar nanahira

js

parent fd9183a6
...@@ -3492,12 +3492,14 @@ ...@@ -3492,12 +3492,14 @@
pos = pos * 2; pos = pos * 2;
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp -= val; if (room.dueling_players[pos]) {
if (room.dueling_players[pos].lp < 0) { room.dueling_players[pos].lp -= val;
room.dueling_players[pos].lp = 0; if (room.dueling_players[pos].lp < 0) {
} room.dueling_players[pos].lp = 0;
if ((0 < (ref1 = room.dueling_players[pos].lp) && ref1 <= 100)) { }
ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK); if ((0 < (ref1 = room.dueling_players[pos].lp) && ref1 <= 100)) {
ygopro.stoc_send_chat_to_room(room, "${lp_low_opponent}", ygopro.constants.COLORS.PINK);
}
} }
} }
if (msg_name === 'RECOVER' && client.pos === 0) { if (msg_name === 'RECOVER' && client.pos === 0) {
...@@ -3509,7 +3511,9 @@ ...@@ -3509,7 +3511,9 @@
pos = pos * 2; pos = pos * 2;
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp += val; if (room.dueling_players[pos]) {
room.dueling_players[pos].lp += val;
}
} }
if (msg_name === 'LPUPDATE' && client.pos === 0) { if (msg_name === 'LPUPDATE' && client.pos === 0) {
pos = buffer.readUInt8(1); pos = buffer.readUInt8(1);
...@@ -3520,7 +3524,9 @@ ...@@ -3520,7 +3524,9 @@
pos = pos * 2; pos = pos * 2;
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp = val; if (room.dueling_players[pos]) {
room.dueling_players[pos].lp = val;
}
} }
if (msg_name === 'PAY_LPCOST' && client.pos === 0) { if (msg_name === 'PAY_LPCOST' && client.pos === 0) {
pos = buffer.readUInt8(1); pos = buffer.readUInt8(1);
...@@ -3531,12 +3537,14 @@ ...@@ -3531,12 +3537,14 @@
pos = pos * 2; pos = pos * 2;
} }
val = buffer.readInt32LE(2); val = buffer.readInt32LE(2);
room.dueling_players[pos].lp -= val; if (room.dueling_players[pos]) {
if (room.dueling_players[pos].lp < 0) { room.dueling_players[pos].lp -= val;
room.dueling_players[pos].lp = 0; if (room.dueling_players[pos].lp < 0) {
} room.dueling_players[pos].lp = 0;
if ((0 < (ref2 = room.dueling_players[pos].lp) && ref2 <= 100)) { }
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK); if ((0 < (ref2 = room.dueling_players[pos].lp) && ref2 <= 100)) {
ygopro.stoc_send_chat_to_room(room, "${lp_low_self}", ygopro.constants.COLORS.PINK);
}
} }
} }
//track card count //track card count
......
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