mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-25 04:02:37 +01:00
Plugin/Spinach: fix players exit game on /part
and /quit
This commit is contained in:
parent
7a7730d039
commit
917cae2ffb
@ -112,7 +112,7 @@ sub on_kick($self, $event_type, $event) {
|
|||||||
sub on_departure($self, $event_type, $event) {
|
sub on_departure($self, $event_type, $event) {
|
||||||
my ($nick, $user, $host) = ($event->nick, $event->user, $event->host);
|
my ($nick, $user, $host) = ($event->nick, $event->user, $event->host);
|
||||||
my ($channel, $type) = (lc $event->to, uc $event->type);
|
my ($channel, $type) = (lc $event->to, uc $event->type);
|
||||||
return 0 if $type ne 'QUIT' and $channel ne $self->{channel};
|
return 0 if $type eq 'QUIT' and $channel ne $self->{channel};
|
||||||
$self->player_left($nick, $user, $host);
|
$self->player_left($nick, $user, $host);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1208,7 +1208,7 @@ sub run_one_state($self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($self->{current_state} ne 'nogame' && not @{$self->{state_data}->{players}}) {
|
if ($self->{current_state} ne 'nogame' && not @{$self->{state_data}->{players}}) {
|
||||||
$self->send_message($self->{channel}, "All players have left the game!");
|
$self->send_message($self->{channel}, "All players have left. The game has been stopped.");
|
||||||
$self->{current_state} = 'nogame';
|
$self->{current_state} = 'nogame';
|
||||||
$self->{pbot}->{event_queue}->update_repeating('spinach loop', 0);
|
$self->{pbot}->{event_queue}->update_repeating('spinach loop', 0);
|
||||||
return;
|
return;
|
||||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4857,
|
BUILD_REVISION => 4858,
|
||||||
BUILD_DATE => "2024-11-21",
|
BUILD_DATE => "2024-11-22",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
Reference in New Issue
Block a user