ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/rent.ext
(Generate patch)

Comparing deliantra/maps/perl/rent.ext (file contents):
Revision 1.4 by root, Tue Sep 19 15:15:36 2006 UTC vs.
Revision 1.7 by root, Wed Sep 20 21:51:06 2006 UTC

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
39sub update_balance { 42sub update_balance {
40 my ($pl) = @_; 43 my ($pl) = @_;
41 44
146 $pl->ob->reply (undef, "I am sorry to hear that, we will immediately stop charging you for your apartment, of course."); 149 $pl->ob->reply (undef, "I am sorry to hear that, we will immediately stop charging you for your apartment, of course.");
147}; 150};
148 151
149cf::attach_to_players prio => 100, 152cf::attach_to_players prio => 100,
150 on_login => sub { 153 on_login => sub {
151 return;
152 my ($pl) = @_; 154 my ($pl) = @_;
153
154 use Data::Dumper;
155 warn Dumper $pl;
156 155
157 $pl->{rent}{last_offline_check} ||= time; 156 $pl->{rent}{last_offline_check} ||= time;
158 157
159 if ($pl->{rent}{last_online_check}) { 158 if ($pl->{rent}{last_online_check}) {
160 $pl->{rent}{last_online_check} = time 159 $pl->{rent}{last_online_check} = time
169 168
170cf::register_map_attachment rent => 169cf::register_map_attachment rent =>
171 on_enter => sub { 170 on_enter => sub {
172 my ($map, $pl, $x, $y) = @_; 171 my ($map, $pl, $x, $y) = @_;
173 172
173 # can freely enter homes of other people
174 {
175 my $path = sprintf "%s/%s/%s/",
176 cf::localdir, cf::playerdir, $pl->ob->name;
177
178 return if $path ne substr $map->path, 0, length $path;
179 }
180
174 for my $path (keys %{ $pl->{rent}{apartment} }) { 181 for my $path (keys %{ $pl->{rent}{apartment} }) {
175 $path =~ y/\//_/; 182 $path =~ y/\//_/;
176 $path = sprintf "%s/%s/%s/%s", 183 $path = sprintf "%s/%s/%s/%s",
177 cf::localdir, cf::playerdir, $pl->ob->name, $path; 184 cf::localdir, cf::playerdir, $pl->ob->name, $path;
178 185

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines