ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/GCE/Util.pm
(Generate patch)

Comparing deliantra/gde/GCE/Util.pm (file contents):
Revision 1.6 by elmex, Thu Mar 16 14:00:24 2006 UTC vs.
Revision 1.9 by elmex, Mon Mar 20 02:53:49 2006 UTC

15use Storable; 15use Storable;
16use List::Util qw(min max); 16use List::Util qw(min max);
17 17
18use Crossfire; 18use Crossfire;
19use Crossfire::MapWidget; 19use Crossfire::MapWidget;
20use File::Spec::Functions;
20 21
21our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall stack_find arch_is_wall arch_is_monster add_table_widget quick_msg def); 22our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall stack_find arch_is_wall arch_is_monster add_table_widget quick_msg def arch_is_exit map2abs);
23
24sub map2abs {
25 my ($dest, $mape) = @_;
26
27 my $dir;
28 if (File::Spec->file_name_is_absolute($dest)) {
29 $dir = catdir ($CFG->{MAPDIR}, $dest);
30 } else {
31 my ($v, $p, $f) = File::Spec->splitpath ($mape->{path});
32 $dir = File::Spec->rel2abs ($dest, File::Spec->catpath ($v, $p));
33 }
34 return $dir;
35}
22 36
23sub def($$) { 37sub def($$) {
24 return defined ($_[0]) ? $_[0] : $_[1]; 38 return defined ($_[0]) ? $_[0] : $_[1];
25} 39}
26 40
84 98
85 } else { # $arch->{is_floor} and all other arches are 'between' monsters and floor 99 } else { # $arch->{is_floor} and all other arches are 'between' monsters and floor
86 100
87 return 'between'; 101 return 'between';
88 } 102 }
103}
104
105sub arch_is_exit {
106 my ($a) = @_;
107 my $type = $Crossfire::ARCH{$a->{_name}}->{type};
108 return $type eq '66' || $type eq '41';
89} 109}
90 110
91sub arch_is_floor { 111sub arch_is_floor {
92 my ($a) = @_; 112 my ($a) = @_;
93 return $Crossfire::ARCH{$a->{_name}}->{is_floor}; 113 return $Crossfire::ARCH{$a->{_name}}->{is_floor};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines