--- deliantra/server/ext/rent.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/rent.ext 2007/01/04 18:38:22 1.3 @@ -32,11 +32,10 @@ cf::override; - teleport $pl, "/world/world_105_115", 2, 34 + $pl->goto_map ("/world/world_105_115", 2, 34) unless $pl->ob->map - && $pl->ob->map->path !~ /nimbus/ - && $pl->ob->map->path !~ m%/var/crossfire/players/%; + && !$pl->ob->map->{path}{user_rel}; } sub update_balance { @@ -150,7 +149,8 @@ $pl->ob->reply (undef, "I am sorry to hear that, we will immediately stop charging you for your apartment, of course."); }; -cf::attach_to_players prio => 100, +cf::player->attach ( + prio => 100, on_login => sub { my ($pl) = @_; @@ -165,9 +165,10 @@ } update_balance $pl; - }; + }, +); -cf::register_map_attachment rent => +cf::map::attachment rent => on_enter => sub { my ($map, $pl, $x, $y) = @_; @@ -201,7 +202,7 @@ }, ; -Event->timer (after => 60, interval => 3600, data => cf::WF_AUTOCANCEL, cb => sub { +our $RENT_TIMER = Event->timer (after => 60, interval => 3600, data => cf::WF_AUTOCANCEL, cb => sub { pay_balance $_ for cf::player::list; });