RTD icon indicating copy to clipboard operation
RTD copied to clipboard

Infinite loop by using forward RTD2_Removed if any of the players are still on Bad Sauce on round ends.

Open kelvinthh opened this issue 8 months ago • 2 comments

Bug description

Using forward RTD2_Removed causes infinite loop when someone is still on Bad Sauce and the round ends. Error: Not enough space on the stack 2024-06-10 at 00 07 44@2x The way I reproduce it: sm_forcertd badsauce on everyone then sm_slay one of the teams to end the round. The loop starts right before the new round starts.

  • Version: 2.5.1 and 2.5.5 on SourceMod 1.11 build 6964
  • No custom code across all components including Bad Sauce perk except a few additional custom perks.

Report checks

Please describe the bug in the section above, then post it and tick the correct boxes below.

I run a Freak Fortress 2 Rewrite server and I reapply some attribute changes when RTD effects wear off. Here's a snippet from the plugin calling the RTD2_Removed forward:

public void RTD2_Removed(int client, RTDPerk perk, RTDRemoveReason reason)
{
	if(reason == RTDRemove_WearOff)
	{
		SetEffect(client);     // The function that applies attribute changes to client, it calls TF2_RegeneratePlayer() somewhere.
	}
}

This seems to be something new after the TF2 64bit update. I didn't get back to game server hosting until the last couple of days. I stayed on 2.5.1 for a while before the update and never had any issue.

Required

  • [x] The bug does not have an open issue.
  • [x] I have described the bug.
  • [x] I mentioned whether the bug is sporadic or systematic.

Optional

  • [x] Steps to reproduce the bug are known and have been described.
  • [x] I have access to server error logs and have provided them, if any.
  • [x] I am able to check the RTD version (sm_cvar sm_rtd2_version) and have specified it.
  • [ ] I have access to RTD default configuration file (rtd2_perks.default.cfg) and can confirm it's the one bundled with plugin release archive.
  • [ ] I have access to RTD custom configuration file (rtd2_perks.custom.cfg or other) and have attached it to this issue.
  • [x] The issue is related to a particular perk, which has been specified by a label.

kelvinthh avatar Jun 09 '24 23:06 kelvinthh