Skip to content

feat: Add Ragdoll features & readability#499

Closed
GoldenPig1205 wants to merge 12 commits intoExMod-Team:devfrom
GoldenPig1205:pr5
Closed

feat: Add Ragdoll features & readability#499
GoldenPig1205 wants to merge 12 commits intoExMod-Team:devfrom
GoldenPig1205:pr5

Conversation

@GoldenPig1205
Copy link

Description

Describe the changes
Added features to Exiled.API.Features.Ragdoll class and optimized the code.

What is the current behavior? (You can also link to an open issue here)
Created a Ragdoll within the server network and it worked fine.

What is the new behavior? (if this is a feature change)
Destroy(), Spawn() Add function overloading (allowing more interaction within a function)

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
❌ (still not)

Other information:


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

Copy link

@louis1706 louis1706 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will request a better change for this
UnSpawn & Spawn Only if the Ragdoll was already spawned

ALSO Please target dev branch

@louis1706 louis1706 changed the base branch from master to dev April 21, 2025 15:42
@GoldenPig1205
Copy link
Author

i will request a better change for this UnSpawn & Spawn Only if the Ragdoll was already spawned

ALSO Please target dev branch

Okay, When making a Pull Request, I will send it to the dev branch.

@GoldenPig1205 GoldenPig1205 requested a review from louis1706 April 21, 2025 16:56
@GoldenPig1205
Copy link
Author

UnSpawn & Spawn Only if the Ragdoll was already spawned

what do you mean by this "UnSpawn & Spawn Only if the Ragdoll was already spawned" exactly

Guess what's mean about "UnSpawn & Spawn Only if the Ragdoll was already spawned"
Comment on lines 438 to 465
/// <summary>
/// Spawns the ragdoll on the network with a specified network connection or asset ID.
/// </summary>
/// <param name="ownerConnection">The network connection of the owner.</param>
/// <param name="assetId">The optional asset ID of the ragdoll.</param>
public void Spawn(NetworkConnection ownerConnection, uint? assetId = null)
{
if (!IsSpawned)
{
if (assetId.HasValue)
NetworkServer.Spawn(GameObject, assetId.Value, ownerConnection);
else
NetworkServer.Spawn(GameObject, ownerConnection);
}
}

/// <summary>
/// Spawns the ragdoll on the network with a specified asset ID and network connection.
/// </summary>
public void Spawn() => NetworkServer.Spawn(GameObject);
/// <param name="assetId">The asset ID of the ragdoll.</param>
/// <param name="ownerConnection">The network connection of the owner.</param>
public void Spawn(uint assetId, NetworkConnection ownerConnection)
{
if (!IsSpawned)
{
NetworkServer.Spawn(GameObject, assetId, ownerConnection);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between this two methods?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to differentiate the usage, but I think just having the first function would be enough.

@GoldenPig1205
Copy link
Author

@louis1706 So are you just going to leave the code I added there?

@GoldenPig1205 GoldenPig1205 requested a review from VALERA771 April 23, 2025 09:11
@GoldenPig1205 GoldenPig1205 closed this by deleting the head repository May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants