Skip to content

Commit 1c906e8

Browse files
comradeshookCauseless
authored andcommitted
Fixed IgnoreTerrain having basically no effect
1 parent 01f1262 commit 1c906e8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3838

3939
- Fixed an issue where a mission-specific keycard item was being bought by the AI.
4040

41+
- Fixed `MovableObject` INI property `IgnoreTerrain` not having any appreciable effect.
42+
4143
</details>
4244

4345
## [Release v6.1.0] - 2024/02/15

Source/System/Atom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ bool Atom::StepForward(int numSteps) {
552552
g_SceneMan.WrapPosition(m_IntPos[X], m_IntPos[Y]);
553553

554554
// Detect terrain hits, if not disabled.
555-
if (g_MaterialAir != (m_TerrainMatHit = g_SceneMan.GetTerrMatter(m_IntPos[X], m_IntPos[Y]))) {
555+
if (g_MaterialAir != (m_TerrainMatHit = g_SceneMan.GetTerrMatter(m_IntPos[X], m_IntPos[Y])) && !m_OwnerMO->m_IgnoreTerrain) {
556556
// Check if we're temporarily disabled from hitting terrain
557557
if (!m_TerrainHitsDisabled) {
558558
m_OwnerMO->SetHitWhatTerrMaterial(m_TerrainMatHit);
@@ -766,7 +766,7 @@ int Atom::Travel(float travelTime, bool autoTravel, bool scenePreLocked) {
766766
// Bresenham's line drawing algorithm execution
767767
for (domSteps = 0; domSteps < delta[dom] && !(hit[X] || hit[Y]); ++domSteps) {
768768
// Check for the special case if the Atom is starting out embedded in terrain. This can happen if something large gets copied to the terrain and embeds some Atoms.
769-
if (domSteps == 0 && g_SceneMan.GetTerrMatter(intPos[X], intPos[Y]) != g_MaterialAir) {
769+
if (domSteps == 0 && !m_OwnerMO->m_IgnoreTerrain && g_SceneMan.GetTerrMatter(intPos[X], intPos[Y]) != g_MaterialAir) {
770770
++hitCount;
771771
hit[X] = hit[Y] = true;
772772
if (g_SceneMan.TryPenetrate(intPos[X], intPos[Y], velocity * mass * sharpness, velocity, retardation, 0.5F, m_NumPenetrations, removeOrphansRadius, removeOrphansMaxArea, removeOrphansRate)) {

0 commit comments

Comments
 (0)