Jump to content

Hits from a planar entity can only show the planar hit fx if the target has an inventory component


hoxi
  • Pending

This is due to this bit of code being encased like this, in Combat:GetAttacked:

if self.inst.components.inventory ~= nil then
	if attacker ~= nil and attacker.components.planarentity ~= nil and not self.inst.components.inventory:EquipHasSpDefenseForType("planar") then
		attacker.components.planarentity:OnPlanarAttackUndefended(self.inst)
	end
	damage, spdamage = self.inst.components.inventory:ApplyDamage(damage, attacker, weapon, spdamage)
end

OnPlanarAttackUndefended should still be called on entities without an inventory component, as that means they can't have planar defense (maybe check that the target isn't also a planar entity, which is also missing in the current iteration of the code).


Steps to Reproduce
  1. Have a planar entity attack an entity without an inventory component.
  2. Have them attack a player or some other entity with an inventory component.
  3. Notice how the fx doesn't play in the first case.
  • Like 1



User Feedback


There are no comments to display.



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

×
  • Create New...