Skip to content

Commit

Permalink
Silence some clang-tidy warnings (#34222)
Browse files Browse the repository at this point in the history
* Silence some clang-tidy warnings

* Update src/teleport.cpp

Co-Authored-By: Jianxiang Wang (王健翔) <[email protected]>

* Assert that p is not null to shut clang tidy up
  • Loading branch information
kevingranade authored and ZhilkinSerg committed Sep 25, 2019
1 parent 15709fa commit 6af0db3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/teleport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ bool teleport::teleport( Creature &critter, int min_distance, int max_distance,
return false;
}

const bool c_is_u = &critter == &g->u;
player *const p = critter.as_player();
const bool c_is_u = p != nullptr && p == &g->u;
int tries = 0;
tripoint origin = critter.pos();
tripoint new_pos = tripoint_zero;
tripoint new_pos;
do {
int rangle = rng( 0, 360 );
int rdistance = rng( min_distance, max_distance );
Expand Down

0 comments on commit 6af0db3

Please sign in to comment.