Some Lua scripts use OnDestroy which is never called by anything
Describe the bug
Some Lua scripts (Browncoats's Heatlance flamethrower and some Refinery breakables) define a function OnDestroy, which is not a function called by any core game code or script. However, Destroy is defined.
In case of Heatlance, this means that when it gets destroyed as it's being activated, the fire noise persists in the location it was at permanently for the rest of the game. It's quite a loud and annoying noise too.
I'm on the development branch, for reference.
To Reproduce Steps to reproduce the behavior:
- Go to
Data/Browncoats.rte/Devices/Weapons/Heatlance/Heatlance.lua - Put
print("blah blah")into theOnDestroyfunction - Spawn then utterly explode the Heatlance in the game
- See no prints in the console.
This is easily fixable by replacing function OnDestroy to function Destroy in the 5 affected scripts. I'm too lazy to make a whole new git branch and pull request for this at this time, sorry lmao
The scripts (courtesy of grep "function OnDestroy"):
Cortex-Command-Community-Project/Data/Browncoats.rte/Scenes/Objects/Breakables/RefineryGenerator/RefineryGenerator.lua
Cortex-Command-Community-Project/Data/Browncoats.rte/Scenes/Objects/Breakables/RefineryDrill/RefineryDrill.lua
Cortex-Command-Community-Project/Data/Browncoats.rte/Scenes/Objects/Breakables/RefineryConsole/RefineryConsole.lua
Cortex-Command-Community-Project/Data/Browncoats.rte/Scenes/Objects/Breakables/RefineryCameraServer/RefineryCameraServer.lua
Cortex-Command-Community-Project/Data/Browncoats.rte/Devices/Weapons/Heatlance/Heatlance.lua