… | |
… | |
91 | if ($time < $m->{instantiate_time}) { |
91 | if ($time < $m->{instantiate_time}) { |
92 | # the map was reset in the meantime |
92 | # the map was reset in the meantime |
93 | my $age = $cf::RUNTIME - $time; |
93 | my $age = $cf::RUNTIME - $time; |
94 | |
94 | |
95 | warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d# |
95 | warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d# |
96 | |
|
|
97 | ($map, $x, $y) = $pl->savebed; |
|
|
98 | |
96 | |
99 | if ($age >= $MAX_DISCONNECT_TIME) { |
97 | if ($age >= $MAX_DISCONNECT_TIME) { |
100 | $ob->message ( |
98 | $ob->message ( |
101 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
99 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
102 | . "Unfortunately, nobody was near to help you when the monsters arrived to eat you. " |
100 | . "Unfortunately, nobody was near to help you when the monsters arrived to eat you. " |
… | |
… | |
107 | # kill them. |
105 | # kill them. |
108 | # reminds me of the famous badness 10000 syndrome... |
106 | # reminds me of the famous badness 10000 syndrome... |
109 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
107 | $ob->stats->hp (-10000); #] if they survive this they deserved to live |
110 | $pl->killer ("a cave-in"); |
108 | $pl->killer ("a cave-in"); |
111 | } else { |
109 | } else { |
|
|
110 | ($map, $x, $y) = $pl->savebed; |
|
|
111 | |
112 | $ob->message ( |
112 | $ob->message ( |
113 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
113 | "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " |
114 | . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " |
114 | . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " |
115 | . "Better use a savebed next time, much worse things could have happened... " |
115 | . "Better use a savebed next time, much worse things could have happened... " |
116 | . "H<You disconnected without having used a savebed. When you do that for too long, you might die.>", |
116 | . "H<You disconnected without having used a savebed. When you do that for too long, you might die.>", |
… | |
… | |
549 | $pl->destroy; # destroys $ob |
549 | $pl->destroy; # destroys $ob |
550 | } else { |
550 | } else { |
551 | my $a_ = $pl->refcnt;#d# |
551 | my $a_ = $pl->refcnt;#d# |
552 | my $b_ = $ob->refcnt;#d# |
552 | my $b_ = $ob->refcnt;#d# |
553 | |
553 | |
554 | warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref ob $ob_ref (C pl $a_ ob $b_)\n";#d# |
554 | warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref/3 ob $ob_ref/3 (C pl $a_/1 ob $b_/2)\n";#d# |
555 | } |
555 | } |
556 | } |
556 | } |
557 | } |
557 | } |
558 | }; |
558 | }; |
559 | warn $@ if $@; |
559 | warn $@ if $@; |
560 | Coro::cede; |
560 | cf::cede_to_tick; |
561 | }; |
561 | }; |
562 | } |
562 | } |
563 | }; |
563 | }; |
564 | |
564 | |
565 | $SCHEDULER->prio (1); |
565 | $SCHEDULER->prio (1); |