Sign in to follow this  

CanEntitySeePoint always fails for non-player entities

  • Fixed

So this functions always returns false if the passed entity has no "inkable" component.

function CanEntitySeePoint(inst, x, y, z)
    return inst ~= nil
        and inst:IsValid()
        and (inst.components.inkable and not inst.components.inkable.inked) --"should be: and (inst.components.inkable == nil or not inst.components.inkable.inked)"
        and (TheSim:GetLightAtPoint(x, y, z) > TUNING.DARK_CUTOFF or
        and (_GetEntitySandstormLevel(inst) < TUNING.SANDSTORM_FULL_LEVEL or
            _CanEntitySeeInStorm(inst) or
            inst:GetDistanceSqToPoint(x, y, z) < TUNING.SANDSTORM_VISION_RANGE_SQ)


Steps to Reproduce
print(CanEntitySeePoint(c_spawn("butterfly"), 0, 0, 0))
  • Like 1
Sign in to follow this  

User Feedback

A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

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