sandbox icon indicating copy to clipboard operation
sandbox copied to clipboard

`PawnController` constructor is spamming clientside

Open PolSpock opened this issue 1 year ago • 0 comments

Hello,

Describe the bug Like i said in early 2023 on Discord,

On sandbox, if you respawn your Pawn without changing his controller type (so if the controller is based on s&box PawnController code), the clientside constructor of the controller starts to create infinite spam in the console for his constructor.

I know all this stuff is indicated as deprecated but i'm still curious about this issue.

To Reproduce

  1. Download this sandbox game
  2. Add ConCmd.Admin to call Respawn() function
[ConCmd.Admin( "respawn" )]
static void TestRespawn()
{
	if ( ConsoleSystem.Caller.Pawn is SandboxPlayer basePlayer )
	{
		basePlayer.Respawn();
	}
}
  1. Add a Log for the PawnController constructor of the base addon :
public PawnController() {
	Log.Info("PawnController constructor");
}
  1. Start a sandbox game and call 3 times the new respawn command
  2. See that the Clientside constructor for PawnController start to be crazy

Old video on WalkController : https://github.com/Facepunch/sandbox/assets/5229571/d99ddd8a-837b-437e-add4-95c9ef128935

Regards

PolSpock avatar Jul 10 '23 18:07 PolSpock