Skip to content

Fix displayplayers.iterate hang when multiple viewports view the same player

Summary

Fixes displayplayers.iterate (and iterate()) causing a permanent hang when viewing the same player through multiple viewports. The function lib_iterateDisplayplayers, which handles the iterator, has been rewritten to remove the workaround used, cycling through the display players as it should.

Testing

Demonstration:

ringracers0623

I used a script, iterateplayersfix.lua, that does the following:

  • Runs a ThinkFrame that iterates through displayplayers every frame (unless iteratetest2 is set to Off).
  • Has a command, iteratetest, which runs the displayplayers iterator once, but using the function call version instead.

I took a replay of a normal bot game, and then went to Egg TV, played it, and set at least two viewports to be the same player. With the script running in 2.3, this would crash, but not in this branch.

Changelog

  • Lua: Fixed displayplayers.iterate causing a hang when multiple viewports view the same player.

Merge request reports

Loading