… | |
… | |
31 | my ($pl) = @_; |
31 | my ($pl) = @_; |
32 | |
32 | |
33 | cf::override; |
33 | cf::override; |
34 | |
34 | |
35 | teleport $pl, "/world/world_105_115", 2, 34 |
35 | teleport $pl, "/world/world_105_115", 2, 34 |
|
|
36 | unless |
|
|
37 | $pl->ob->map |
36 | unless $pl->ob->map && $pl->ob->map->path !~ /nimbus/; |
38 | && $pl->ob->map->path !~ /nimbus/ |
|
|
39 | && $pl->ob->map->path !~ m%/var/crossfire/players/%; |
37 | } |
40 | } |
38 | |
41 | |
39 | sub update_balance { |
42 | sub update_balance { |
40 | my ($pl) = @_; |
43 | my ($pl) = @_; |
41 | |
44 | |
… | |
… | |
169 | |
172 | |
170 | cf::register_map_attachment rent => |
173 | cf::register_map_attachment rent => |
171 | on_enter => sub { |
174 | on_enter => sub { |
172 | my ($map, $pl, $x, $y) = @_; |
175 | my ($map, $pl, $x, $y) = @_; |
173 | |
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 | |
174 | for my $path (keys %{ $pl->{rent}{apartment} }) { |
185 | for my $path (keys %{ $pl->{rent}{apartment} }) { |
175 | $path =~ y/\//_/; |
186 | $path =~ y/\//_/; |
176 | $path = sprintf "%s/%s/%s/%s", |
187 | $path = sprintf "%s/%s/%s/%s", |
177 | cf::localdir, cf::playerdir, $pl->ob->name, $path; |
188 | cf::localdir, cf::playerdir, $pl->ob->name, $path; |
178 | |
189 | |