Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
printz

[Linked portals bug] Damage across portals causes thrust in the wrong direction

Recommended Posts

I've noticed that damage caused by a thing in a layer to a thing in another layer (across a linked portal) causes a damage thrust in the wrong direction.

Here's a test map. It contains an archvile trapped in a square sector beyond a portal (it's trapped because of a monster-blocking linedef, not by the portal). It was modified not to produce fire. Just stand there waiting for the vile to hit you. Instead of being thrusted backwards, you'll be thrusted to your right.

So I looked into P_DamageMobj (responsible for thrusting damaged targets), and I saw this snippet there:

            auto link = P_GetLinkOffset(inflictor->groupid, target->groupid);
            ang = P_PointToAngle(inflictor->x, inflictor->y, 
                                  target->x + link->x, target->y + link->y);
(full context Github section here)

I highly suspect that link->x and link->y are added, when instead they should be subtracted from target, or conversely added to inflictor. Because of the wrong sign, the map editor offset between the two objects in different areas was exaggerated instead of being compensated. Do you think it's okay if I fix it this way?

Share this post


Link to post

Decided to fix and commit it anyway. Based on other examples, it was a wrong order of operands here.

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
Sign in to follow this  
×