feat: Add Ragdoll features & readability#499
Closed
GoldenPig1205 wants to merge 12 commits intoExMod-Team:devfrom
GoldenPig1205:pr5
Closed
feat: Add Ragdoll features & readability#499GoldenPig1205 wants to merge 12 commits intoExMod-Team:devfrom GoldenPig1205:pr5
GoldenPig1205 wants to merge 12 commits intoExMod-Team:devfrom
GoldenPig1205:pr5
Conversation
louis1706
requested changes
Apr 21, 2025
Author
Okay, When making a Pull Request, I will send it to the dev branch. |
Author
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"
VALERA771
reviewed
Apr 23, 2025
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); | ||
| } | ||
| } |
There was a problem hiding this comment.
What's the difference between this two methods?
Author
There was a problem hiding this comment.
I was trying to differentiate the usage, but I think just having the first function would be enough.
Author
|
@louis1706 So are you just going to leave the code I added there? |
VALERA771
approved these changes
Apr 24, 2025
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other