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.31 by elmex, Thu Oct 22 05:37:54 2009 UTC vs.
Revision 1.32 by elmex, Mon Nov 2 12:33:36 2009 UTC

244} 244}
245 245
246sub stack_find { 246sub stack_find {
247 my ($stack, $dir, $pred) = @_; 247 my ($stack, $dir, $pred) = @_;
248 248
249
250 if ($dir eq 'from_top') { 249 if ($dir eq 'from_top') {
251 my $i = scalar (@$stack) - 1; 250 my $i = scalar (@$stack) - 1;
252 if ($i < 0) { $i = 0 } 251 if ($i < 0) { $i = 0 }
253 252
254 for (reverse @$stack) { 253 for (reverse @$stack) {
267 266
268 $i++; 267 $i++;
269 } 268 }
270 } 269 }
271 270
272 return 0; 271 return undef;
273
274} 272}
275 273
276sub stack_find_floor { 274sub stack_find_floor {
277 my ($stack, $dir) = @_; 275 my ($stack, $dir) = @_;
278 return stack_find ($stack, $dir, \&arch_is_floor); 276 return stack_find ($stack, $dir, \&arch_is_floor);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines