From 93adbdce9a769b42baeb70f9ead5c7c6a35834b5 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 12 Sep 2020 19:57:44 +0100 Subject: Use tracing for explosions (#4845) * TNT: Implement tracing algorithm + Add intensity tracing * Fix iterating over all players to SendExplosion, even those not in range * Implemented TNT entity interaction * Fixed misaligned destruction tracing * Finalise TNT algorithm - Remove BlockArea and just use chunks Using SetBlock makes it so that we can update everything properly, and does appear to be faster. * BlockInfo learns about explosion attentuation * Rename Explodinator parameters * TNT: pull block destruction into common function Co-authored-by: Alexander Harkness --- src/Entities/TNTEntity.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/Entities/TNTEntity.h') diff --git a/src/Entities/TNTEntity.h b/src/Entities/TNTEntity.h index ef8b8ec3c..5b1c853bd 100644 --- a/src/Entities/TNTEntity.h +++ b/src/Entities/TNTEntity.h @@ -19,7 +19,7 @@ public: // tolua_export CLASS_PROTODEF(cTNTEntity) - cTNTEntity(Vector3d a_Pos, int a_FuseTicks = 80); + cTNTEntity(Vector3d a_Pos, unsigned a_FuseTicks = 80); // cEntity overrides: virtual void SpawnOn(cClientHandle & a_ClientHandle) override; @@ -31,17 +31,13 @@ public: // tolua_export void Explode(void); /** Returns the fuse ticks until the tnt will explode */ - int GetFuseTicks(void) const { return m_FuseTicks; } + unsigned GetFuseTicks(void) const { return m_FuseTicks; } /** Set the fuse ticks until the tnt will explode */ - void SetFuseTicks(int a_FuseTicks) { m_FuseTicks = a_FuseTicks; } + void SetFuseTicks(unsigned a_FuseTicks) { m_FuseTicks = a_FuseTicks; } // tolua_end protected: int m_FuseTicks; ///< How much ticks is left, while the tnt will explode }; // tolua_export - - - - -- cgit v1.2.3