[NvCloth] Replace legacy IsDedicated() call with new AZ_CVAR sv_isDedicated
This commit is contained in:
@@ -10,9 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ISystem.h>
|
||||
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Console/Console.h>
|
||||
|
||||
#include <Components/ClothComponent.h>
|
||||
|
||||
@@ -55,10 +54,14 @@ namespace NvCloth
|
||||
void ClothComponent::Activate()
|
||||
{
|
||||
// Cloth components do not run on dedicated servers.
|
||||
AZ_Assert(gEnv, "Environment not ready");
|
||||
if (gEnv->IsDedicated())
|
||||
if (auto* console = AZ::Interface<AZ::IConsole>::Get())
|
||||
{
|
||||
return;
|
||||
bool isDedicated = false;
|
||||
if (const auto result = console->GetCvarValue("sv_isDedicated", isDedicated);
|
||||
result == AZ::GetValueResult::Success && isDedicated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Render::MeshComponentNotificationBus::Handler::BusConnect(GetEntityId());
|
||||
|
||||
Reference in New Issue
Block a user