This commit is contained in:
2026-03-13 16:19:35 +01:00
parent 858a0cff91
commit a356858fee
3 changed files with 7 additions and 3 deletions

View File

@@ -8,7 +8,6 @@ SCR_PlayerController {
}
}
SCR_VoiceRangeController "{68D6FBA83607BC45}" {
m_iCurrentRange 10
}
}
}

Binary file not shown.

View File

@@ -91,15 +91,20 @@ class SCR_VoiceRangeController: ScriptComponent {
SCR_VONController vonContr = SCR_VONController.Cast(GetOwner().FindComponent(SCR_VONController));
if (!vonContr) return;
// Finde heraus, welche Komponente wir basierend auf den Metern brauchen
typename compType = SCR_VoNNormal;
if (m_iCurrentRange <= 15) compType = SCR_VoNWhispering;
else if (m_iCurrentRange >= 50) compType = SCR_VoNLoud;
SCR_VoNComponent newVonComp = SCR_VoNComponent.Cast(player.FindComponent(compType));
if (newVonComp) {
// Nur wechseln, wenn sich die Stufe WIRKLICH ändert (verhindert unnötige Updates)
if (vonContr.GetVONComponent() == newVonComp) return;
// Komponente sanft wechseln OHNE den Toggle (behält Push-to-Talk und Mute-Status bei!)
vonContr.SetVONComponent(newVonComp);
vonContr.SetVONProximityToggle(false);
vonContr.SetVONProximityToggle(true);
Print("GTG Voice: VON-Stufe gewechselt zu: " + compType.ToString(), LogLevel.WARNING);
}
}