Skip to content

Commit 8d2895d

Browse files
Merge pull request #6898 from MjnMixael/fix_lab_animations
Still allow subsystem animations in the lab
2 parents 671a758 + 32905ac commit 8d2895d

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

code/ai/aigoals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ enum ai_goal_mode : uint8_t
8080
AI_GOAL_FLY_TO_SHIP,
8181
AI_GOAL_IGNORE_NEW,
8282
AI_GOAL_CHASE_SHIP_CLASS,
83-
AI_GOAL_PLAY_DEAD_PERSISTENT,
83+
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()
8484
AI_GOAL_LUA,
8585
AI_GOAL_DISARM_SHIP_TACTICAL,
8686
AI_GOAL_DISABLE_SHIP_TACTICAL,

code/lab/manager/lab_manager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ void LabManager::changeDisplayedObject(LabMode mode, int info_index, int subtype
614614
Player_ship = &Ships[Objects[CurrentObject].instance];
615615
ai_paused = 0;
616616

617+
// 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
617618
ai_add_ship_goal_scripting(AI_GOAL_PLAY_DEAD_PERSISTENT, -1, 100, nullptr, &Ai_info[Player_ship->ai_index], 0, 0);
618619
}
619620
break;

code/ship/ship.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20001,9 +20001,11 @@ void ship_move_subsystems(object *objp)
2000120001
Assertion(objp->type == OBJ_SHIP, "ship_move_subsystems should only be called for ships! objp type = %d", objp->type);
2000220002
auto shipp = &Ships[objp->instance];
2000320003

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

2000820010
for (auto pss = GET_FIRST(&shipp->subsys_list); pss != END_OF_LIST(&shipp->subsys_list); pss = GET_NEXT(pss))
2000920011
{

0 commit comments

Comments
 (0)