Stop spectator camera unit changing on corpses

Previously the camera would be automatically moved away from corpses (when the unit currently being watched dies). This changes it to stay on them until the view is manually switched as users might want to stick around and watch whatever was going on at the time of death.
This commit is contained in:
SilentSpike 2015-08-05 13:19:47 +01:00
parent 79e607836b
commit 07e09b60fa
3 changed files with 6 additions and 3 deletions

View File

@ -78,6 +78,7 @@ switch (toLower _mode) do {
camDestroy GVAR(camera); camDestroy GVAR(camera);
// Return to player view // Return to player view
clearRadio;
_unit switchCamera "internal"; _unit switchCamera "internal";
// Re-enable BI damage effects // Re-enable BI damage effects

View File

@ -26,10 +26,12 @@ if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHand
// Remove all dead and null units from the list // Remove all dead and null units from the list
[] call FUNC(updateUnits); [] call FUNC(updateUnits);
// Camera shouldn't stay on unit that isn't in the list // Camera shouldn't stay on unit that isn't in the list (unless dead)
if !(GVAR(camUnit) in GVAR(unitList)) then { if !(GVAR(camUnit) in GVAR(unitList)) then {
if (alive GVAR(camUnit) || isNull GVAR(camUnit)) then {
[nil,1] call FUNC(cycleCamera); [nil,1] call FUNC(cycleCamera);
}; };
};
// Reduce overhead when unit tree is hidden // Reduce overhead when unit tree is hidden
if (ctrlShown (_display displayCtrl IDC_UNIT)) then { if (ctrlShown (_display displayCtrl IDC_UNIT)) then {

View File

@ -33,7 +33,7 @@ if !(_newMode in GVAR(availableModes)) then {
}; };
// When no units available to spectate, exit to freecam // When no units available to spectate, exit to freecam
if (GVAR(unitList) isEqualTo []) then { if ((GVAR(unitList) isEqualTo []) && (alive _newUnit || isNull _newUnit)) then {
_newMode = 0; _newMode = 0;
_newUnit = objNull; _newUnit = objNull;
}; };