From 47d5395d24c6f209a758a689bff9a44f68d7397b Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 30 Mar 2014 13:44:28 +0200 Subject: Added a blockface parameter to the OnProjectileHitBlock hook. --- src/Entities/ProjectileEntity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Entities') diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index a9735a53c..37964d102 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -67,7 +67,7 @@ protected: eBlockFace Face; if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face)) { - if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile)) + if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face)) { return false; } -- cgit v1.2.3 From 66f1bb7b677324dd59265b7b0776490caa661bcc Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 30 Mar 2014 14:04:44 +0200 Subject: Added a BlockHitPos parameter to OnProjectileHitBlock --- src/Entities/ProjectileEntity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 37964d102..72ebf5775 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -67,12 +67,12 @@ protected: eBlockFace Face; if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face)) { - if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face)) + Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff; + if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face, &Intersection)) { return false; } - Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff; m_Projectile->OnHitSolidBlock(Intersection, Face); return true; } -- cgit v1.2.3 From 36e1e57d038eda0c183f616f2b45d2ae4733e27c Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 30 Mar 2014 17:21:13 +0200 Subject: Using recommendations (I think) --- src/Entities/ProjectileEntity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Entities') diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 72ebf5775..7a869a957 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -68,7 +68,8 @@ protected: if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face)) { Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff; - if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face, &Intersection)) + const Vector3i BlockHitPos = Vector3i(Intersection); + if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face, &BlockHitPos)) { return false; } -- cgit v1.2.3 From d1b23060ada3946d68453e381867861bc768999b Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 31 May 2014 14:14:55 +0200 Subject: Used recommendations --- src/Entities/ProjectileEntity.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index 7a869a957..acb10539d 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -68,8 +68,7 @@ protected: if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face)) { Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff; - const Vector3i BlockHitPos = Vector3i(Intersection); - if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, Face, &BlockHitPos)) + if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile, a_BlockX, a_BlockY, a_BlockZ, Face, &Intersection)) { return false; } -- cgit v1.2.3