open-papyrus / papyrus-compiler

Open-source compiler for the Papyrus scripting language of Bethesda games.
https://open-papyrus.github.io/docs/papyrus-compiler/Introduction.html
MIT License
25 stars 3 forks source link

Add warning for uses of "RegisterForUpdate" #15

Open JonathanTaylor555 opened 2 years ago

JonathanTaylor555 commented 2 years ago

RegisterForUpdate is a function that in almost all cases can be replaced by the safer RegisterForSingleUpdate. A nice feature would be a warning for anyone who uses this function, so they can consider using RegisterForSingleUpdate instead.

Highlights of the issue for RegisterForUpdate from the papyrus wiki, rewritten for simplification:

Using RegisterForSingleUpdate can avoid all those problems, and is the preferred alternative to RegisterForUpdate for most use cases.