Skip to content

Entity > World right click doesn't create hydraulic on hit normal, but World > Entity does create it #3699

Description

@Titanic4

if CLIENT or not trace2.Entity:IsValid() or not WireLib.CanTool(self:GetOwner(), trace2.Entity, "wire_hydraulic") then return false end

The tool only checks if the entity at the end is valid, without checking the validity of entity at the start of the trace.
This causes the tool to stop working if you aim at the entity and the other side happens to be the world itself.
Strangely, if the world is at the start of the trace, but the entity is at the end, the tool will create the hydraulic at the trace location.

The code at the linked line has to be changed to

if CLIENT or (not trace.Entity:IsValid() and not trace2.Entity:IsValid()) or not WireLib.CanTool(self:GetOwner(), trace2.Entity, "wire_hydraulic") then return false end

, so entities at both sides are checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions