From 23bca008317e125659d4b97f29cf13da81a7aecd Mon Sep 17 00:00:00 2001 From: KrystilizeNevaDies <57762380+KrystilizeNevaDies@users.noreply.github.com> Date: Tue, 22 Sep 2020 01:31:45 +1000 Subject: Implement Dropspenser Hook (#4903) * 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 * 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 --- src/Bindings/PluginLua.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Bindings/PluginLua.cpp') diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index abac8b9a8..f4cfd4a86 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -523,6 +523,15 @@ bool cPluginLua::OnHopperPushingItem(cWorld & a_World, cHopperEntity & a_Hopper, +bool cPluginLua::OnDropSpense(cWorld & a_World, cDropSpenserEntity & a_DropSpenser, int a_SlotNum) +{ + return CallSimpleHooks(cPluginManager::HOOK_DROPSPENSE, &a_World, &a_DropSpenser, a_SlotNum); +} + + + + + bool cPluginLua::OnKilled(cEntity & a_Victim, TakeDamageInfo & a_TDI, AString & a_DeathMessage) { cOperation op(*this); -- cgit v1.2.3