LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[BUG]: Incorrect property mapping for FullThrowRelativePosition in ThrowableItem

Open efrosim opened this issue 6 months ago • 0 comments

Before You Report

  • [x] 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;
}

efrosim avatar May 14 '26 07:05 efrosim