From c6e7b7bf6a73fbe7d8341b3a6e115019428936f5 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 3 Jul 2018 20:03:49 -0700 Subject: [PATCH] Battleship: prevent minor hiccup in ultra-fast-paced movement --- PBot/Plugins/Battleship.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PBot/Plugins/Battleship.pm b/PBot/Plugins/Battleship.pm index 215e0e4e..7916823c 100644 --- a/PBot/Plugins/Battleship.pm +++ b/PBot/Plugins/Battleship.pm @@ -289,7 +289,7 @@ sub battleship_cmd { when ('bomb') { $self->{pbot}->{logger}->log("Battleship: bomb state: $self->{current_state}\n" . Dumper $self->{state_data}); - if ($self->{current_state} ne 'playermove') { + if ($self->{current_state} ne 'playermove' and $self->{current_state} ne 'checkplayer') { return "$nick: It's not time to do that now."; } @@ -316,8 +316,10 @@ sub battleship_cmd { return "$nick: Usage: battleship bomb ; must be in the form of A15, B3, C9, etc."; } + $arguments = uc $arguments; + my ($x, $y); - ($x) = uc($arguments) =~ m/^(.)/; + ($x) = $arguments =~ m/^(.)/; ($y) = $arguments =~ m/^.(.*)/; $x = ord($x) - 65;;