Skip to content

Commit

Permalink
fix: Player.IsSpeaking and TeslaGate.IsPlayerInHurtRange (#341)
Browse files Browse the repository at this point in the history
* VoiceModule.IsSpeaking is client-side lol
use ServerIsSending instead

* Fix TeslaGate.IsPlayerInHurtRange

---------

Co-authored-by: Yamato <[email protected]>
  • Loading branch information
CosmosZvezdo4kin and louis1706 authored Dec 26, 2024
1 parent b212f0c commit ad25390
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public bool IsIntercomMuted
/// <summary>
/// Gets a value indicating whether the player is speaking.
/// </summary>
public bool IsSpeaking => Role is Roles.IVoiceRole voiceRole && voiceRole.VoiceModule.IsSpeaking;
public bool IsSpeaking => Role is Roles.IVoiceRole voiceRole && voiceRole.VoiceModule.ServerIsSending;

/// <summary>
/// Gets the player's voice color.
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/TeslaGate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void ForceTrigger()
/// </summary>
/// <param name="player">The <see cref="Player"/> to check.</param>
/// <returns><see langword="true"/> if the given <see cref="Player"/> is in the hurt range of the tesla gate; otherwise, <see langword="false"/>.</returns>
public bool IsPlayerInHurtRange(Player player) => player is not null && Vector3.Distance(Position, player.Position) <= Base.sizeOfTrigger * 2.2f;
public bool IsPlayerInHurtRange(Player player) => player is not null && Base.killers.Any(x => new Bounds(x.transform.position, Base.sizeOfKiller).Contains(player.Position));

/// <summary>
/// Gets a value indicating whether the <see cref="Player"/> is in the idle range of a specific tesla gate.
Expand Down

0 comments on commit ad25390

Please sign in to comment.