--- deliantra/server/ext/nimbus.ext 2006/12/30 10:16:10 1.3 +++ deliantra/server/ext/nimbus.ext 2007/01/01 15:32:40 1.4 @@ -76,37 +76,10 @@ $ob->message ("\n"); } - my $path = sprintf "%s/%s/%s/%s", - cf::localdir, cf::playerdir, $ob->name, "nimbus"; - - if ($ob->map->path ne $path) { - my $nimbus = cf::map::find_map "/schmorp/nimbus"; - $nimbus->path ($path); - $nimbus->unique (1); - - $pl->savebed ($path, 24, 12); - } + $pl->savebed ("/schmorp/nimbus", 24, 12); }, ); -sub teleport { - my ($pl, $map, $x, $y) = @_; - - return if $pl->ob->map->path eq $map - && abs ($pl->ob->x - $x) <= 1 - && abs ($pl->ob->y - $y) <= 1; - - my $portal = cf::object::new "exit"; - - $portal->slaying ($map); - $portal->stats->hp ($x); - $portal->stats->sp ($y); - - $portal->apply ($pl->ob); - - $portal->destroy; -} - cf::object::attachment nimbus_exit => on_trigger => sub { my ($self, $ob) = @_; @@ -131,17 +104,14 @@ @savebed = ("/scorn/taverns/inn", 10, 5); } - $pl->savebed (@savebed); - my $map = $ob->map; + $pl->savebed (@savebed); + $ob->goto_map (@savebed); - teleport $pl, @savebed; - - # should make this a temporary map and let cf deal with it - unlink $map->path; - unlink $map->path . ".pst"; - - $map->delete_map; + $map->{deny_save} = 1; + $map->unlink_save; + $map->rename ("{nimbus}"); + $map->reset; $pl->play_sound_player_only (cf::SOUND_PLAYER_DIES);