From 132d452c88a69f0991c5ad66113bda09b5f50b00 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 07:23:08 -0400 Subject: [PATCH] CScriptObject: Mark IsEditorProperty() as const This doesn't modify internal member state. --- src/Core/Resource/Script/CScriptObject.cpp | 23 +++++++++++----------- src/Core/Resource/Script/CScriptObject.h | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Core/Resource/Script/CScriptObject.cpp b/src/Core/Resource/Script/CScriptObject.cpp index a7d5e47c..5f4ce01f 100644 --- a/src/Core/Resource/Script/CScriptObject.cpp +++ b/src/Core/Resource/Script/CScriptObject.cpp @@ -79,19 +79,18 @@ void CScriptObject::EvaluateVolume() mVolumeScale = mpTemplate->VolumeScale(this); } -bool CScriptObject::IsEditorProperty(IProperty *pProp) +bool CScriptObject::IsEditorProperty(const IProperty *pProp) const { - return ( (pProp == mInstanceName.Property()) || - (pProp == mPosition.Property()) || - (pProp == mRotation.Property()) || - (pProp == mScale.Property()) || - (pProp == mActive.Property()) || - (pProp == mLightParameters.Property()) || - (pProp->Parent() == mPosition.Property()) || - (pProp->Parent() == mRotation.Property()) || - (pProp->Parent() == mScale.Property()) || - (pProp->Parent() == mLightParameters.Property()) - ); + return pProp == mInstanceName.Property() || + pProp == mPosition.Property() || + pProp == mRotation.Property() || + pProp == mScale.Property() || + pProp == mActive.Property() || + pProp == mLightParameters.Property() || + pProp->Parent() == mPosition.Property() || + pProp->Parent() == mRotation.Property() || + pProp->Parent() == mScale.Property() || + pProp->Parent() == mLightParameters.Property(); } void CScriptObject::SetLayer(CScriptLayer *pLayer, uint32 NewLayerIndex) diff --git a/src/Core/Resource/Script/CScriptObject.h b/src/Core/Resource/Script/CScriptObject.h index 5f315a22..60e88d92 100644 --- a/src/Core/Resource/Script/CScriptObject.h +++ b/src/Core/Resource/Script/CScriptObject.h @@ -72,7 +72,7 @@ public: void EvaluateDisplayAsset(); void EvaluateCollisionModel(); void EvaluateVolume(); - bool IsEditorProperty(IProperty *pProp); + bool IsEditorProperty(const IProperty *pProp) const; void SetLayer(CScriptLayer *pLayer, uint32 NewLayerIndex = UINT32_MAX); uint32 LayerIndex() const; bool HasNearVisibleActivation() const;