As I see, it is completely safe operation for network play.
Opposite is not true of course.
If bStatic or bNoDelete default values is true, you need subclass Actor and set it to False.
Explanation why
Why?
Because when map start, on client all actors without bStatic or bNoDelete will be delete.
https://github.com/TheBearProject/Unrea ... e.cpp#L715
So your actor with overridden bStatic or bNoDelete will be deleted for be spawned on runtime by server send.
So when actor become relevant to client, server send it to client for spawn local copy.
https://github.com/TheBearProject/Unrea ... ct.cpp#L19
But because of this check, spawn on client failed and network play is broken.
Because when map start, on client all actors without bStatic or bNoDelete will be delete.
https://github.com/TheBearProject/Unrea ... e.cpp#L715
Code: Select all
// Handle network issues.
if( !GLevel->IsServer() )
{
// Kill off actors that aren't interesting to the client.
for( INT i=0; i<GLevel->Num(); i++ )
{
AActor* Actor = GLevel->Actors(i);
if( Actor )
{
if( Actor->bStatic || Actor->bNoDelete )
Exchange( Actor->Role, Actor->RemoteRole );
else
GLevel->DestroyActor( Actor );
}
}
}
So when actor become relevant to client, server send it to client for spawn local copy.
https://github.com/TheBearProject/Unrea ... ct.cpp#L19
Code: Select all
//
// Create a new actor. Returns the new actor, or NULL if failure.
//
AActor* ULevel::SpawnActor
(
Code: Select all
else if( !GIsEditor && (Class->GetDefaultActor()->bStatic || Class->GetDefaultActor()->bNoDelete) )
{
debugf( NAME_Warning, "SpawnActor failed because class %s has bStatic or bNoDelete", Class->GetName() );
return NULL;
}
1. Actor not deleted on map start on client.
2. Actor exists on server with same state of bStatic or bNoDelete.
3. Nothing prevent work network play as it must be.
So why all fear override bStatic or bNoDelete from default value False to True?