Loading...   

  • Created By Uleat On: 04:00 PM January 30, 2018
  • Link

 zone/aggro.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/zone/aggro.cpp b/zone/aggro.cpp
index cc70f1a4..d73b96f6 100644
--- a/zone/aggro.cpp
+++ b/zone/aggro.cpp
@@ -1007,6 +1007,28 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
 	return zone->zonemap->CheckLoS(myloc, oloc);
 }
 
+bool Mob::CheckLosFN(glm::vec3 posWatcher, float sizeWatcher, glm::vec3 posTarget, float sizeTarget) {
+	if (zone->zonemap == nullptr) {
+		//not sure what the best return is on error
+		//should make this a database variable, but im lazy today
+#ifdef LOS_DEFAULT_CAN_SEE
+		return(true);
+#else
+		return(false);
+#endif
+	}
+
+#define LOS_DEFAULT_HEIGHT 6.0f
+
+	posWatcher.z += (sizeWatcher == 0.0f ? LOS_DEFAULT_HEIGHT : sizeWatcher) / 2 * HEAD_POSITION;
+	posTarget.z += (sizeTarget == 0.0f ? LOS_DEFAULT_HEIGHT : sizeTarget) / 2 * SEE_POSITION;
+
+#if LOSDEBUG>=5
+	Log(Logs::General, Logs::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f) [static]", posWatcher.x, posWatcher.y, posWatcher.z, posTarget.x, posTarget.y, posTarget.z, sizeWatcher, sizeTarget);
+#endif
+	return zone->zonemap->CheckLoS(posWatcher, posTarget);
+}
+
 //offensive spell aggro
 int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
 {

Raw Paste Data