Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Summary
Assigning a class member variable using an inline if-statement, when the class instance is stored as a value in a map, will completely break the session.
Steps to Reproduce
- Define this class
MyClass := class:
var MyInt : int = 0
- Put this somewhere
var TestMap : [string]MyClass = map{"Alice" => MyClass{}, "Bob" => MyClass{}, "Charlie" => MyClass{}}
- Put this line in a place that can access TestMap and runs in a creative device
if (set TestMap["Alice"].MyInt = if (1 = 1) {1} else {0}) {}
Expected Result
The variable gets set if the map value exists
Observed Result
Session disconnects and players are kicked to the lobby.
(No verse runtime error)
Platform(s)
Windows 11
Additional Notes
As far as my testing goes this ONLY happened when these conditions are met:
- You are setting a member of the value in the map, not setting the value itself
- You are setting the value with an INLINE if statement. Separating the if statement will make it work.