… | |
… | |
250 | |
250 | |
251 | # update respawn position |
251 | # update respawn position |
252 | $ob->contr->savebed ($bed->map->path, $bed->x, $bed->y); |
252 | $ob->contr->savebed ($bed->map->path, $bed->x, $bed->y); |
253 | |
253 | |
254 | $ob->contr->killer ("left"); |
254 | $ob->contr->killer ("left"); |
255 | $ob->check_score (); |
255 | $ob->check_score; |
256 | |
256 | |
257 | $ob->reply (undef, "In the future, you will wake up here when you die."); |
257 | $ob->reply (undef, "In the future, you will wake up here when you die."); |
258 | $ob->contr->save (); |
258 | $ob->contr->save (1); |
259 | |
259 | |
260 | $ob->contr->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub { |
260 | $ob->contr->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub { |
|
|
261 | $ob->contr->enable_save (1); |
261 | if ($_[0] !~ /^[yY]/) { |
262 | if ($_[0] !~ /^[yY]/) { |
262 | $ob->contr->save (1); |
263 | $ob->contr->save (1); |
263 | $ob->contr->ns->destroy (); |
264 | $ob->contr->ns->destroy; |
264 | } |
265 | } |
265 | }); |
266 | }); |
266 | }, |
267 | }, |
267 | ); |
268 | ); |
268 | |
269 | |
269 | cf::client->attach (package => __PACKAGE__); |
270 | cf::client->attach (package => __PACKAGE__); |