Skip to content

Functions called in different files don't update on reload #8371

@dotGrim

Description

@dotGrim

Skript/Server Version

[21:55:07 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[21:55:07 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[21:55:07 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[21:55:07 INFO]: [Skript] Server Version: 1.21.10-113-9fc21bc (MC: 1.21.10)
[21:55:07 INFO]: [Skript] Skript Version: 2.14.0-pre2 (selfbuilt-unknown)
[21:55:07 INFO]: [Skript] Installed Skript Addons:
[21:55:07 INFO]: [Skript]  - skript-placeholders v1.7.0 (https://github.com/APickledWalrus/skript-placeholders)
[21:55:07 INFO]: [Skript]  - PoaSk v4.16.6 (https://github.com/Ekpoa/PoaSkRewritev2)
[21:55:07 INFO]: [Skript]  - skript-gui v1.3.2 (https://github.com/APickledWalrus/skript-gui)
[21:55:07 INFO]: [Skript]  - skript-reflect v2.6.2 (https://github.com/SkriptLang/skript-reflect)
[21:55:07 INFO]: [Skript]  - skript-worldedit v1.1.2
[21:55:07 INFO]: [Skript]  - SkBee v3.15.0 (https://github.com/ShaneBeee/SkBee)
[21:55:07 INFO]: [Skript]  - skript-worldguard v1.0.1 (https://github.com/SkriptLang/skript-worldguard)
[21:55:07 INFO]: [Skript] Installed dependencies:
[21:55:07 INFO]: [Skript]  - Vault v2.17.0
[21:55:07 INFO]: [Skript]  - WorldGuard v7.0.15-beta-01+445a1d7

Bug Description

When you reload a file containing a function, a different file that calls said function uses the old version of the function rather than the newly reloaded file. By reloading the different file that calls the function, it then updates to use the most recent version of the function.

Expected Behavior

Expected gui.sk to use most recent version of gui.sk's openGUI() function. Instead it saves an old entry and uses it until open.sk is reloaded.

Steps to Reproduce

  1. Initial state:
# gui.sk
function openGUI(p: player):
    open chest inventory with 3 rows to {_p}
    set slot 4 of top inventory of {_p} to dirt


# open.sk
command /gui:
	trigger:
		openGUI(player)
  1. Insert set slot 5 of top inventory of {_p} to diamond underneath the dirt line in gui.sk

  2. Reload gui.sk

  3. Enter /gui to open the GUI via the command defined in open.sk

  4. Note how the diamond is not put into the GUI

  5. Reload open.sk

  6. Re-enter /gui to open the GUI

  7. The diamond is now in the GUI

Errors or Screenshots

No response

Other

Potentially has to do with efy's function rework (-sovde)

Also using a slightly modified version of 2.14-pre2 to add debug message for an issue regarding EntityData aliases not loading properly on startup. Should not impact this issue.

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

Labels

bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.completedThe issue has been fully resolved and the change will be in the next Skript update.priority: mediumIssues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions