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

FixNpcNoclip #34

Merged
merged 5 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion EXILED/Exiled.API/Features/Npc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace Exiled.API.Features
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features.Components;

using Footprinting;

using MEC;
Expand Down Expand Up @@ -52,6 +51,20 @@ public Npc(GameObject gameObject)
/// </summary>
public static new List<Npc> List => Player.List.OfType<Npc>().ToList();

/// <summary>
/// Gets or sets the player's position.
/// </summary>
public override Vector3 Position
{
get => base.Position;
set
{
base.Position = value;
if (Role is Roles.FpcRole fpcRole)
fpcRole.RelativePosition = new(value);
}
}

/// <summary>
/// Retrieves the NPC associated with the specified ReferenceHub.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public Player Cuffer
/// </summary>
/// <seealso cref="Teleport(Vector3)"/>
/// <seealso cref="Teleport(object)"/>
public Vector3 Position
public virtual Vector3 Position
{
get => Transform.position;
set => ReferenceHub.TryOverridePosition(value, Vector3.zero);
Expand Down
Loading