Skip to content

Commit

Permalink
Update GetDataHandlers.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
hufang360 authored Nov 11, 2022
1 parent c425ff0 commit 5aefdd8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions TShockAPI/GetDataHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2700,16 +2700,6 @@ private static bool HandleSpawn(GetDataHandlerArgs args)
short numberOfDeathsPVE = args.Data.ReadInt16();
short numberOfDeathsPVP = args.Data.ReadInt16();
PlayerSpawnContext context = (PlayerSpawnContext)args.Data.ReadByte();
// When the player spawn into world, the numberOfDeathsPVE and numberOfDeathsPVP is not correct on the SSC Server.
// Send the data agrain fixed them.
if (context == PlayerSpawnContext.SpawningIntoWorld && args.Player.IsLoggedIn )
{
if(numberOfDeathsPVE != args.TPlayer.numberOfDeathsPVE || numberOfDeathsPVP != args.TPlayer.numberOfDeathsPVP)
{
args.Player.Spawn(PlayerSpawnContext.SpawningIntoWorld);
return true;
}
}
if (OnPlayerSpawn(args.Player, args.Data, player, spawnx, spawny, respawnTimer, numberOfDeathsPVE, numberOfDeathsPVP, context))
return true;

Expand Down Expand Up @@ -2746,6 +2736,17 @@ private static bool HandleSpawn(GetDataHandlerArgs args)
args.Player.Dead = true;
else
args.Player.Dead = false;

// When the player spawn into world, the numberOfDeathsPVE and numberOfDeathsPVP is not correct on the SSC Server.
// Send the data agrain fixed them.
if (context == PlayerSpawnContext.SpawningIntoWorld && args.Player.IsLoggedIn )
{
if(numberOfDeathsPVE != args.TPlayer.numberOfDeathsPVE || numberOfDeathsPVP != args.TPlayer.numberOfDeathsPVP)
{
args.Player.Spawn(PlayerSpawnContext.SpawningIntoWorld);
return true;
}
}
return false;
}

Expand Down

0 comments on commit 5aefdd8

Please sign in to comment.