From 951de234eddae81038f39ec6547cb51c4ab97ad1 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 17 Aug 2018 21:07:30 +0200 Subject: [PATCH] Note to self: the checkradius parameter of blockthingsiterator is a lie. --- zscript/utcommon.zsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zscript/utcommon.zsc b/zscript/utcommon.zsc index dc68027..61f946e 100644 --- a/zscript/utcommon.zsc +++ b/zscript/utcommon.zsc @@ -933,7 +933,7 @@ Class UTMainHandler : StaticEventHandler while ( bi.Next() ) { Actor a = bi.Thing; - if ( !a || !a.bSHOOTABLE || !Source.CheckSight(a,0xf) || (a == Source) ) + if ( !a || !a.bSHOOTABLE || !Source.CheckSight(a,0xf) || (a == Source) || (Source.Distance3D(a) > ExplosionRadius) ) continue; Vector3 midpoint = a.Vec3Offset(0,0,a.height*0.5); a.vel += Level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass));