Skip to content

Commit

Permalink
Disable use of flashbangs on robots
Browse files Browse the repository at this point in the history
Flashbangs could blind and stun turrets and other robots.
In real life, flashbangs have no effect on robots. Prevent them from
having an effect in game.
  • Loading branch information
anothersimulacrum authored and kevingranade committed Dec 7, 2019
1 parent 422fcec commit 20e4aa5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "type_id.h"

static const itype_id null_itype( "null" );
static const species_id ROBOT( "ROBOT" );

// Global to smuggle data into shrapnel_calc() function without replicating it across entire map.
// Mass in kg
Expand Down Expand Up @@ -550,6 +551,9 @@ void flashbang( const tripoint &p, bool player_immune )
}
}
for( monster &critter : g->all_monsters() ) {
if( critter.type->in_species( ROBOT ) ) {
continue;
}
// TODO: can the following code be called for all types of creatures
dist = rl_dist( critter.pos(), p );
if( dist <= 8 ) {
Expand Down

0 comments on commit 20e4aa5

Please sign in to comment.