aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_trigger_transport.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_trigger_transport.go')
-rw-r--r--internal/game/cmd_trigger_transport.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/game/cmd_trigger_transport.go b/internal/game/cmd_trigger_transport.go
index e2053b0..dbb0d16 100644
--- a/internal/game/cmd_trigger_transport.go
+++ b/internal/game/cmd_trigger_transport.go
@@ -13,6 +13,13 @@ func (g *Game) triggerTransport(sess *net.Session, p *player.Player, mod *ModDef
return
}
+ // Transport would strand the player at a remote room while still seated at
+ // a table or machine; require them to stop playing first.
+ if _, playing := g.Casino.Participation(p.Name); playing {
+ sess.WriteLine("You're playing a game. Type \"stop\" between rounds before transporting.")
+ return
+ }
+
if p.Action != nil {
g.cancelAction(p)
}
@@ -22,6 +29,13 @@ func (g *Game) triggerTransport(sess *net.Session, p *player.Player, mod *ModDef
}
func (g *Game) executeTransportEffect(sess *net.Session, p *player.Player, mod *ModDef) {
+ // Safety net: sequenced modules reach the effect from advanceTriggerModule
+ // without re-entering triggerTransport. Never teleport a seated gambler.
+ if g.inCasinoGame(p.Name) {
+ sess.WriteLine("You're playing a game. Type \"stop\" between rounds before transporting.")
+ return
+ }
+
if g.Hub != nil {
for _, other := range g.Hub.PlayersInRoom(p.RoomID) {
if other != sess {