Cleaning up some poker_sit code

This commit is contained in:
nak 2026-03-18 09:04:31 +00:00
parent ecf4baa8b4
commit f75abe564d

View file

@ -112,8 +112,10 @@
} }
function onSit() { function onSit() {
print("[pokerSeat] onSit called, seat=" + _seatIndex + " isSeated=" + isSeated + " _busy=" + _busy + " _seatData=" + (_seatData ? "ok" : "null"));
if (isSeated || _busy) return; if (isSeated || _busy) return;
_busy = true; _busy = true;
Script.setTimeout(function () { _busy = false; }, 3000);
if (!_seatData) { if (!_seatData) {
notify("Seat not configured (index " + _seatIndex + ")"); notify("Seat not configured (index " + _seatIndex + ")");
@ -191,7 +193,7 @@
var seatCount = getTableSeatCount(); var seatCount = getTableSeatCount();
var layout = POKER_SEATS[seatCount]; 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); print("[pokerSeat] no layout for seatCount=" + seatCount + " index=" + _seatIndex);
return; return;
} }
@ -200,12 +202,12 @@
print("[pokerSeat] loaded seat " + _seatIndex + " at table " + _tableID); print("[pokerSeat] loaded seat " + _seatIndex + " at table " + _tableID);
}; };
this.clickDownOnEntity = function () { onSit(); };
this.clickUpOnEntity = function () { _busy = false; };
this.startNearTrigger = function () { onSit(); }; this.startNearTrigger = function () { onSit(); };
this.stopNearTrigger = function () { _busy = false; }; this.stopNearTrigger = function () {};
this.startFarTrigger = function () { onSit(); }; this.startFarTrigger = function () { onSit(); };
this.stopFarTrigger = function () { _busy = false; }; this.stopFarTrigger = function () {};
this.clickDownOnEntity = function () { onSit(); };
this.clickUpOnEntity = function () {};
this.unload = function () { this.unload = function () {
if (isSeated) { if (isSeated) {