Skip to content

Commit

Permalink
Fix accessing items on blue floor via computer:
Browse files Browse the repository at this point in the history
Instead of iteration over the points of the top most, left most submap ((0,0) to (SEEX-1, SEEY-1)) - iterate over the points around the player (which should be lactated right next to the computer).
  • Loading branch information
BevapDin committed Sep 23, 2019
1 parent cfc7f8a commit 5a30e5d
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/computer.cpp
Expand Up @@ -1513,22 +1513,20 @@ void computer::activate_failure( computer_failure_type fail )

case COMPFAIL_DESTROY_DATA:
print_error( _( "ERROR: ACCESSING DATA MALFUNCTION" ) );
for( int x = 0; x < SEEX * 2; x++ ) {
for( int y = 0; y < SEEY * 2; y++ ) {
if( g->m.ter( point( x, y ) ) == t_floor_blue ) {
map_stack items = g->m.i_at( point( x, y ) );
if( items.empty() ) {
print_error( _( "ERROR: Please place memory bank in scan area." ) );
} else if( items.size() > 1 ) {
print_error( _( "ERROR: Please only scan one item at a time." ) );
} else if( items.only_item().typeId() != "usb_drive" ) {
print_error( _( "ERROR: Memory bank destroyed or not present." ) );
} else if( items.only_item().contents.empty() ) {
print_error( _( "ERROR: Memory bank is empty." ) );
} else {
print_error( _( "ERROR: Data bank destroyed." ) );
g->m.i_clear( point( x, y ) );
}
for( const tripoint &p : g->m.points_in_radius( g->u.pos(), 24 ) ) {
if( g->m.ter( p ) == t_floor_blue ) {
map_stack items = g->m.i_at( p );
if( items.empty() ) {
print_error( _( "ERROR: Please place memory bank in scan area." ) );
} else if( items.size() > 1 ) {
print_error( _( "ERROR: Please only scan one item at a time." ) );
} else if( items.only_item().typeId() != "usb_drive" ) {
print_error( _( "ERROR: Memory bank destroyed or not present." ) );
} else if( items.only_item().contents.empty() ) {
print_error( _( "ERROR: Memory bank is empty." ) );
} else {
print_error( _( "ERROR: Data bank destroyed." ) );
g->m.i_clear( p );
}
}
}
Expand Down

0 comments on commit 5a30e5d

Please sign in to comment.