… | |
… | |
2384 | } |
2384 | } |
2385 | |
2385 | |
2386 | 1 |
2386 | 1 |
2387 | } |
2387 | } |
2388 | |
2388 | |
|
|
2389 | our $archetypes_loaded; |
|
|
2390 | |
|
|
2391 | sub load_archetypes { |
|
|
2392 | return 1 if $archetypes_loaded++; # current can only load them once |
|
|
2393 | # load_archetype_file sprintf "%s/archetypes", cf::datadir; |
|
|
2394 | load_archetype_file sprintf "%s/archetypes", cf::datadir |
|
|
2395 | } |
|
|
2396 | |
|
|
2397 | sub load_treasures { |
|
|
2398 | load_treasure_file sprintf "%s/treasures", cf::datadir |
|
|
2399 | } |
|
|
2400 | |
2389 | sub reload_resources { |
2401 | sub reload_resources { |
2390 | load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir |
2402 | load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir |
2391 | or die "unable to load regions file\n";#d# |
2403 | or die "unable to load regions file\n"; |
2392 | load_facedata |
2404 | load_facedata |
2393 | or die "unable to load facedata\n";#d# |
2405 | or die "unable to load facedata\n"; |
|
|
2406 | load_archetypes |
|
|
2407 | or die "unable to load archetypes\n"; |
|
|
2408 | load_treasures |
|
|
2409 | or die "unable to load treasurelists\n"; |
2394 | } |
2410 | } |
2395 | |
2411 | |
2396 | sub init { |
2412 | sub init { |
2397 | reload_resources; |
2413 | reload_resources; |
2398 | } |
2414 | } |
… | |
… | |
2646 | |
2662 | |
2647 | our @WAIT_FOR_TICK; |
2663 | our @WAIT_FOR_TICK; |
2648 | our @WAIT_FOR_TICK_BEGIN; |
2664 | our @WAIT_FOR_TICK_BEGIN; |
2649 | |
2665 | |
2650 | sub wait_for_tick { |
2666 | sub wait_for_tick { |
|
|
2667 | return unless $TICK_WATCHER->is_active; |
|
|
2668 | return if $Coro::current == $Coro::main; |
|
|
2669 | |
2651 | my $signal = new Coro::Signal; |
2670 | my $signal = new Coro::Signal; |
2652 | push @WAIT_FOR_TICK, $signal; |
2671 | push @WAIT_FOR_TICK, $signal; |
2653 | $signal->wait; |
2672 | $signal->wait; |
2654 | } |
2673 | } |
2655 | |
2674 | |
2656 | sub wait_for_tick_begin { |
2675 | sub wait_for_tick_begin { |
|
|
2676 | return unless $TICK_WATCHER->is_active; |
|
|
2677 | return if $Coro::current == $Coro::main; |
|
|
2678 | |
2657 | my $signal = new Coro::Signal; |
2679 | my $signal = new Coro::Signal; |
2658 | push @WAIT_FOR_TICK_BEGIN, $signal; |
2680 | push @WAIT_FOR_TICK_BEGIN, $signal; |
2659 | $signal->wait; |
2681 | $signal->wait; |
2660 | } |
2682 | } |
2661 | |
2683 | |