From 46a8b77151e7cce23d5294c1c48e93a05821db34 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 24 Aug 2013 21:42:11 +0200 Subject: cTracer doesn't attempt a trace above the world. This fixes some crashes with out-of-world entities. --- source/Tracer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/Tracer.cpp') diff --git a/source/Tracer.cpp b/source/Tracer.cpp index 6d37f2ed8..0f756756a 100644 --- a/source/Tracer.cpp +++ b/source/Tracer.cpp @@ -133,9 +133,9 @@ void cTracer::SetValues(const Vector3f & a_Start, const Vector3f & a_Direction) int cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance) { - if (a_Start.y < 0) + if ((a_Start.y < 0) || (a_Start.y >= cChunkDef::Height)) { - LOGD("%s: Start is below the world", __FUNCTION__); + LOGD("%s: Start Y is outside the world (%d), not tracing.", __FUNCTION__, a_Start.y); return 0; } -- cgit v1.2.3 From f3ab7d1873081d07cf5a451430b077d148697b09 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 24 Aug 2013 22:48:19 +0200 Subject: Fixed logging in cTracer. --- source/Tracer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/Tracer.cpp') diff --git a/source/Tracer.cpp b/source/Tracer.cpp index 0f756756a..42f1ae5dd 100644 --- a/source/Tracer.cpp +++ b/source/Tracer.cpp @@ -135,7 +135,7 @@ int cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int { if ((a_Start.y < 0) || (a_Start.y >= cChunkDef::Height)) { - LOGD("%s: Start Y is outside the world (%d), not tracing.", __FUNCTION__, a_Start.y); + LOGD("%s: Start Y is outside the world (%.2f), not tracing.", __FUNCTION__, a_Start.y); return 0; } -- cgit v1.2.3