Fishing spots cause game to lock (Not Freeze)

I am running in to an issue with fishing zones. I have a few fishing zones that are set to trigger only and their fish caught events are subscribed to a function. Sometimes as soon as I am about to reel in the game locks up, the player can rotate their view but the bobber stays in the water and you cant switch inventory items or move. The menu buttons (End Game, Return to Lobby) also become unresponsive. I thought maybe their is something wrong with my Verse, but I swapped the fish caught event out for a button and I can press it an infinite amount of times without the game locking up. It’s always random how long I can fish before it happens. I’m at a loose here I’d like to say my code is fine considering when I run it from a button instead of the fishing spot caught event everything works exactly and it never locks me into the fishing pose.

If I must, I will create a blank world with just a fishing spot, hook the event with verse, do a simple Print(“Debug”) to screen and see if i can get it to lock.

EDIT: Only thing I can think of is maybe the way I subscribed the events, but then still it is a Verse issue, not sure what is worse.

I Subscribe like so:

FishingZoneHandler := class{
    Device: PlayerHandler
    ZoneLevel : int
    ZoneXP : int
    FishingZoneDevice: fishing_zone_device

    FishCaughtEvent(Agent : agent) : void = {
        Device.HandleZones(Agent, FishingZoneDevice, ZoneLevel)
        Device.AddXP(Agent, ZoneXP, ZoneLevel)
    }

}

#Later in OnBegin()

lvl0Zones := GetCreativeObjectsWithTag(lvl0FishingSpot{})

for(TaggedFishingSpot : lvl0Zones):
    if(FishingZone := fishing_zone_device[TaggedFishingSpot]):
        FishingZone.CaughtEvent.Subscribe(FishingZoneHandler{Device:=Self, ZoneLevel:=0, ZoneXP:=10, FishingZoneDevice:=FishingZone}.FishCaughtEvent)

NO it’s a problem with the fishing spots, I was calling the AddXP function directly from my TestButton. I changed the InteractedWithEvent of the button to:

DebugButton.InteractedWithEvent.Subscribe(FishingZoneHandler{Device:=Self, ZoneLevel:=0, ZoneXP:=10, FishingZoneDevice:=TestFishingZone}.FishCaughtEvent)

Added an:

@editable
TestFishingZone : fishing_zone_device := fishing_zone_device{}

And I can spam away on the button, all the game mechanics work correctly. This only happens when CaughtFish event is triggered from fishing in a fishing zone.

Video Shows player frozen:

Video show spamming button with same exact Verse code being called:

Edit:
Switched handler class function to:

FishCaughtEvent(Agent : agent) : void = {
        Print("Testing Fishing")
        #Device.HandleZones(Agent, FishingZoneDevice, ZoneLevel)
        #Device.AddXP(Agent, ZoneXP, ZoneLevel)
    }

And It still freezes! Hurrah my code is fine, albeit passing a class function to the Subscribe event is questionable. Though Should still work… Will test more, and if I find that is the problem I’m redacting this Thread.

Update Created a new map, removed everything from the handler class:

FishingZoneHandler := class{

    FishCaughtEvent(Agent : agent) : void = {
        Print("Testing Empty")
    }

}
----------------------------------------------------------------------
for(TaggedFishingSpot : lvl0Zones):
            if(FishingZone := fishing_zone_device[TaggedFishingSpot]):
                FishingZone.CaughtEvent.Subscribe(FishingZoneHandler{}.FishCaughtEvent)

Still results in a freeze. Looks as if subscribing an event to a fishing zone using a helper class results in the game client randomly loosing connection to the server.

After more testing I was not able to fix this or find a reasonable work around that doesn’t require me to change how the game mode works. (I need to dynamically set the amount of XP and Level requirement per fishing spot, I will not settle for making a function for every level fishing spot, plus if I can’t pass a reference to the fishing zone then I cant perform the logic that Disables/Enables it to make it “hide” and “respawn”) I’m chalking this up as C++/Verse VM issue. Their is likely other devices that will drop all connected clients from the server if you try to pass a helper class function to Subscribe, Buttons are not effected, but other devices similar to fishing zones COULD potentially cause problems such as the Physics Tree events, or possibly Guard Spawner events.

Bringing this back from the dead because it turns out this does not happen when fishing with a harpoon. I believe the problem has to be a race condition of some sorts. This is just Fortnite speculation for what it is worth, but this is what I think is happening.

Fishing rod is cast, When it hits water the fishing rod bluebrint checks if its touching plain water or a fishing zone device. If the later a reference to the fishing zone is held

A loop and pause alongside a random number are used to poll weather to register a ‘bite’.

Player clicks to reel in fishing rod.

If the conditional statement evaluates to true then the fishing rod blueprint will either give normal loot if in plain water, If in a fishing zone then the blueprint triggers whatever function the fishing zone async is awaiting using the stored reference.

The fishing zone then goes through its bluebrint functions based on device settings, then fires the fish caught event. Meanwhile the fishing rod blueprint is waiting to receive the event so that it can spawn a fish/item on the hook and finish up by playing its reel in animation.

^-- This is where things get messy, hence why when the bug occurs the lure stays in the water and you are stuck in stasis (Fishing Rod places player in stasis for a few frames, then releases after event perhaps which never occurs leaving you stuck?)

The blueprint VM then needs to check if the zone has any subscribed events tied to the fish caught event. In theory it should have an event subscribed from the fishing rod, and one from my verse device.

The VM finds that fishing zone has my verse function subscribed to the event that is taking place and that it needs to call my helper class function. If the events are not handled concurrently it’s possible my function being handled first causes the fishing rod to never see the event fire and it breaks out of its current function never finishing the animation and locking the game (perhaps it doesn’t break out of the function and attempts to read a variable that is null at the time causing a runtime error)

TLDR; Fishing spots / rods can not be trusted and are effected by a bug that is hard to debug. I’ve submited a bug report for this, hopefully more people will run into this and we can get it fixed. I do have a private island pushed that can be used to test this: 7756-0815-9769