Summary
Getting a concerning amount of these errors
Verse unrecoverable error: ErrRuntime_WeakMapInvalidKey: Invalid key used to access persistent `var` `weak_map`. (Invalid key used to access persistent `var` `weak_map`.) (Callstack unavailable)
Every single one of my weak_maps
is marked <internal>
inside of modules only allowing read / write via <public>
functions that ensure InPlayer.IsActive[]
before doing anything this leads me to believe that IsActive[]
is passing when it should not. Please see the example below.
Module_Example <public> := module:
some_class <public> := class<final><persistable><concrete>:
some_flag <public> : logic = false
some_data <public> : int = 0
var SomeInternalWeakMap <internal> : weak_map(player, some_class) = map{}
GetSomeClass<public>(Agent:agent)<transacts><decides>:some_class=
Player := player[Agent]
Player.IsActive[]
SomeClass := SomeInternalWeakMap[Player]
return SomeClass
UploadSomeClass<public>(Agent:agent, SomeClass:some_class)<transacts><decides>:void=
Player := player[Agent]
Player.IsActive[]
FitsInPlayerMap[SomeClass]
set SomeInternalWeakMap[Player] = SomeClass
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Stability
Steps to Reproduce
Copy Snippet & Publish
Expected Result
Player.IsActive[]
passing not leading to runtime errors
Observed Result
Player.IsActive[]
either passes when it shouldn’t or something is wrong with player
weak_map
’s
Platform(s)
Windows
Island Code
6872-6995-0659
Additional Notes
I am using 3 total player weakmaps, not one them is accessible directly, they all go through the exact same process provided in the snippet.