Detect Sector Damage Types

Status
Not open for further replies.

Joat

Gum Phoenix
I am making Inferno and Liquid shields and using the ShouldDamage hook to determine if the user should be immune to certain types of damage. The problem is, most of the time, said damage (that would be blocked by one such shield) is caused by a damaging sector, not an object, in which case both "damager" and "source" are nil. Any suggestions on how to detect such sources?

My thoughts on how to do so currently are to, if damager and source are nil, check if the player is in a damaging sector and, if so, determine whether the player should be damaged based on that. However, I'm guessing a damaging sector is not the only situation in which damager and source will be nil, so I suspect that solution may cause some inaccuracy.
 
Last edited:
I have now tried that and it works, partially. However, while it works fine for if one is standing ATOP a FOF, it does not properly detect if a player is INSIDE a FOF with that special. So, it works just fine for solid lava, but not for liquid lava, for example.

EDIT: As it turns out, the issue was caused by the "make the shield disappear in water" part of the script also triggering when in lava.

---------- Post added at 05:41 PM ---------- Previous post was at 05:02 PM ----------

I dislike double-posting, but I have a new question, now that the previous one was resolved, also related to the shield.

Code:
wielder.eflags & MFE_UNDERWATER and not P_PlayerTouchingSectorSpecial(wielder.player, 1, 3)

The above code is false when the player is entering or exiting a lava FOF from above (as it should be), but is briefly true when the player is exiting (but not when they are entering) a lava FOF from the side. Is this a glitch or am I doing something wrong?
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top