diff --git a/source/simulation2/components/CCmpPosition.cpp b/source/simulation2/components/CCmpPosition.cpp index 25ec626b1b..1c9131a036 100644 --- a/source/simulation2/components/CCmpPosition.cpp +++ b/source/simulation2/components/CCmpPosition.cpp @@ -467,7 +467,7 @@ public: AdvertiseInterpolatedPositionChanges(); } - virtual bool IsFloating() const + virtual bool CanFloat() const { return m_Floating; } diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp index 4f1ff82e8d..d37728993c 100644 --- a/source/simulation2/components/CCmpUnitMotion.cpp +++ b/source/simulation2/components/CCmpUnitMotion.cpp @@ -1771,7 +1771,7 @@ void CCmpUnitMotion::RenderPath(const WaypointPath& path, std::vector cmpPosition(GetEntityHandle()); if (cmpPosition) - floating = cmpPosition->IsFloating(); + floating = cmpPosition->CanFloat(); lines.clear(); std::vector waypointCoords; diff --git a/source/simulation2/components/ICmpPosition.cpp b/source/simulation2/components/ICmpPosition.cpp index af44ae16b1..2d364266d1 100644 --- a/source/simulation2/components/ICmpPosition.cpp +++ b/source/simulation2/components/ICmpPosition.cpp @@ -35,7 +35,7 @@ DEFINE_INTERFACE_METHOD_1("SetHeightFixed", void, ICmpPosition, SetHeightFixed, DEFINE_INTERFACE_METHOD_CONST_0("GetHeightFixed", entity_pos_t, ICmpPosition, GetHeightFixed) DEFINE_INTERFACE_METHOD_CONST_0("IsHeightRelative", bool, ICmpPosition, IsHeightRelative) DEFINE_INTERFACE_METHOD_1("SetHeightRelative", void, ICmpPosition, SetHeightRelative, bool) -DEFINE_INTERFACE_METHOD_CONST_0("IsFloating", bool, ICmpPosition, IsFloating) +DEFINE_INTERFACE_METHOD_CONST_0("CanFloat", bool, ICmpPosition, CanFloat) DEFINE_INTERFACE_METHOD_1("SetFloating", void, ICmpPosition, SetFloating, bool) DEFINE_INTERFACE_METHOD_1("SetConstructionProgress", void, ICmpPosition, SetConstructionProgress, fixed) DEFINE_INTERFACE_METHOD_CONST_0("GetPosition", CFixedVector3D, ICmpPosition, GetPosition) diff --git a/source/simulation2/components/ICmpPosition.h b/source/simulation2/components/ICmpPosition.h index f76b19d89c..19f39aac1e 100644 --- a/source/simulation2/components/ICmpPosition.h +++ b/source/simulation2/components/ICmpPosition.h @@ -137,9 +137,9 @@ public: virtual void SetHeightRelative(bool flag) = 0; /** - * Returns whether the entity floats on water. + * Returns whether the entity can float on water. */ - virtual bool IsFloating() const = 0; + virtual bool CanFloat() const = 0; /** * Set the entity to float on water diff --git a/source/simulation2/components/tests/test_Position.h b/source/simulation2/components/tests/test_Position.h index 7b1f9effc3..78eddbfcd3 100644 --- a/source/simulation2/components/tests/test_Position.h +++ b/source/simulation2/components/tests/test_Position.h @@ -149,7 +149,7 @@ public: // Move into the world, the fixed height uses the water level minus the float depth as a base cmp->JumpTo(entity_pos_t::FromInt(0), entity_pos_t::FromInt(0)); TS_ASSERT(cmp->IsInWorld()); - TS_ASSERT(cmp->IsFloating()); + TS_ASSERT(cmp->CanFloat()); TS_ASSERT_EQUALS(cmp->GetHeightOffset(), entity_pos_t::FromInt(23)); TS_ASSERT_EQUALS(cmp->GetHeightFixed(), entity_pos_t::FromInt(122)); @@ -173,7 +173,7 @@ public: // The entity can't float anymore, the fixed height is computed from the terrain base cmp->SetFloating(false); - TS_ASSERT(!cmp->IsFloating()); + TS_ASSERT(!cmp->CanFloat()); TS_ASSERT_EQUALS(cmp->GetHeightFixed(), entity_pos_t::FromInt(73)); TS_ASSERT_EQUALS(cmp->GetHeightOffset(), entity_pos_t::FromInt(23)); TS_ASSERT_EQUALS(cmp->GetPosition(), fixedvec(100, 73, 200)); @@ -201,7 +201,7 @@ public: // The entity can't float anymore and height is not relative, fixed height doesn't change cmp->SetFloating(false); - TS_ASSERT(!cmp->IsFloating()); + TS_ASSERT(!cmp->CanFloat()); TS_ASSERT_EQUALS(cmp->GetHeightFixed(), entity_pos_t::FromInt(122)); TS_ASSERT_EQUALS(cmp->GetHeightOffset(), entity_pos_t::FromInt(72)); TS_ASSERT_EQUALS(cmp->GetPosition(), fixedvec(100, 122, 200)); diff --git a/source/simulation2/components/tests/test_RangeManager.h b/source/simulation2/components/tests/test_RangeManager.h index 6ddf4d2738..ab60526549 100644 --- a/source/simulation2/components/tests/test_RangeManager.h +++ b/source/simulation2/components/tests/test_RangeManager.h @@ -54,7 +54,7 @@ public: virtual entity_pos_t GetHeightFixed() const { return entity_pos_t::Zero(); } virtual bool IsHeightRelative() const { return true; } virtual void SetHeightRelative(bool UNUSED(relative)) { } - virtual bool IsFloating() const { return false; } + virtual bool CanFloat() const { return false; } virtual void SetFloating(bool UNUSED(flag)) { } virtual void SetActorFloating(bool UNUSED(flag)) { } virtual void SetConstructionProgress(fixed UNUSED(progress)) { } diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp index f4bdeed5db..817f179adf 100644 --- a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp @@ -535,7 +535,7 @@ MESSAGEHANDLER(ObjectPreview) CmpPtr cmpPosition(*g_Game->GetSimulation2(), g_PreviewEntityID); if (cmpPosition) { - CVector3D pos = GetUnitPos(msg->pos, cmpPosition->IsFloating()); + CVector3D pos = GetUnitPos(msg->pos, cmpPosition->CanFloat()); cmpPosition->JumpTo(entity_pos_t::FromFloat(pos.X), entity_pos_t::FromFloat(pos.Z)); float angle; @@ -730,7 +730,7 @@ BEGIN_COMMAND(MoveObjects) CmpPtr cmpPosition(*g_Game->GetSimulation2(), (entity_id_t)msg->pivot); if (cmpPosition && cmpPosition->IsInWorld()) { - pivotFloating = cmpPosition->IsFloating(); + pivotFloating = cmpPosition->CanFloat(); CFixedVector3D pivotFixed = cmpPosition->GetPosition(); pivotPos = CVector3D(pivotFixed.X.ToFloat(), pivotFixed.Y.ToFloat(), pivotFixed.Z.ToFloat()); }