gd,ld: some LD and some bug fixing that didn't fix the bugs

This commit is contained in:
2025-06-19 13:34:31 +02:00
parent 01d0488d91
commit 21bc3f4724
26 changed files with 385 additions and 51 deletions

View File

@ -256,7 +256,7 @@ public partial class PlayerController : CharacterBody3D
}
public void OnInputDropPressed()
{
_playerState.SendEvent("drop");
_playerState.SendEvent("crouch");
}
///////////////////////////
@ -391,9 +391,11 @@ public partial class PlayerController : CharacterBody3D
return;
}
GD.Print(WeaponSystem.GlobalRotation);
// Store the weapon state before resetting it
var isPlantedOnWall = WeaponSystem.PlantedState.Active
&& (Math.Abs(WeaponSystem.GlobalRotation.X) + Math.Abs(WeaponSystem.GlobalRotation.Z) < 0.3);
var isPlantedOnWall = Math.Abs(WeaponSystem.GlobalRotation.X) + Math.Abs(WeaponSystem.GlobalRotation.Z) < 0.3;
var isPlantedUnderPlatform = WeaponSystem.GlobalRotation.X > 1 && Math.Abs(WeaponSystem.GlobalRotation.Y) > 1;
var shouldDashToPlanted = WeaponSystem.PlantedState.Active && (isPlantedOnWall || isPlantedUnderPlatform);
var isFlying = WeaponSystem.FlyingState.Active;
// Get the weapon back
@ -410,7 +412,7 @@ public partial class PlayerController : CharacterBody3D
return; // In case states aren't exclusives
}
if (isPlantedOnWall)
if (shouldDashToPlanted)
{
_playerState.SendEvent("dash_to_planted");
return; // In case states aren't exclusives