… | … | ||
---|---|---|---|
415 | } | 415 | } |
416 | 416 | ||
417 | sub get { | 417 | sub get { |
418 | my ($self, $x, $y) = @_; | 418 | my ($self, $x, $y) = @_; |
419 | 419 | ||
420 | return unless $x >= 0 && $x < $self->{map}{width} | ||
421 | && $y >= 0 && $y < $self->{map}{height}; | ||
422 | |||
420 | Storable::dclone $self->{map}{map}[$x][$y] || [] | 423 | Storable::dclone $self->{map}{map}[$x][$y] || [] |
421 | } | 424 | } |
422 | 425 | ||
423 | sub set { | 426 | sub set { |
424 | my ($self, $x, $y, $as) = @_; | 427 | my ($self, $x, $y, $as) = @_; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |