diff --git a/code/ai/aigoals.h b/code/ai/aigoals.h index 12470cd6f11..dfcc82606c3 100644 --- a/code/ai/aigoals.h +++ b/code/ai/aigoals.h @@ -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, diff --git a/code/lab/manager/lab_manager.cpp b/code/lab/manager/lab_manager.cpp index 0b6239d6e11..300a4d97f9b 100644 --- a/code/lab/manager/lab_manager.cpp +++ b/code/lab/manager/lab_manager.cpp @@ -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; diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index 13834c48316..32c246a7117 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -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)) {