Skip to content
Merged
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
2 changes: 1 addition & 1 deletion code/ai/aigoals.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ enum ai_goal_mode : uint8_t
AI_GOAL_FLY_TO_SHIP,
AI_GOAL_IGNORE_NEW,
AI_GOAL_CHASE_SHIP_CLASS,
AI_GOAL_PLAY_DEAD_PERSISTENT,
AI_GOAL_PLAY_DEAD_PERSISTENT, // Disables subsystem rotation/translation among other things but there is a carveout for that in the lab only in ship_move_subsystems()
AI_GOAL_LUA,
AI_GOAL_DISARM_SHIP_TACTICAL,
AI_GOAL_DISABLE_SHIP_TACTICAL,
Expand Down
1 change: 1 addition & 0 deletions code/lab/manager/lab_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ void LabManager::changeDisplayedObject(LabMode mode, int info_index, int subtype
Player_ship = &Ships[Objects[CurrentObject].instance];
ai_paused = 0;

// Set the ship to play dead so it doesn't move. There is a special carveout to still allow subsystem rotations/translations in the lab, though
ai_add_ship_goal_scripting(AI_GOAL_PLAY_DEAD_PERSISTENT, -1, 100, nullptr, &Ai_info[Player_ship->ai_index], 0, 0);
}
break;
Expand Down
8 changes: 5 additions & 3 deletions code/ship/ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20001,9 +20001,11 @@ void ship_move_subsystems(object *objp)
Assertion(objp->type == OBJ_SHIP, "ship_move_subsystems should only be called for ships! objp type = %d", objp->type);
auto shipp = &Ships[objp->instance];

// non-player ships that are playing dead do not process subsystems or turrets
if ((!(objp->flags[Object::Object_Flags::Player_ship]) || Player_use_ai) && Ai_info[shipp->ai_index].mode == AIM_PLAY_DEAD)
return;
// non-player ships that are playing dead do not process subsystems or turrets unless we're in the lab
if (gameseq_get_state() != GS_STATE_LAB) {
if ((!(objp->flags[Object::Object_Flags::Player_ship]) || Player_use_ai) && Ai_info[shipp->ai_index].mode == AIM_PLAY_DEAD)
return;
}

for (auto pss = GET_FIRST(&shipp->subsys_list); pss != END_OF_LIST(&shipp->subsys_list); pss = GET_NEXT(pss))
{
Expand Down
Loading