Skip to content

Commit ecdcbc7

Browse files
committed
Power grid moves with the ship
Ignore wiring colliding with walls and preventing power grid teleporting to new location. AFIK it only applies to the Aftershock smuggler ship.
1 parent 9dda6f3 commit ecdcbc7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/teleport.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "translations.h"
3636
#include "type_id.h"
3737
#include "units.h"
38+
#include "veh_type.h"
3839
#include "vehicle.h"
3940
#include "viewer.h"
4041
#include "ui_manager.h"
@@ -47,6 +48,8 @@ static const flag_id json_flag_DIMENSIONAL_ANCHOR( "DIMENSIONAL_ANCHOR" );
4748
static const flag_id json_flag_GRAB( "GRAB" );
4849
static const flag_id json_flag_TELEPORT_LOCK( "TELEPORT_LOCK" );
4950

51+
static const itype_id itype_wall_wiring( "wall_wiring" );
52+
static const itype_id itype_power_cord( "power_cord" );
5053

5154
static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
5255
const tripoint_abs_ms &dp )
@@ -57,6 +60,11 @@ static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
5760
dest->load( project_to<coords::sm>( dp + rel_pos ), false );
5861
}
5962

63+
if( part.info().base_item == itype_wall_wiring ||
64+
part.info().base_item == itype_power_cord
65+
) {
66+
continue;
67+
}
6068
veh_collision coll = veh.part_collision( *dest, part.part_index(), dp + rel_pos, true, false );
6169
if( coll.type != veh_coll_nothing ) {
6270
tripoint_abs_ms point = dp + rel_pos;

0 commit comments

Comments
 (0)