… | |
… | |
34 | |
34 | |
35 | ## pl_ref == (P)$pl + (P)%cf::PLAYER + (C)ob->contr |
35 | ## pl_ref == (P)$pl + (P)%cf::PLAYER + (C)ob->contr |
36 | ## ob_ref == (P)$ob + (C)pl->observe + (C)pl->viewpoint + (C)simply being an object |
36 | ## ob_ref == (P)$ob + (C)pl->observe + (C)pl->viewpoint + (C)simply being an object |
37 | ## !$pl->ns ensures that ob == viewpoint == observe |
37 | ## !$pl->ns ensures that ob == viewpoint == observe |
38 | if ($pl_ref == 3 && $ob_ref == 4) { |
38 | if ($pl_ref == 3 && $ob_ref == 4) { |
39 | warn "player-scheduler destroy ", $ob->name;#d# |
39 | cf::trace "player-scheduler destroy ", $ob->name;#d# |
40 | |
40 | |
41 | # remove from sight and get fresh "copies" |
41 | # remove from sight and get fresh "copies" |
42 | $pl = delete $cf::PLAYER{$ob->name}; |
42 | $pl = delete $cf::PLAYER{$ob->name}; |
43 | $ob = $pl->ob; |
43 | $ob = $pl->ob; |
44 | |
44 | |
45 | $pl->destroy; # destroys $ob |
45 | $pl->destroy; # destroys $ob |
46 | } else { |
46 | } else { |
47 | my $a_ = $pl->refcnt;#d# |
47 | my $a_ = $pl->refcnt;#d# |
48 | my $b_ = $ob->refcnt;#d# |
48 | my $b_ = $ob->refcnt;#d# |
49 | |
49 | |
50 | warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref/3 ob $ob_ref/3 (C pl $a_/1 ob $b_/2)\n";#d# |
50 | cf::debug "player-scheduler refcnt ", $ob->name, " pl $pl_ref/3 ob $ob_ref/3 (C pl $a_/1 ob $b_/2)\n";#d# |
51 | } |
51 | } |
52 | } |
52 | } |
53 | } |
53 | } |
54 | }; |
54 | }; |
55 | warn $@ if $@; |
55 | cf::error $@ if $@; |
|
|
56 | |
56 | cf::cede_to_tick; |
57 | cf::cede_to_tick; |
57 | }; |
58 | }; |
58 | } |
59 | } |
59 | }; |
60 | }; |
60 | |
61 | |