Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Source/CombatExtended/CombatExtended/CollisionVertical.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ private static void CalculateHeightRange(Thing thing, out FloatRange heightRange

if (pawn.Flying)
{
heightAdjust += 0.5f * pawn.flight.PositionOffsetFactor;
heightAdjust += 1;
}


// Humanlikes in combat crouch to reduce their profile
if (pawn.IsCrouching())
{
Expand Down
16 changes: 6 additions & 10 deletions Source/CombatExtended/CombatExtended/LightingTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,12 @@ public float HighestCoverAt(IntVec3 position)
float coverHeight = coverGridCache[CellToIndex(position)];
if (coverHeight == -1)
{
Thing cover = position.GetFirstPawn(map) ?? position.GetCover(map);
if (cover == null)
{
coverHeight = 0;
}
else
{
Bounds bounds = CE_Utility.GetBoundsFor(cover);
coverHeight = bounds.size.y;
}
// separate pawnHeight and coverHeight and keep the higher instead of pawn height XOR cover height.
Thing pawn = position.GetFirstPawn(map);
Thing coverThing = position.GetCover(map);
float pawnHeight = pawn == null ? 0f : CE_Utility.GetBoundsFor(pawn).max.y;
float coverHeightFromThing = coverThing == null ? 0f : CE_Utility.GetBoundsFor(coverThing).max.y;
coverHeight = Mathf.Max(pawnHeight, coverHeightFromThing);
coverGridCache[CellToIndex(position)] = coverHeight;
}
return coverHeight;
Expand Down
Loading