LabAPI
LabAPI copied to clipboard
[BUG]: Incorrect property mapping for FullThrowRelativePosition in ThrowableItem
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
- Obtain a
ThrowableIteminstance (e.g., by giving a player an HE Grenade). - Assign a new
Vector3value toFullThrowRelativePosition(e.g.,throwable.FullThrowRelativePosition = new Vector3(10f, 20f, 30f);). - 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;
}