Skip to content

Commit 39c0198

Browse files
authored
Merge pull request #82285 from RoyBerube/aftershock_powergrid_deletion
[Aftershock] Power grid moves with the ship without deletion
2 parents bfce924 + 6b821ac commit 39c0198

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/teleport.cpp

Lines changed: 10 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,10 @@ 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" );
53+
54+
const std::string flag_WIRING( "WIRING" );
5055

5156
static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
5257
const tripoint_abs_ms &dp )
@@ -57,6 +62,11 @@ static bool TestForVehicleTeleportCollision( vehicle &veh, map &here, map *dest,
5762
dest->load( project_to<coords::sm>( dp + rel_pos ), false );
5863
}
5964

65+
if( part.info().has_flag( flag_WIRING ) ||
66+
part.info().base_item == itype_power_cord
67+
) {
68+
continue;
69+
}
6070
veh_collision coll = veh.part_collision( *dest, part.part_index(), dp + rel_pos, true, false );
6171
if( coll.type != veh_coll_nothing ) {
6272
tripoint_abs_ms point = dp + rel_pos;

0 commit comments

Comments
 (0)