Skip to content

feat: Spawning NPCs via RA adds them to the Npc.List - #440

Merged
louis1706 merged 4 commits into
ExMod-Team:devfrom
Num10ck:dev
Feb 25, 2025
Merged

feat: Spawning NPCs via RA adds them to the Npc.List#440
louis1706 merged 4 commits into
ExMod-Team:devfrom
Num10ck:dev

Conversation

@Num10ck

@Num10ck Num10ck commented Feb 19, 2025

Copy link
Copy Markdown

Description

Describe the changes
Added a transpiler for SpawnDummyCommand.Execute that adds a created NPC to the Npc.List (Player.Dictionary).

What is the current behavior? (You can also link to an open issue here)
Spawning an NPC via RA does not add it to the Npc.List (Player.Dictionary).

What is the new behavior? (if this is a feature change)
Spawning an NPC via RA adds it to the Npc.List (Player.Dictionary).

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

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

RemoteAdminNpcCommandAddToDictionaryFix is now static.
@VALERA771

Copy link
Copy Markdown

I think it can be done easily

@Num10ck

Num10ck commented Feb 19, 2025

Copy link
Copy Markdown
Author

I think it can be done easily

It can be done by patching DummyUtils.SpawnDummy

@VALERA771

Copy link
Copy Markdown

We have IsNPC property in Player class which is basically incapsulates a method from base game that checks if player is NPC (fr?). So we can make this list depend on this property

Comment thread EXILED/Exiled.Events/Patches/Fixes/RemoteAdminNpcCommandAddToDictionaryFix.cs Outdated
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
@Num10ck
Num10ck requested a review from louis1706 February 19, 2025 11:15
@louis1706
louis1706 merged commit f6cd7d6 into ExMod-Team:dev Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base-game-bug Bug from the main game Transpiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants