Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
Assets
Summary
In a piece of code that does not have a infinite loop error I received a infinite loop error
Verse unrecoverable error: ErrRuntime_InfiniteLoop: The runtime terminated prematurely because Verse code was running in an infinite loop.
Truncated callstack follows:
task_game_controller?ice$TrackElimination(:custom_player):Update (Unknown source) (Source: Unknown(0,0, 0,0))
Steps to Reproduce
this is the offending function
Define a function TrackElimination that takes a custom player object and tracks player eliminations.
TrackElimination(Player: custom_player) <suspends>: void =
race: # Execute concurrently
block:
Sleep(0.0)
if (FortChar := Player.GetFortCharacter[]): # Check if the player has a Fort Character
loop: # Continue looping until a condition is met
Result: elimination_result = FortChar.EliminatedEvent().Await() # Wait for elimination event to occur
if (Instigator := FortCharGetCustomPlayer[fort_character[Result.EliminatingCharacter?]]): # Check if the eliminator is a valid player
Struct := eliminated_struct{EliminatedCharacter := Player, EliminatingCharacter := option{Instigator}}
TrackEliminationEvent.Signal(Struct) # Signal elimination event
Instigator.EliminationEvent.Signal(Struct) # Signal elimination event for the instigator
Player.EliminatedEvent.Signal(Struct) # Signal elimination event for the eliminated player
else:
Struct :=eliminated_struct{EliminatedCharacter := Player, EliminatingCharacter := false}
TrackEliminationEvent.Signal(Struct) # Signal elimination event with no valid eliminator
Player.EliminatedEvent.Signal(Struct) # Signal elimination event for the eliminated player
Print("Eliminated")
if (Player.IsAI?): # Check if the eliminated target is not AI
PlayerRemoved(Player.Agent)
else:
spawn{Respawn(Player)} # Respawn the eliminated target
else:
Sleep(Inf)
block:
Player.LeftEvent.Await() # Wait for a player to leave the game
#--------------------------------------------------------------------------------
Expected Result
no infinite loop should occur
Observed Result
a infinite loop occurs and crashes verse making the map unplayable
Platform(s)
All
Island Code
3683-6444-2659
2 posts - 2 participants