Skip to content

Commit 6b821ac

Browse files
committed
Better detection of wall wiring
Change to flag instead of itype to make the test more robust.
1 parent ecdcbc7 commit 6b821ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/teleport.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static const flag_id json_flag_TELEPORT_LOCK( "TELEPORT_LOCK" );
5151
static const itype_id itype_wall_wiring( "wall_wiring" );
5252
static const itype_id itype_power_cord( "power_cord" );
5353

54+
const std::string flag_WIRING( "WIRING" );
55+
5456
static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
5557
const tripoint_abs_ms &dp )
5658
{
@@ -60,7 +62,7 @@ static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
6062
dest->load( project_to<coords::sm>( dp + rel_pos ), false );
6163
}
6264

63-
if( part.info().base_item == itype_wall_wiring ||
65+
if( part.info().has_flag( flag_WIRING ) ||
6466
part.info().base_item == itype_power_cord
6567
) {
6668
continue;

0 commit comments

Comments
 (0)