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.2 by elmex, Fri Mar 10 20:32:47 2006 UTC vs.
Revision 1.3 by elmex, Sun Mar 12 12:18:55 2006 UTC

16use List::Util qw(min max); 16use List::Util qw(min max);
17 17
18use Crossfire; 18use Crossfire;
19use Crossfire::MapWidget; 19use Crossfire::MapWidget;
20 20
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); 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);
22 22
23sub new_arch_pb { 23sub new_arch_pb {
24 # this is awful, is this really the best way? 24 # this is awful, is this really the best way?
25 my $pb = new Gtk2::Gdk::Pixbuf 'rgb', 1, 8, TILESIZE, TILESIZE; 25 my $pb = new Gtk2::Gdk::Pixbuf 'rgb', 1, 8, TILESIZE, TILESIZE;
26 return $pb; 26 return $pb;
63sub arch_is_wall { 63sub arch_is_wall {
64 my ($a) = @_; 64 my ($a) = @_;
65 return $Crossfire::ARCH{$a->{_name}}->{no_pass}; 65 return $Crossfire::ARCH{$a->{_name}}->{no_pass};
66} 66}
67 67
68sub arch_is_monster {
69 my ($a) = @_;
70 my $arch = $Crossfire::ARCH{$a->{_name}};
71 return $arch->{alive} and ($arch->{monster} or $arch->{generator});
72}
73
68sub stack_find { 74sub stack_find {
69 my ($stack, $dir, $pred) = @_; 75 my ($stack, $dir, $pred) = @_;
70 76
71 77
72 if ($dir eq 'from_top') { 78 if ($dir eq 'from_top') {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines