In RLCoop we have a custom RLPlayer class, with all sorts of crap going on. One of the functions is a revive function in order to revive a dead player with the SuperHealth item. Now we were using Carcass for this before, but we changed the dying state to sort of simulate death in our own way rather than changing the player to the carcass class in order to have more control over the dying state and reviving and all that.
Problem is, now with reviving, when a player tries to revive a dead player, it disconnects them from the server, and the dead player gets "connection failed" where on the server it just says the left the game. I have a funny feeling there's something out of check, and somewhere a destroy() might be getting called on the playerpawn when being revived? Not sure but, here is the revive function:
Code: Select all
function bool RespawnMe(Actor Carc)
{
local Inventory Inv;
bMovable=True;
SetCollision(True,True,True);
Health=RandRange(10,26);
bHidden=False;
DrawType=DT_Mesh;
ViewTarget=None;
bBehindview=False;
SetBase(Carc.Base);
SetLocation(Carc.Location);
ClientSetLocation(Carc.Location, Carc.Rotation);
StartWalk();
if(Region.Zone.bWaterZone) GoToState('PlayerSwimming');
else { GoToState('PlayerWalking'); FeignDeath(); }
Inv=Spawn(class'rInvHandler');
if(Inv!=None)
{
Inv.GiveTo(Self);
Pickup(Inv).PickupFunction(Self);
} else return false;
Inv=Spawn(class'RLMelee');
if(Inv!=None)
{
Inv.GiveTo(Self);
Weapon(Inv).BringUp();
} else return false;
return true;
}in simulated function GrabDecoration()
Code: Select all
if(Carcass(A)!=None && Carcass(A).bPlayerCarcass)
{
if(FindInventoryType(class'rSuperHealth')!=None && SelectedItem==FindInventoryType(class'rSuperHealth') && !FindInventoryType(class'rSuperHealth').bActive)
{
ForEach AllActors(class'RL_Player',P,A.Tag) if(P.Tag==A.Tag && (P!=Self) && P.Health
