Exiled-Team / EXILED

A high-level plugin framework for SCP: Secret Laboratory servers. It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.
https://www.exiled.to/
Other
275 stars 180 forks source link

[BUG] Lockers property does not contain all lockers #1442

Closed warquys closed 1 year ago

warquys commented 2 years ago

The list of lockers of Map does not contain all lockers The Lockers property of Exiled.API.Features.Map does not contain all lockers! indeed if you call this method UnityEngine.Object.FindObjectsOfType<Locker>() when the round is in lunched, you get more locker than the property.

To Reproduce Steps to reproduce the behavior:

  1. create a plugin with a method attached to RoundStarted Event. Get the Lockers by UnityEngine.Object.FindObjectsOfType<Locker>(); Get the Lockers by Exiled.API.Features.Map.Lockers;
    • The attach method Server.RoundStarted
          var lockerFindObjects = UnityEngine.Object.FindObjectsOfType<Locker>();
          Log.Send("Lockers by UnityEngine.Object------------", Discord.LogLevel.Debug, ConsoleColor.Blue);
          foreach (var locker in lockerFindObjects)
          {
              Log.Debug(locker);
          }
          Log.Debug("Lockers by Exiled------------------------", Discord.LogLevel.Debug, ConsoleColor.Blue);
          foreach (var locker in Map.Lockers)
          {
              Log.Debug(locker);
          }
  2. Start the serveur with the plugin...
  3. Start round...
  4. See the log

Expected behavior Same value in Lockers and the value of UnityEngine.Object.FindObjectsOfType<Locker>()

Server logs Log.txt

EXILED Version ("latest" is not a version): Exiled.Loader - Version 5.3.0

Results of show plugins command in console:

[2022-11-02 01:29:38.116 +01:00] Total number of plugins: 7
                                 Enabled plugins: 7
                                 Disabled plugins: 0

                                 Exiled.Events:
                                        - Author: Exiled Team
                                        - Version: 5.3.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_events
                                        - Priority: Highest
                                 TestLocker:
                                        - Author: VT
                                        - Version: 1.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: test_locker
                                        - Priority: Medium
                                 Exiled.Updater:
                                        - Author: Exiled.Updater
                                        - Version: 3.1.1.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_updater
                                        - Priority: Medium
                                 Exiled.Permissions:
                                        - Author: Exiled Team
                                        - Version: 5.3.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_permissions
                                        - Priority: Medium
                                 Exiled.CreditTags:
                                        - Author: Babyboucher20 & iRebbok & Exiled Team
                                        - Version: 5.3.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_credits
                                        - Priority: Medium
                                 Exiled.CustomRoles:
                                        - Author: Exiled Team
                                        - Version: 5.3.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_custom_roles
                                        - Priority: Medium
                                 Exiled.CustomItems:
                                        - Author: Exiled Team
                                        - Version: 5.3.0.0
                                        - Required Exiled Version: 5.3.0.0
                                        - Prefix: exiled_custom_items
                                        - Priority: Medium
warquys commented 2 years ago

I would like to add that the maps do not seem to be fully loaded when the Generated Event is called

iopietro commented 1 year ago

Fixed in Exiled-EA.