Note to self: the checkradius parameter of blockthingsiterator is a lie.

This commit is contained in:
Marisa the Magician 2018-08-17 21:07:30 +02:00
commit 951de234ed

View file

@ -933,7 +933,7 @@ Class UTMainHandler : StaticEventHandler
while ( bi.Next() ) while ( bi.Next() )
{ {
Actor a = bi.Thing; 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; continue;
Vector3 midpoint = a.Vec3Offset(0,0,a.height*0.5); Vector3 midpoint = a.Vec3Offset(0,0,a.height*0.5);
a.vel += Level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass)); a.vel += Level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass));