fix: less bugs when dashing to planted weapon
This commit is contained in:
@ -265,7 +265,7 @@ delay_in_seconds = "0.0"
|
||||
[node name="OnDrop" type="Node" parent="StateChart/Root/Actions/Hanging"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../WeaponInHand")
|
||||
event = &"drop"
|
||||
event = &"crouch"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnMantle" type="Node" parent="StateChart/Root/Actions/Hanging"]
|
||||
|
@ -384,9 +384,17 @@ public partial class PlayerController : CharacterBody3D
|
||||
else if (WeaponSystem.PlantedState.Active)
|
||||
{
|
||||
DashSystem.ShouldMantle = false;
|
||||
// Should we try to resolve with mantle?
|
||||
var dashLocation =
|
||||
DashSystem.ComputeDashLocationForPlayerShape(WeaponSystem.PlantLocation, WeaponSystem.PlantNormal);
|
||||
var dashLocation = WeaponSystem.PlantLocation;
|
||||
if (WeaponSystem.IsPlantedInWall())
|
||||
{
|
||||
dashLocation += WeaponSystem.PlantNormal * 0.5f; // Player radius
|
||||
}
|
||||
|
||||
if (WeaponSystem.IsPlantedUnderPlatform())
|
||||
{
|
||||
dashLocation += Vector3.Down * 1f; // Player height
|
||||
}
|
||||
|
||||
DashSystem.PlannedPlayerLocation = dashLocation;
|
||||
}
|
||||
_dashDirection = (DashSystem.PlannedPlayerLocation - GlobalPosition).Normalized();
|
||||
@ -402,7 +410,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
return;
|
||||
}
|
||||
|
||||
GD.Print(WeaponSystem.GlobalRotation);
|
||||
// Store the weapon state before resetting it
|
||||
var isPlantedOnWall = WeaponSystem.IsPlantedInWall();
|
||||
var isPlantedUnderPlatform = WeaponSystem.IsPlantedUnderPlatform();
|
||||
|
Reference in New Issue
Block a user