Skip to content

Commit

Permalink
Pathfixesandhealingchanges (#10330)
Browse files Browse the repository at this point in the history
Fix citizens not stepping up correctly
make citizens heal at low saturation still, but at much lower rate
  • Loading branch information
Raycoms committed Dec 8, 2024
1 parent 53ccec7 commit 130f64b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -896,15 +896,15 @@ private void checkHeal()
if (getCitizenData() != null && getHealth() < (getCitizenData().getCitizenDiseaseHandler().isSick() ? getMaxHealth() / 3 : getMaxHealth()) && getLastHurtByMob() == null)
{
final double limitDecrease = getCitizenColonyHandler().getColonyOrRegister().getResearchManager().getResearchEffects().getEffectStrength(SATLIMIT);

final double citizenSaturation = citizenData.getSaturation();
final double healAmount;
if (citizenData.getSaturation() >= FULL_SATURATION + limitDecrease)
if (citizenSaturation >= FULL_SATURATION + limitDecrease)
{
healAmount = 2 * (1.0 + getCitizenColonyHandler().getColonyOrRegister().getResearchManager().getResearchEffects().getEffectStrength(REGENERATION));
}
else if (citizenData.getSaturation() < LOW_SATURATION)
else if (citizenSaturation < LOW_SATURATION)
{
return;
healAmount = 1 * (citizenSaturation / FULL_SATURATION) / 2.0;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ private int handleTargetNotPassable(@Nullable final MNode parent, final int x, f
}

// Check for headroom in the target space
if (!isPassable(x, y + 2, z, false, parent))
if (!isPassable(x, y + 2, z, true, parent))
{
final VoxelShape bb1 = cachedBlockLookup.getBlockState(x, y, z).getCollisionShape(world, tempWorldPos.set(x, y, z));
final VoxelShape bb2 = cachedBlockLookup.getBlockState(x, y + 2, z).getCollisionShape(world, tempWorldPos.set(x, y + 2, z));
Expand All @@ -1420,7 +1420,7 @@ private int handleTargetNotPassable(@Nullable final MNode parent, final int x, f
}

// Check for jump room from the origin space
if (!isPassable(parent.x, parent.y + 2, parent.z, false, parent))
if (!isPassable(parent.x, parent.y + 2, parent.z, true, parent))
{
final VoxelShape bb1 = cachedBlockLookup.getBlockState(x, y, z).getCollisionShape(world, tempWorldPos.set(x, y, z));
final VoxelShape bb2 = cachedBlockLookup.getBlockState(parent.x, parent.y + 2, parent.z).getCollisionShape(world, tempWorldPos.set(parent.x, parent.y + 2, parent.z));
Expand Down

0 comments on commit 130f64b

Please sign in to comment.