Got forced out to pick a different hero after the teammate who just joined the game chose D.Va or Wrecking Ball has chosen on my team during the match in my workshop game

I do need some help, cos during the match in my workshop game, when I was playing as Junkrat, then another teammate who just joined the game chose D.Va or Wrecking Ball, I got forced out to pick another hero, and made Junkrat unable to be chosen again. What’s wrong?

From my share code: ZMMJC

rule("If D.Va is chosen, disable Wrecking Ball (1 mech tank only per team)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"If D.Va is chosen"
		Hero Of(Event Player) == Hero(D.Va);
	}

	actions
	{
		"Wrecking Ball will be disabled"
		Set Player Allowed Heroes(All Players(Team Of(Event Player)), Remove From Array(Allowed Heroes(Event Player), Hero(
			Wrecking Ball)));
	}
}

rule("If Wrecking Ball is chosen, disable D.Va (1 mech tank only per team)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		"If Wrecking Ball is chosen"
		Hero Of(Event Player) == Hero(Wrecking Ball);
	}

	actions
	{
		"D.Va will be disabled"
		Set Player Allowed Heroes(All Players(Team Of(Event Player)), Remove From Array(Allowed Heroes(Event Player), Hero(D.Va)));
	}
}

Those rules look fine imo.

Yeah, this makes little sense to me as well.
‘Junkrat’ isn’t mentioned anywhere, so he shouldn’t have anything to do with it in-game. :thinking:

This is most likely a bug with the array feature itself (or at least the ‘Allowed Heroes’ array). You could try to rephrase the rule in some way or create a player variable, that stores the current player hero availability. That might work.

Because Junkrat is enabled in this workshop game. The only allowed heroes in my workshop game:

TANK (only one per match per team):

  • D.Va
  • Wrecking Ball

DAMAGE:

  • All dmg heroes except Pharah and S76

SUPPORT:

  • Ana
  • Brigitte
  • Lucio
  • Mercy
  • Moira
  • Zenyatta