1
0

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
This commit is contained in:
madmaxoft@gmail.com 2012-12-21 11:22:46 +00:00
parent 65aa72a2c3
commit 999014170d

View File

@ -14,6 +14,7 @@ function Initialize(Plugin)
PluginManager = cRoot:Get():GetPluginManager() PluginManager = cRoot:Get():GetPluginManager()
PluginManager:AddHook(Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE) PluginManager:AddHook(Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE)
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
return true 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