Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions code/def_files/data/tables/objecttypes.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ $AI:
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "fighter" "bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
$Skip Death Roll Percent Chance: 0.0

$Name: Cargo
$Scannable: YES
$Name: Cargo
$Targetable as unscanned: YES
$Scannable by default: YES
$Max Debris Speed: 200
$FF Multiplier: 0.10
$EMP Multiplier: 10.0
Expand Down Expand Up @@ -156,7 +157,8 @@ $Praise Destruction: YES
$On Hotkey List: YES
$Target as Threat: YES
$Show Attack Direction: YES
$Scannable: YES
$Targetable as unscanned: YES
$Scannable by default: YES
$Max Debris Speed: 150
$FF Multiplier: 1.0
$EMP Multiplier: 2.0
Expand Down
2 changes: 1 addition & 1 deletion code/hud/hudtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ int hud_target_ship_can_be_scanned(ship *shipp)
return 1;
} else if (Use_new_scanning_behavior) {
return 0;
} else if ((sip->class_type < 0) || !(Ship_types[sip->class_type].flags[Ship::Type_Info_Flags::Scannable])) {
} else if ((sip->class_type < 0) || !(Ship_types[sip->class_type].flags[Ship::Type_Info_Flags::Targetable_as_unscanned])) {
return 0;
}

Expand Down
4 changes: 1 addition & 3 deletions code/playerman/playercontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ bool player_inspect_cargo(float frametime, char *outstr)
// scannable cargo behaves differently. Scannable cargo is either "scanned" or "not scanned". This flag
// can be set on any ship. Any ship with this set won't have "normal" cargo behavior
if (!(cargo_sp->flags[Ship::Ship_Flags::Scannable])) {
if (!(cargo_sip->flags[Ship::Info_Flags::Cargo] || cargo_sip->flags[Ship::Info_Flags::Transport])) {
if ((cargo_sip->class_type < 0) || !(Ship_types[cargo_sip->class_type].flags[Ship::Type_Info_Flags::Scannable_by_default])) {
return false;
}
}
Expand All @@ -1710,8 +1710,6 @@ bool player_inspect_cargo(float frametime, char *outstr)
auto cargo_name = (cargo_sp->cargo1 & CARGO_INDEX_MASK) == 0
? XSTR("Nothing", 1674)
: Cargo_names[cargo_sp->cargo1 & CARGO_INDEX_MASK];
//Why was this assert here? I'm not sure it makes much sense because any ship can be scanned and have cargo revealed...
//Assert(cargo_sip->flags[Ship::Info_Flags::Cargo] || cargo_sip->flags[Ship::Info_Flags::Transport]);

if (cargo_sp->cargo_title[0] != '\0') {
if (cargo_sp->cargo_title[0] == '#') {
Expand Down
8 changes: 6 additions & 2 deletions code/ship/ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6145,8 +6145,12 @@ static void parse_ship_type(const char *filename, const bool replace)
stuff_boolean_flag(stp->flags, Ship::Type_Info_Flags::Show_attack_direction);
}

if(optional_string("$Scannable:")) {
stuff_boolean_flag(stp->flags, Ship::Type_Info_Flags::Scannable);
if(optional_string("$Scannable:") || optional_string("$Targetable as unscanned:")) {
stuff_boolean_flag(stp->flags, Ship::Type_Info_Flags::Targetable_as_unscanned);
}

if(optional_string("$Scannable by default:")) {
stuff_boolean_flag(stp->flags, Ship::Type_Info_Flags::Scannable_by_default);
}

if(optional_string("$Warp Pushes:")) {
Expand Down
3 changes: 2 additions & 1 deletion code/ship/ship_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ namespace Ship {
Target_as_threat,
Show_attack_direction,
No_class_display,
Scannable,
Targetable_as_unscanned,
Scannable_by_default,
Warp_pushes,
Warp_pushable,
Turret_tgt_ship_tgt,
Expand Down
Loading