Skip to content

Commit

Permalink
Don't update an item on the ground unless it's changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Smith committed Oct 28, 2009
1 parent f6efb80 commit 03ab9eb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/TAEB/ScreenScraper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,21 @@ our @msg_regex = (
[
qr/^You (?:see|feel) here (.*?)\./,
['floor_item', sub {
TAEB->announce('tile_noitems');
TAEB->new_item($1); }],
if (TAEB->current_tile->item_count == 1) {
my $item = TAEB->new_item($1);
if (@{TAEB->current_tile->items}[0]->maybe_is($item)) {
TAEB->log->scraper("Not updating the $item here ".
"because it's consistent with ".
"what we thought was there.");
return;
} else {
TAEB->announce('tile_noitems');
return $item;
}
} else {
TAEB->announce('tile_noitems');
return TAEB->new_item($1);
}}],
],
[
qr/^You read: \"(.*)\"\./,
Expand Down

0 comments on commit 03ab9eb

Please sign in to comment.