From 55a97f4605a263f4b670b447cd4af9ffa1a8d472 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 5 May 2013 01:44:55 +0200 Subject: Allow nil as puncher e.g. to do damage by tnt --- src/content_sao.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 24a9186f7..47b94a5d9 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -673,8 +673,14 @@ int LuaEntitySAO::punch(v3f dir, { setHP(getHP() - result.damage); + + std::string punchername = "nil"; + + if ( puncher != 0 ) + punchername = puncher->getDescription(); + actionstream<getDescription()<<", damage "<getDescription(); + actionstream<<"Player "<getName()<<" punched by " - <getDescription()<<", damage "<