--- deliantra/server/ext/login.ext 2007/05/26 15:44:03 1.48 +++ deliantra/server/ext/login.ext 2007/06/10 03:14:04 1.50 @@ -592,19 +592,16 @@ cf::wait_for_tick_begin; $pl->save; - unless ($pl->active) { + unless ($pl->active || $pl->ns) { # check refcounts, this is tricky and needs to be adjusted to fit server internals my $ob = $pl->ob; - Scalar::Util::weaken $pl; - Scalar::Util::weaken $ob; - my $a_ = $pl->refcnt;#d# - my $b_ = $ob->refcnt;#d# + my $pl_ref = $pl->refcnt_cnt; my $ob_ref = $ob->refcnt_cnt; - ## pl_ref == one from object + one from cf::PLAYER - ## ob_ref == one from simply being an object - if ($pl_ref == 2 && $ob_ref == 1) { + ## pl_ref == object + cf::PLAYER + $pl + ## ob_ref == being an object + pl->observe + $ob + if ($pl_ref == 3 && $ob_ref == 3) { warn "player-scheduler destroy ", $ob->name;#d# # remove from sight and get fresh "copies" @@ -614,6 +611,9 @@ $ob->destroy; $pl->destroy; } else { + my $a_ = $pl->refcnt;#d# + my $b_ = $ob->refcnt;#d# + warn "player-scheduler refcnt ", $ob->name, " pp$pl_ref,pc$a_ op$ob_ref,oc$b_\n";#d# } }