This is unfortunately intended. Use of session
as a key in a module-scoped var
weak_map
may eventually gain back support for cross-round state (hence the scary “Note: …” part of the doc), but it was removed in 26.10. To protect against a behavior change (when cross-round state is added back), make sure to initialize your state at the beginning of OnBegin
in a creative_device
, e.g.
if:
set GlobalInt[GetSession()] = 0