Skip to content

[BUG]: Incorrect property mapping for FullThrowRelativePosition in ThrowableItem #400

@efrosim

Description

@efrosim

Before You Report

  • I have searched for existing reports of this bug, and this bug report is unique.

Version

1.1.6

Description

In the ThrowableItem wrapper, the FullThrowRelativePosition property incorrectly gets and sets the StartTorque value of the FullThrowSettings instead of the RelativePosition. This breaks the physics and spawn position logic for full throws of grenades and other throwable items.

To Reproduce

  1. Obtain a ThrowableItem instance (e.g., by giving a player an HE Grenade).
  2. Assign a new Vector3 value to FullThrowRelativePosition (e.g., throwable.FullThrowRelativePosition = new Vector3(10f, 20f, 30f);).
  3. Check the value of FullThrowStartTorque. It will be overwritten by the value assigned in step 2.

Expected Behavior

FullThrowRelativePosition should modify Base.FullThrowSettings.RelativePosition, leaving StartTorque unaffected.

Additional Information

Proposed Fix

In LabApi\Features\Wrappers\Items\ThrowableItem.cs

Current code:

public Vector3 FullThrowRelativePosition
{
    get => Base.FullThrowSettings.StartTorque;
    set => Base.FullThrowSettings.StartTorque = value;
}

Proposed fix:

public Vector3 FullThrowRelativePosition
{
    get => Base.FullThrowSettings.RelativePosition;
    set => Base.FullThrowSettings.RelativePosition = value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions