autotargetting disengagment fix
This commit is contained in:
@@ -347,9 +347,23 @@ namespace Beyond
|
||||
|
||||
public void ClearTarget(bool findNewOneImmediately)
|
||||
{
|
||||
SetNewTarget(null, true);
|
||||
// --- FIX APPLIED HERE ---
|
||||
|
||||
// 1. Explicitly tell the lock-on system to unlock immediately.
|
||||
// This is the crucial step that resets the 'isLockingOn' flag to false.
|
||||
if (targetLockSystem != null)
|
||||
{
|
||||
targetLockSystem.SetLockOn(false);
|
||||
}
|
||||
|
||||
// 2. Deselect the current target and remove its highlight.
|
||||
SetNewTarget(null);
|
||||
|
||||
// 3. If requested, immediately find a new target.
|
||||
if (findNewOneImmediately && _gameStateManager != null && _gameStateManager.CurrentState == GameStateManager.State.COMBAT)
|
||||
{
|
||||
// Now, when UpdateTarget() runs, 'isLockingOn' will be correctly set to false,
|
||||
// forcing the system to use the stricter 'autoLockOnDistance' for the new candidate.
|
||||
if (!_manualSwitchCooldownActive)
|
||||
{
|
||||
UpdateTarget();
|
||||
|
||||
Reference in New Issue
Block a user