Summary
Cannot use Await() with the FortRoundManager
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Scene Graph
Steps to Reproduce
- Make a verse scene graph component
- Try to get and await its
RoundStartedevent
Expected Result
Expected Workflow
VerseComponent := class<final_super>(component) {
OnSimulate<override>()<suspends>:void = {
if (FortRoundManager := Self.Entity.GetFortRoundManager[]) {
FortRoundManager.SubscribeRoundStarted.Await() # Waits until round starts
Self.DoWork()
FortRoundManager.SubscribeRoundEnded.Await() # Waits until round ends
}
}
}
Observed Result
Actual Workflow
VerseComponent := class<final_super>(component) {
var _Cancelables:[]cancelable = array {}
OnSimulate<override>()<suspends>:void = {
if (FortRoundManager := Self.Entity.GetFortRoundManager[]) {
set Self._Cancelables += array { FortRoundManager.SubscribeRoundStarted(Self.OnRoundStart) }
set Self._Cancelables += array { FortRoundManager.SubscribeRoundEnded(Self.OnRoundEnd) }
}
}
OnEndSimulation<override>():void = {
for (Cancelable: Self._Cancelables) {
Cancelable.Cancel()
}
}
OnRoundStart()<suspends>:void = {}
OnRoundEnd()<suspends>:void = {}
}
(That’s 171% more code!)
Platform(s)
WIndows 11 - 41.10-CL-55227503
Island Code
N/A