From a80838b2df7033fa9a2bdf6374c5139179118321 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 Apr 2020 00:26:32 -0400 Subject: [PATCH] CActorModelParticles: Don't cast away const in SetupHook() Now that we have a non-const overload, we don't need to cast away const any longer, removing a cast-qual warning. --- Runtime/World/CActorModelParticles.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Runtime/World/CActorModelParticles.cpp b/Runtime/World/CActorModelParticles.cpp index d9fe51a7c..ef9c22117 100644 --- a/Runtime/World/CActorModelParticles.cpp +++ b/Runtime/World/CActorModelParticles.cpp @@ -523,9 +523,13 @@ void CActorModelParticles::PointGenerator(void* ctx, } void CActorModelParticles::SetupHook(TUniqueId uid) { - auto search = FindSystem(uid); - if (search != x0_items.cend()) - CSkinnedModel::SetPointGeneratorFunc((void*)&*search, PointGenerator); + const auto search = FindSystem(uid); + + if (search == x0_items.cend()) { + return; + } + + CSkinnedModel::SetPointGeneratorFunc(&*search, PointGenerator); } std::list::iterator CActorModelParticles::FindSystem(TUniqueId uid) {