if (exists $args{target} && exists $args{source} && $players{$args{target}}{faction} eq mafia && $players{$args{source}}{weak}) {
putaction($delay, ACT_KILL, target => $args{source}, reason => 'targeted scum');
}
- push $actions[$delay]->{$type}, \%args
+ push @{$actions[$delay]->{$type}}, \%args
}
sub doaction {
if (defined $source && defined $target) {
# Watcher and tracker variables
$tplayers{$source}{targets} //= [];
- push $tplayers{$source}{targets}, $target;
+ push @{$tplayers{$source}{targets}}, $target;
$tplayers{$target}{sources} //= [];
- push $tplayers{$target}{sources}, $source;
+ push @{$tplayers{$target}{sources}}, $source;
# Copy this action to everybody hiding behind $target
if (exists $tplayers{$target}{hiders}) {
if ($tplayers{$target}{guard_count} && defined $source) {
$tplayers{$target}{guard_count}--;
# Copy this action to the first guard
- $args{target} = shift $tplayers{$target}{guards};
+ $args{target} = shift @{$tplayers{$target}{guards}};
@_ = ($type, %args);
goto &doaction;
}
when(ACT_LYNCH){
if ($tplayers{$target}{guard_count}) {
$tplayers{$target}{guard_count}--;
- $args{target} = shift $tplayers{$target}{guards};
+ $args{target} = shift @{$tplayers{$target}{guards}};
$target=$args{target};
}
if ($tplayers{$target}{protection}) {
when(ACT_GUARD){
$tplayers{$target}{guard_count}++;
$tplayers{$target}{guards} //= [];
- push $tplayers{$target}{guards}, $source;
+ push @{$tplayers{$target}{guards}}, $source;
}
when(ACT_ROLECOP){
when(ACT_HIDE){
$tplayers{$source}{hidden} = 1;
$tplayers{$target}{hiders} //= [];
- push $tplayers{$target}{hiders}, $source
+ push @{$tplayers{$target}{hiders}}, $source
}
}
}