ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.240 by root, Mon Apr 16 10:14:25 2007 UTC vs.
Revision 1.241 by root, Mon Apr 16 11:09:32 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines