diff --git a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs index 4a8694a3..4768d20b 100644 --- a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs +++ b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Projectiles/Projectile.cs @@ -239,15 +239,9 @@ public float CheckHits() if (RemainingImpacts > 0) { - Stopwatch sw = Stopwatch.StartNew(); - - //List> intersects = new List>(); List intersects = new List(); MyAPIGateway.Physics.CastRay(Position, NextMoveStep, intersects); - //LineD ray = new LineD(Position, NextMoveStep); - //MyGamePruningStructure.GetTopmostEntitiesOverlappingRay(ref ray, intersects); // TODO: This is causing problems with hitting own grid - foreach (var hitInfo in intersects) { if (RemainingImpacts <= 0) @@ -272,11 +266,6 @@ public float CheckHits() RemainingImpacts--; } - - sw.Stop(); - - if (MyAPIGateway.Input.IsKeyPress(VRage.Input.MyKeys.Shift)) - HeartData.I.Log.Log("T: " + sw.ElapsedTicks); } if (RemainingImpacts <= 0) diff --git a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/SorterWeaponLogic.cs b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/SorterWeaponLogic.cs index 531bf594..a26e17d0 100644 --- a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/SorterWeaponLogic.cs +++ b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/SorterWeaponLogic.cs @@ -135,10 +135,11 @@ private bool HasLineOfSight() if (!Definition.Hardpoint.LineOfSightCheck) // Ignore if LoS check is disabled return true; - List intersects = new List(); - MyAPIGateway.Physics.CastRay(MuzzleMatrix.Translation, MuzzleMatrix.Translation + MuzzleMatrix.Forward * GridCheckRange, intersects); + List intersects = new List(); + SorterWep.CubeGrid.RayCastCells(MuzzleMatrix.Translation, MuzzleMatrix.Translation + MuzzleMatrix.Forward * GridCheckRange, intersects); + foreach (var intersect in intersects) - if (intersect.HitEntity.EntityId == SorterWep.CubeGrid.EntityId) + if (intersect != SorterWep.Position && SorterWep.CubeGrid.CubeExists(intersect)) return false; return true; } diff --git a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/WeaponLogic_Magazines.cs b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/WeaponLogic_Magazines.cs index 8fc701f5..4edc9bc3 100644 --- a/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/WeaponLogic_Magazines.cs +++ b/Orrery Combat Framework - Heart Module/Data/Scripts/HeartModule/Weapons/WeaponLogic_Magazines.cs @@ -116,14 +116,15 @@ public void UpdateReload() else { // Notify item not available - MyVisualScriptLogicProvider.ShowNotification($"Unable to reload - {magazineItem} not found in inventory.", 1000 / 60, "Red"); + //MyVisualScriptLogicProvider.ShowNotification($"Unable to reload - {magazineItem} not found in inventory.", 1000 / 60, "Red"); return; } } else { // Notify when MagazineItemToConsume is not specified - MyVisualScriptLogicProvider.ShowNotification("MagazineItemToConsume not specified, proceeding with default reload behavior.", 1000 / 60, "Blue"); + // TODO: Note in debug log + //MyVisualScriptLogicProvider.ShowNotification("MagazineItemToConsume not specified, proceeding with default reload behavior.", 1000 / 60, "Blue"); } MagazinesLoaded++; diff --git a/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleAmmos.cs b/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleAmmos.cs index c8f84ff8..0ef23506 100644 --- a/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleAmmos.cs +++ b/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleAmmos.cs @@ -208,7 +208,7 @@ partial class HeartDefinitions TrailWidth = 0.5f, TrailColor = new VRageMath.Vector4(61, 24, 24, 200), //AttachedParticle = "Smoke_Missile", - ImpactParticle = "MaterialHit_Metal", + ImpactParticle = "", VisibleChance = 1f, }, Audio = new Audio() @@ -216,7 +216,7 @@ partial class HeartDefinitions TravelSound = "", TravelVolume = 100, TravelMaxDistance = 1000, - ImpactSound = "WepSmallWarheadExpl", + ImpactSound = "", SoundChance = 0.1f, }, Guidance = new Guidance[] diff --git a/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleFixedBeamWeapon.cs b/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleFixedBeamWeapon.cs index 73f7bc32..618fd351 100644 --- a/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleFixedBeamWeapon.cs +++ b/OrreryFrameworkDemo/Data/Scripts/OrreryFrameworkDemo/ExampleFixedBeamWeapon.cs @@ -67,7 +67,7 @@ partial class HeartDefinitions }, Visuals = new Visuals() { - ShootParticle = "Muzzle_Flash_Autocannon", + ShootParticle = "", ContinuousShootParticle = false, ReloadParticle = "", },