Cleaning up some poker_sit code
This commit is contained in:
parent
ecf4baa8b4
commit
f75abe564d
1 changed files with 7 additions and 5 deletions
|
|
@ -112,8 +112,10 @@
|
|||
}
|
||||
|
||||
function onSit() {
|
||||
print("[pokerSeat] onSit called, seat=" + _seatIndex + " isSeated=" + isSeated + " _busy=" + _busy + " _seatData=" + (_seatData ? "ok" : "null"));
|
||||
if (isSeated || _busy) return;
|
||||
_busy = true;
|
||||
Script.setTimeout(function () { _busy = false; }, 3000);
|
||||
|
||||
if (!_seatData) {
|
||||
notify("Seat not configured (index " + _seatIndex + ")");
|
||||
|
|
@ -191,7 +193,7 @@
|
|||
|
||||
var seatCount = getTableSeatCount();
|
||||
var layout = POKER_SEATS[seatCount];
|
||||
if (!layout || !layout[parseInt(_seatIndex)]) {
|
||||
if (!layout || layout[parseInt(_seatIndex)] === undefined) {
|
||||
print("[pokerSeat] no layout for seatCount=" + seatCount + " index=" + _seatIndex);
|
||||
return;
|
||||
}
|
||||
|
|
@ -200,12 +202,12 @@
|
|||
print("[pokerSeat] loaded seat " + _seatIndex + " at table " + _tableID);
|
||||
};
|
||||
|
||||
this.clickDownOnEntity = function () { onSit(); };
|
||||
this.clickUpOnEntity = function () { _busy = false; };
|
||||
this.startNearTrigger = function () { onSit(); };
|
||||
this.stopNearTrigger = function () { _busy = false; };
|
||||
this.stopNearTrigger = function () {};
|
||||
this.startFarTrigger = function () { onSit(); };
|
||||
this.stopFarTrigger = function () { _busy = false; };
|
||||
this.stopFarTrigger = function () {};
|
||||
this.clickDownOnEntity = function () { onSit(); };
|
||||
this.clickUpOnEntity = function () {};
|
||||
|
||||
this.unload = function () {
|
||||
if (isSeated) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue