Skip to content

Commit

Permalink
Revert "Autodoc is not autonomous (CleverRaven#35234)"
Browse files Browse the repository at this point in the history
This reverts commit 41481dc.
  • Loading branch information
AMurkin authored Nov 13, 2019
1 parent 546408f commit 9e1c9f6
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4261,25 +4261,6 @@ static player &player_on_couch( player &p, const tripoint &autodoc_loc, player &
return null_patient;
}

static Character &operator_present( Character &p, const tripoint &autodoc_loc,
Character &null_patient )
{
for( const auto &loc : g->m.points_in_radius( autodoc_loc, 1 ) ) {
const furn_str_id couch( "f_autodoc_couch" );
if( g->m.furn( loc ) != couch ) {
if( p.pos() == loc ) {
return p;
}
for( const npc *e : g->allies() ) {
if( e->pos() == loc ) {
return *g->critter_by_id<player>( e->getID() );
}
}
}
}
return null_patient;
}

static item &cyborg_on_couch( const tripoint &couch_pos, item &null_cyborg )
{
for( item &it : g->m.i_at( couch_pos ) ) {
Expand Down Expand Up @@ -4358,7 +4339,6 @@ void iexamine::autodoc( player &p, const tripoint &examp )
static avatar null_player;
tripoint couch_pos;
player &patient = player_on_couch( p, examp, null_player, adjacent_couch, couch_pos );
Character &Operator = operator_present( p, examp, null_player );

static item null_cyborg;
item &cyborg = cyborg_on_couch( couch_pos, null_cyborg );
Expand Down Expand Up @@ -4418,18 +4398,8 @@ void iexamine::autodoc( player &p, const tripoint &examp )
return;
}

const bool unsafe_usage = &Operator == &null_player || ( &Operator == &p && &patient == &p );
std::string autodoc_header = _( "Autodoc Mk. XI. Status: Online. Please choose operation" );
if( unsafe_usage ) {
const std::string &warning_sign = colorize( " /", c_yellow ) + colorize( "!",
c_red ) + colorize( "\\", c_yellow );
const std::string &warning = warning_sign + colorize( _( " WARNING: Operator missing" ),
c_red ) + warning_sign;
autodoc_header = warning +
_( " \n Using the Autodoc without an operator can lead to <color_light_cyan>serious injuries</color> or <color_light_cyan>death</color>. \n By continuing with the operation you accept the risks and acknowledge that you will not take any legal actions against this facility in case of an accident. " );
}
uilist amenu;
amenu.text = autodoc_header;
amenu.text = _( "Autodoc Mk. XI. Status: Online. Please choose operation" );
amenu.addentry( INSTALL_CBM, true, 'i', _( "Choose Compact Bionic Module to install" ) );
amenu.addentry( UNINSTALL_CBM, true, 'u', _( "Choose installed bionic to uninstall" ) );
amenu.addentry( BONESETTING, true, 's', _( "Splint broken limbs" ) );
Expand Down

0 comments on commit 9e1c9f6

Please sign in to comment.