Skip to content

tweak(mono-rt2): change script initialization method - #2854

Closed
DaniGP17 wants to merge 1 commit into
citizenfx:masterfrom
DaniGP17:fix/mono-v2
Closed

DaniGP17 wants to merge 1 commit into
citizenfx:masterfrom
DaniGP17:fix/mono-v2

Conversation

@DaniGP17

Copy link
Copy Markdown
Contributor

Goal of this PR

Change the way scripts are initialized to prevent a BaseClass with the EnableOnLoad(false) attribute from loading ticks, events and nui callbacks.

How is this PR achieving the goal

First of all I have modified the Initialize function, now when I initialize the script it will call the Enable function again to load the ticks, events and nui callbacks.
Finally, I have eliminated the functions that recorded ticks, callbacks and events when they were added.

This PR applies to the following area(s)

ScRT: C#

Successfully tested on

Game builds: .

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #2476

@github-actions github-actions Bot added ScRT: C# Issues/PRs related to either C# scripting runtimes invalid Requires changes before it's considered valid and can be (re)triaged labels Oct 10, 2024
@DaniGP17 DaniGP17 closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged ScRT: C# Issues/PRs related to either C# scripting runtimes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaseClass with EnableOnLoad(false) still loads ticks, events, etc. by registering them without the attributes

1 participant