Skip to content

Commit 925ee34

Browse files
committed
Adding CustomRole::Gravity
1 parent 857edae commit 925ee34

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Exiled.CustomRoles.API.Features
1818
using Exiled.API.Features;
1919
using Exiled.API.Features.Attributes;
2020
using Exiled.API.Features.Pools;
21+
using Exiled.API.Features.Roles;
2122
using Exiled.API.Features.Spawn;
2223
using Exiled.API.Interfaces;
2324
using Exiled.CustomItems.API.Features;
@@ -155,6 +156,11 @@ public abstract class CustomRole
155156
/// </summary>
156157
public virtual Vector3 Scale { get; set; } = Vector3.one;
157158

159+
/// <summary>
160+
/// Gets or sets a value indicating the <see cref="Player"/>'s gravity.
161+
/// </summary>
162+
public virtual Vector3? Gravity { get; set; }
163+
158164
/// <summary>
159165
/// Gets or sets a <see cref="Dictionary{TKey, TValue}"/> containing cached <see cref="string"/> and their <see cref="Dictionary{TKey, TValue}"/> which is cached Role with FF multiplier.
160166
/// </summary>
@@ -553,7 +559,8 @@ public virtual void AddRole(Player player)
553559
player.Health = MaxHealth;
554560
player.MaxHealth = MaxHealth;
555561
player.Scale = Scale;
556-
562+
if (Gravity.HasValue && player.Role is FpcRole fpcRole)
563+
fpcRole.Gravity = Gravity.Value;
557564
Vector3 position = GetSpawnPosition();
558565
if (position != Vector3.zero)
559566
{

0 commit comments

Comments
 (0)