Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Darch

Help with a dehacked timed bomb

Question

This is a bomb that is thrown on the ground and explodes after a little while. Everything works as expected, except for one weird thing: it goes through impassible linedefs. It stops at monsters, objects and two sided linedefs (as it should), but it just goes right through impassible walls. It replaces BFG, here's the code: 

 

Thing 36 (BFG projectile)
Bits = SOLID+DROPOFF
Width = 131072
Missile damage = 0
Height = 131072

Frame 116
Duration = 30
Next frame = 117

[CODEPTR]
FRAME 117 = Explode
FRAME 118 = Explode

 

Any way to fix it?

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0
    if (!ld->backsector)
	return false;		// one sided line
		
    if (!(tmthing->flags & MF_MISSILE) )
    {
	if ( ld->flags & ML_BLOCKING )
	    return false;	// explicitly blocking everything

	if ( !tmthing->player && ld->flags & ML_BLOCKMONSTERS )
	    return false;	// block monsters only
    }

The relevant part of the vanilla collision code. Notice how things flagged as missiles will skip over these checks, and how the "block monster" check is done just by looking if the thing is attached to a player (assuming that anything that moves that isn't a player is a monster, since missiles have already been avoided in that check).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×