Short version: the game is lying to you, sadly. Hacking a turret only gives you control for 3 turns, and it can be interrupted if you get disoriented.
I've experienced this myself, but to see whether it's a bug or not I pieced this together from a few places. The first is the code which sets up the mind control effect triggered when you hack the turret (X2Effect_MindControl.uc
, line 37):
//Typically, mind-control should get removed when the source is impaired, like a sustained effect.
//Because mind-control impairs a unit momentarily when being added or removed,
//this means we don't have to propagate team changes if we have a mind-control train.
//(For extra fun, consider an acyclic graph of Sectoids mind-controlling each other and raising Psi Zombies.)
//-btopp 2015-10-16
if (!bInfiniteDuration)
`XEVENTMGR.RegisterForEvent(EffectObj, 'ImpairingEffect', NewEffectState.OnSourceBecameImpaired, ELD_OnStateSubmitted, , ControllerState);
This code basically says "if the mind control effect isn't infinite in duration, remove it when the source of the effect is impaired". In your case, being impaired comes from being disoriented.
So now the question is whether hacking a turret is an infinite-duration mind control. The answer lies in X2Ability_HackRewards.uc
, line 247:
bInfiniteDuration = default.CONTROL_TURRET_DURATION <= 0;
ControlEffect = class'X2StatusEffects'.static.CreateMindControlStatusEffect(default.CONTROL_TURRET_DURATION, true, bInfiniteDuration);
So the duration is infinite only if the configured value CONTROL_TURRET_DURATION
is non-positive. And that value, from XComGameData_SoldierSkills.ini
, is:
CONTROL_TURRET_DURATION=3
So the answer is no, hacking a turret only lasts a limited time, and because of that, it can be interrupted if the hacker is disoriented.
As to whether it's a bug? That we can't really say without a developer's input. It's clearly not the behavior documented by the ability, though.