I had some trouble using the Spawnnotify class to work right, because it totally screwed up in network games. Anyway, I've made the SpawnNotification function a simulated one, and it seemed to have fixed the problem. Now, I was wondering whether this code is safe to use, as it seems rather dangerous to me to replace objects client-side.
I've tested the code for a few seconds, and it seems fine, but I fear it might mess up when there's a weapon the client doesn't know about... Is this safe?
PHP:
simulated event Actor SpawnNotification(Actor A)
{
local Actor B;
if ( A.IsA('Translocator') && BLOwner.bATranslo && !A.IsA('BLTranslocator') )
{
B=Spawn(class'BLTranslocator',A.Owner,A.tag,A.Location, A.Rotation);
if (B!=None)
A.Destroy();
}
B=ReplaceWith(A, "WBalance.BLTranslocator");
if (B!=None)
{
return B;
}
return A;
}
I've tested the code for a few seconds, and it seems fine, but I fear it might mess up when there's a weapon the client doesn't know about... Is this safe?