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

SCP 914 classchange causes error #2

Open
Chuppa2 opened this issue Nov 17, 2024 · 9 comments
Open

SCP 914 classchange causes error #2

Chuppa2 opened this issue Nov 17, 2024 · 9 comments
Assignees

Comments

@Chuppa2
Copy link

Chuppa2 commented Nov 17, 2024

Describe the bug
SCP 914 classchange causes error when going inside 914 and setting it to what the classchange is set up to

To Reproduce
Steps to reproduce the behavior:

  1. Setup classchange to anything
  2. Use 914 on setup setting

Expected behavior
For my class to be changed

Actual behavior
Error in console and no class change

Copy of the relevant CU config section

scp914_class_changes:
   Rough:
   - original: ClassD
     new: 'SCP-049-2'
     chance: 100
     keep_inventory: true
     keep_health: false
   - original: Scientist
     new: 'SCP-049-2'
     chance: 100
     keep_inventory: true
     keep_health: true

EXILED Version ("latest" is not a version):
For example 8.14.0

Screenshot of the results of the plym show command in server console:
image

Additional context
N/A

@Chuppa2
Copy link
Author

Chuppa2 commented Nov 17, 2024

Updated to 7.2.3,
did not fix

@Mikihero
Copy link
Collaborator

error

[ERROR] [Exiled.Events] Method "OnUpgradingPlayer" of the class "Common_Utilities.EventHandlers.MapHandlers" caused an exception when handling the event "Exiled.Events.Features.Event`1[[Exiled.Events.EventArgs.Scp914.UpgradingPlayerEventArgs, Exiled.Events, Version=8.14.0.0, Culture=neutral, PublicKeyToken=null]]"
                                 System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
                                   at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <75633565436c42f0a6426b33f0132ade>:0
                                   at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <75633565436c42f0a6426b33f0132ade>:0
                                   at Common_Utilities.EventHandlers.MapHandlers.OnUpgradingPlayer (Exiled.Events.EventArgs.Scp914.UpgradingPlayerEventArgs ev) [0x0026d] in <17e96c16a5274e04b11d6ea6c2e5d552>:0
                                   at Exiled.Events.Features.Event`1[T].InvokeNormal (T arg) [0x00028] in <bfb010202e6c42e582ef2d13d23749f1>:0

@Mikihero
Copy link
Collaborator

the issue you're facing is actually because you used the wrong name for 049-2:

scp914_class_changes:
  Rough:
  - original: 'ClassD'
    new: 'Scp0492'
    chance: 100
    keep_inventory: true
    keep_health: false
  - original: 'Scientist'
    new: 'Scp0492'
    chance: 100
    keep_inventory: true
    keep_health: true

@Mikihero
Copy link
Collaborator

the error will persist tho, I'll take a look at that when I get the chance

@Chuppa2
Copy link
Author

Chuppa2 commented Dec 3, 2024

any update?

@Mikihero
Copy link
Collaborator

Mikihero commented Dec 3, 2024

rn I'm focused on exiled and 14.0, I probably won't update this until that comes out fully unless it takes a lot of time

@Antoniofo
Copy link

Hi i cloned the repo checkedout on the 7.2.3 commented this line

Log.Debug($"{nameof(OnUpgradingPlayer)} : {nameof(config.Scp914TeleportChances)}: {ev.Player.Nickname} is trying to be teleported by 914. {roomType} + {offset}; {zone} + {ignoredRooms.Count} ignored rooms; damage: {damage}; {rolledChance} <= {chance} ({rolledChance <= chance})");

and no more error
the funniest thing is that the line is a debug log

@Chuppa2
Copy link
Author

Chuppa2 commented Dec 15, 2024

thats crazy

@Antoniofo
Copy link

somehow the ignoredRooms variable is null and then it tries to use count() on it

Antoniofo added a commit to Antoniofo/Common-Utils that referenced this issue Dec 23, 2024
using the nullchecker with ignoredRooms so Count is not call on the variable while is null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants