* Implemented cServer::ScheduleTask() and cServer::TickQueuedTasks()
* Fixed formatting and added ScheduleTask to APIDesc
* Added feyokorenhof to contributors
* Added ExperienceAmount variable to all the hook calls.
* Made ExperienceAmount int reference instead of int in HOOK_PLAYER_FISHING. Fixed bug: a_Reward is now a reference
* Add documentation, change ItemFishingRod to pass in experience
Co-authored-by: Alexander Harkness <me@bearbin.net>
* Implement Dropspenser Hook
Implemented a hook for dropspensing.
HOOK_DROPSPENSE
When plugin callback returns true then dropspense is cancelled
* Update src/Bindings/PluginManager.h
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
* Create OnDropSpense.lua
* Fix indent
* Forgot include
Forgot to include the plugin manager. Although now im confused why it was working on my end without including the plugin manager
* Update plugins.lua with dropspense
* fix typos
* haha notepad++ go brr
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
* Avoid inefficient AString -> c_str() -> AString round trip
* Avoid redundant string init expressions
* Avoid unnecessary return, continue, etc.
* Add .clang-format to help with clang-tidy fix-its
* Avoid unnecessary passing by value
* Avoid unnecessary local copying
* Avoid copying in range-for loops
* Avoid over-complicated boolean expressions
* Some violations missed by my local clang-tidy
* Allow unnecessary continue statements
* Add brackets
* Another expression missed locally
* Move BindingsProcessor call into clang-tidy.sh and add space
* Fix pushd not found error
* Different grouping of CheckBlockInteractionRate
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.
reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
If a plugin installs any hooks in its Initialize method and then causes the Lua runtime to abort, the server asserted because the hooks were called while the plugin was being unloaded.
This allows plugins to register objects that can "survive" the plugin unloading - they will simply bail out if the plugin is already unloaded, instead of referencing bad plugin data.
Fixes#1556.