From 999014170da0419c8b46cee775e3afd5b0dcf791 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 21 Dec 2012 11:22:46 +0000 Subject: Added TakeDamage logging to the Debuggers plugin. http://forum.mc-server.org/showthread.php?tid=625&pid=5720#pid5720 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1089 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Debuggers/Debuggers.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 6e39e6393..5550f0335 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -14,6 +14,7 @@ function Initialize(Plugin) PluginManager = cRoot:Get():GetPluginManager() PluginManager:AddHook(Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE) + PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE) LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) return true @@ -67,3 +68,13 @@ end + +function OnTakeDamage(Receiver, TDI) + -- Receiver is cPawn + -- TDI is TakeDamageInfo + + LOG(Receiver:GetClass() .. " was dealt RawDamage " .. TDI.RawDamage .. ", FinalDamage " .. TDI.FinalDamage .. " (that is, " .. (TDI.RawDamage - TDI.FinalDamage) .. " HPs covered by armor)"); +end + + + -- cgit v1.2.3