… | |
… | |
172 | |
172 | |
173 | cf::register_map_attachment rent => |
173 | cf::register_map_attachment rent => |
174 | on_enter => sub { |
174 | on_enter => sub { |
175 | my ($map, $pl, $x, $y) = @_; |
175 | my ($map, $pl, $x, $y) = @_; |
176 | |
176 | |
|
|
177 | # can freely enter homes of other people |
|
|
178 | { |
|
|
179 | my $path = sprintf "%s/%s/%s/", |
|
|
180 | cf::localdir, cf::playerdir, $pl->ob->name; |
|
|
181 | |
|
|
182 | return if $path ne substr $map->path, 0, length $path; |
|
|
183 | } |
|
|
184 | |
177 | for my $path (keys %{ $pl->{rent}{apartment} }) { |
185 | for my $path (keys %{ $pl->{rent}{apartment} }) { |
178 | $path =~ y/\//_/; |
186 | $path =~ y/\//_/; |
179 | $path = sprintf "%s/%s/%s/%s", |
187 | $path = sprintf "%s/%s/%s/%s", |
180 | cf::localdir, cf::playerdir, $pl->ob->name, $path; |
188 | cf::localdir, cf::playerdir, $pl->ob->name, $path; |
181 | |
189 | |