Before You Report
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
ThrowableItem instance (e.g., by giving a player an HE Grenade).
- Assign a new
Vector3 value to FullThrowRelativePosition (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;
}
Before You Report
Version
1.1.6
Description
In the
ThrowableItemwrapper, theFullThrowRelativePositionproperty incorrectly gets and sets theStartTorquevalue of theFullThrowSettingsinstead of theRelativePosition. This breaks the physics and spawn position logic for full throws of grenades and other throwable items.To Reproduce
ThrowableIteminstance (e.g., by giving a player an HE Grenade).Vector3value toFullThrowRelativePosition(e.g.,throwable.FullThrowRelativePosition = new Vector3(10f, 20f, 30f);).FullThrowStartTorque. It will be overwritten by the value assigned in step 2.Expected Behavior
FullThrowRelativePositionshould modifyBase.FullThrowSettings.RelativePosition, leavingStartTorqueunaffected.Additional Information
Proposed Fix
In
LabApi\Features\Wrappers\Items\ThrowableItem.csCurrent code:
Proposed fix: