# MAJOR Pushing verse changes crashes verse when using weak\_map

**URL:** <https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [September 10, 2023, 8:32pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420 "2023-09-10T20:32:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FinestCreative](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/finestcreative/32/1034971_2.png) [@FinestCreative](https://forums.unrealengine.com/u/FinestCreative)\
**Post date:** [September 10, 2023, 8:32pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/1 "2023-09-10T20:32:54Z")

</div>

### Please select what you are reporting on:

Unreal Editor for Fortnite

### What Type of Bug are you experiencing?

Verse

### Summary

It seems weak\_map does not allow to save things containing a class. It yields this error LogVerse: Error: VerseRuntimeErrors: Internal error encountered. This happens when pushing verse changes, and not when pushing all changes. The problem happens when I try to acces the Team in playerdata as it prints “a” but never “b” see video. For now I would have to use a workaround that does not use the playerdata class but rather a build in datatype like int, to save my team

### Steps to Reproduce

1. Use this code in a verse file:

```auto
using { /Verse.org/Simulation }
playerdata := class():
    var Team:int = -1

var<public> PlayerData:weak_map(session,[agent]playerdata) = map{}
UpdateTeam(Agent:agent,Team:int):void={
    if (var Current:[agent]playerdata = PlayerData[GetSession()]):
        Print("a")
        if(set Current[Agent].Team = Team){
            Print("b")}
        else:
            Print("c")
            if(set Current[Agent] = playerdata{Team:=Team}){}

        if(set PlayerData[GetSession()] = Current){}
    else:
        if(set PlayerData[GetSession()] = map{Agent => playerdata{Team:=Team}}){}
}

```

1. Create a verse device with this code:

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

testdevice := class(creative_device):
    OnBegin<override>()<suspends>:void=
        Print(" ")
        Print(" NEW ROUND ")
        Print(" ")
        for(Agent:Self.GetPlayspace().GetPlayers()):
            Print("Attempt update team")
            UpdateTeam(Agent,2)
            Print("Updated team")

```

1. Link a button to end the round via round settings device
2. In island settings change round limit to anything higher than 1, for example 2.
3. Push changes and go in live edit
4. Build verse code and PUSH VERSE CHANGES
5. Start game
6. End the round via button
7. In the new round verse crashes at this part: `if(set Current[Agent].Team = Team)`

### Expected Result

Verse does not crash

### Observed Result

Verse crashes

### Platform(s)

PC

### Additional Notes

There were no compile errors or anything

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/1/23180c79de4a81205b1eb4b0ab04f726663a5dbe.png)  
Repro:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/e/22ebe766c0c667ef5c9c5936b0967ef9463ec61e.jpeg "verse crash bug") ](https://www.youtube.com/watch?v=iyW2BAdOVVY)

Please look into this, took me half a day to find what was wrong and make this bug report

---

<div class="post-metadata">

**Author:** ![UltimateLambda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ultimatelambda/32/916183_2.png) [@UltimateLambda](https://forums.unrealengine.com/u/UltimateLambda)\
**Post date:** [September 11, 2023, 2:18pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/2 "2023-09-11T14:18:40Z")

</div>

This has been fixed in 26.10.

---

<div class="post-metadata">

**Author:** ![FinestCreative](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/finestcreative/32/1034971_2.png) [@FinestCreative](https://forums.unrealengine.com/u/FinestCreative)\
**Post date:** [September 11, 2023, 6:42pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/3 "2023-09-11T18:42:56Z")

</div>

> [@UltimateLambda](#):
>
> 26.10

Thanks Lambda 🙀

---

<div class="post-metadata">

**Author:** ![FinestCreative](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/finestcreative/32/1034971_2.png) [@FinestCreative](https://forums.unrealengine.com/u/FinestCreative)\
**Post date:** [September 12, 2023, 1:56pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/4 "2023-09-12T13:56:41Z")

</div>

weak\_map is completely broken, it no longer saves in between rounds, rendering them useless. In the next round all weak\_maps are empty again. is this a known issue? It even happens in public games too

---

<div class="post-metadata">

**Author:** ![DDDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DDDev](https://forums.unrealengine.com/u/DDDev)\
**Post date:** [September 12, 2023, 3:00pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/5 "2023-09-12T15:00:29Z")

</div>

I can confirm this, weak\_map no longer works and this is a game breaking bug for already uploaded, and presumably live, games.

---

<div class="post-metadata">

**Author:** ![FinestCreative](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/finestcreative/32/1034971_2.png) [@FinestCreative](https://forums.unrealengine.com/u/FinestCreative)\
**Post date:** [September 12, 2023, 3:45pm UTC](https://forums.unrealengine.com/t/major-pushing-verse-changes-crashes-verse-when-using-weak-map/1290420/6 "2023-09-12T15:45:04Z")

</div>

> [@MAJOR weak\_map GetSession() broken in 26.10](https://forums.unrealengine.com/t/major-weak-map-getsession-broken-in-26-10/1292369):
>
> Please select what you are reporting on: Unreal Editor for Fortnite What Type of Bug are you experiencing? Verse Summary weak\_map GetSession() broken in 26.10. when I use the weak\_map setup to save an int in between rounds it no longer works, it does not save. See video Steps to Reproduce See video for code or see here, the button I press ends the round: verse file 1: using { /Verse.org/Simulation } var GlobalInt:weak\_map(session,int) = map{} Func():void={ if(A := GlobalInt[GetSession(…
