X-Git-Url: http://aymargeddon.de/gitweb/?p=aymargeddon%2Fcurrent.git;a=blobdiff_plain;f=src%2FAymCommand.pm;h=e6099aecdcf0d8f89872f81d5bb944c074cc11c4;hp=0ef438596bfca895478b35e925d57b4f40648da1;hb=448ecd81168816b51bf23219e8cc802ed4e2346e;hpb=8f037c123df00f587fda88e656579bcf17c8e66b diff --git a/src/AymCommand.pm b/src/AymCommand.pm index 0ef4385..e6099ae 100644 --- a/src/AymCommand.pm +++ b/src/AymCommand.pm @@ -1,23 +1,24 @@ - ########################################################################## # -# Copyright (c) 2003 Aymargeddon Development Team -# -# This file is part of "Last days of Aymargeddon" -# -# Aymargeddon is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# Aymargeddon is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., 675 -# Mass Ave, Cambridge, MA 02139, USA. -# +# Copyright (c) 2003-2012 Aymargeddon Development Team +# +# This file is part of "Last days of Aymargeddon" - a massive multi player +# onine game of strategy +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# ########################################################################### # @@ -234,7 +235,8 @@ sub move_with{ # all mobiles which already move with this now move with the target if($target != 0){ my $mob = $self->{-context}->mobiles_available($mobile->{'LOCATION'}); - my $mobcount = $#{@$mob}+1; + # my $mobcount = $#{@$mob}+1; + my $mobcount = @$mob; for my $i (0..$mobcount-1){ my ($oid,$otype,$oown,$oado,$ocnt,$ostat,$omove) = @{$mob->[$i]}; next if($omove != $id); @@ -1894,10 +1896,16 @@ sub first_phase{ # calculate duration $self->setDuration($::conf->{-DURATION}->{-BUILD_ARK}); - $self->event($self->{-location}, - 'EVENT_BUILD_ARK'); + my $loc = $self->{-location}; + + $self->event($loc,'EVENT_BUILD_ARK'); $self->use_mana(); + + $self->{-affected} = { + -fields => [$loc], + -mana => $self->{-player}, + }; return $self->{-duration}; }