… | |
… | |
148 | delete $pl->{rent}{apartment}{$apartment}; |
148 | delete $pl->{rent}{apartment}{$apartment}; |
149 | |
149 | |
150 | $pl->ob->reply (undef, "I am sorry to hear that, we will immediately stop charging you for your apartment, of course."); |
150 | $pl->ob->reply (undef, "I am sorry to hear that, we will immediately stop charging you for your apartment, of course."); |
151 | }; |
151 | }; |
152 | |
152 | |
153 | cf::attach_to_players prio => 100, |
153 | cf::player->attach ( |
|
|
154 | prio => 100, |
154 | on_login => sub { |
155 | on_login => sub { |
155 | my ($pl) = @_; |
156 | my ($pl) = @_; |
156 | |
157 | |
157 | $pl->{rent}{last_offline_check} ||= time; |
158 | $pl->{rent}{last_offline_check} ||= time; |
158 | |
159 | |
… | |
… | |
163 | } else { |
164 | } else { |
164 | $pl->{rent}{last_online_check} = time; |
165 | $pl->{rent}{last_online_check} = time; |
165 | } |
166 | } |
166 | |
167 | |
167 | update_balance $pl; |
168 | update_balance $pl; |
168 | }; |
169 | }, |
|
|
170 | ); |
169 | |
171 | |
170 | cf::register_map_attachment rent => |
172 | cf::map::attachment rent => |
171 | on_enter => sub { |
173 | on_enter => sub { |
172 | my ($map, $pl, $x, $y) = @_; |
174 | my ($map, $pl, $x, $y) = @_; |
173 | |
175 | |
174 | # can freely enter homes of other people |
176 | # can freely enter homes of other people |
175 | { |
177 | { |