Skip to content

Commit

Permalink
Merge pull request #3112 from CombatExtended-Continued/cherry-pick-sh…
Browse files Browse the repository at this point in the history
…adows

Cherry pick draw fixes from 1.4 backports
  • Loading branch information
N7Huntsman authored May 1, 2024
2 parents e672d1e + 43a24b5 commit 27425c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Source/CombatExtended/CombatExtended/Comps/CompFragments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ static CompFragments()

public static IEnumerator FragRoutine(Vector3 pos, Map map, float height, Thing instigator, ThingDefCountClass frag, float fragSpeedFactor, float fragShadowChance, FloatRange fragAngleRange, FloatRange fragXZAngleRange, float minCollisionDistance = 0f, bool canTargetSelf = true)
{
if (height < 0.001f)
{
height = 0.001f;
}
var cell = pos.ToIntVec3();
var exactOrigin = new Vector2(pos.x, pos.z);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ public override Vector3 DrawPos
{
get
{
return ExactPosition + new Vector3(0, 0, ExactPosition.y - shotHeight);
var sh = Mathf.Max(0f, (ExactPosition.y) * 0.84f);
return new Vector3(ExactPosition.x, def.Altitude, ExactPosition.z + sh);
}
}

Expand Down Expand Up @@ -1224,8 +1225,8 @@ public override void DrawAt(Vector3 drawLoc, bool flip = false)
{
//TODO : EXPERIMENTAL Add edifice height
var shadowPos = new Vector3(ExactPosition.x,
0,
ExactPosition.z);
def.Altitude - 0.001f,
ExactPosition.z - Mathf.Max(0f, ExactPosition.y));
//EXPERIMENTAL: + (new CollisionVertical(ExactPosition.ToIntVec3().GetEdifice(Map))).Max);

//TODO : Vary ShadowMat plane
Expand Down

0 comments on commit 27425c3

Please sign in to comment.