--- deliantra/Deliantra-Client/DC/Protocol.pm 2007/04/10 09:39:48 1.99 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2007/04/10 11:12:53 1.100 @@ -434,7 +434,11 @@ sub load_map($$$) { my ($self, $hash, $x, $y) = @_; + my $gen = $self->{map_change_gen}; + CFPlus::DB::get $self->{mapcache} => $hash, sub { + return unless $gen == $self->{map_change_gen}; + my ($data) = @_; if (defined $data) { @@ -519,7 +523,10 @@ if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1; } else { + my $gen = $self->{map_change_gen}; $self->send_mapinfo ("spatial $path$tile", sub { + return unless $gen == $self->{map_change_gen}; + my ($mode, $flags, $x, $y, $w, $h, $hash) = @_; return if $mode ne "spatial"; @@ -544,6 +551,8 @@ $self->flush_map; + ++$self->{map_change_gen}; + my ($ox, $oy) = ($::MAP->ox, $::MAP->oy); my $mapmapw = $self->{mapmap}->{w};