Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Настоящий фикс бага с длинными руками #215

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Content.Shared/CombatMode/SharedCombatModeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private void OnShutdown(EntityUid uid, CombatModeComponent component, ComponentS
{
_actionsSystem.RemoveAction(uid, component.CombatToggleActionEntity);

SetMouseRotatorComponents(uid, false);
SetMouseRotatorComponents(uid, false, component); // Corvax-Next-NoScope-Fix
}

private void OnActionPerform(EntityUid uid, CombatModeComponent component, ToggleCombatActionEvent args)
Expand Down Expand Up @@ -87,16 +87,16 @@ public virtual void SetInCombatMode(EntityUid entity, bool value, CombatModeComp
if (!component.ToggleMouseRotator || IsNpc(entity) && !_mind.TryGetMind(entity, out _, out _))
return;

SetMouseRotatorComponents(entity, value);
SetMouseRotatorComponents(entity, value, component); // Corvax-Next-NoScope-Fix
}

private void SetMouseRotatorComponents(EntityUid uid, bool value)
private void SetMouseRotatorComponents(EntityUid uid, bool value, CombatModeComponent? comp = null) // Corvax-Next-NoScope-Fix
{
if (value)
{
// Corvax-Next-NoScope-Start
var rot = EnsureComp<MouseRotatorComponent>(uid);
if (TryComp<CombatModeComponent>(uid, out var comp) && comp.SmoothRotation) // no idea under which (intended) circumstances this can fail (if any), so i'll avoid Comp<>().
if (TryComp<CombatModeComponent>(uid, out var combatComp) && combatComp.SmoothRotation) // no idea under which (intended) circumstances this can fail (if any), so i'll avoid Comp<>().
{
rot.AngleTolerance = Angle.FromDegrees(1); // arbitrary
rot.Simple4DirMode = false;
Expand Down
Loading