Because GrantItemIndex() is <no_rollback>
you can’t make your method <decides>
, even though it would make sense, I don’t think it’s possible as of v32.00, they’re making changes to the specifiers though
What you can do for now is either trigger an event
when the roll succeeds or make the method return a logic
Logic method
RollItem(Agent: agent):logic=
Granter := GetGranter()
if (false?):
Granter.GrantItem(Agent)
true
else:
false
Test(Agent: agent)<suspends>:void=
DidRoll := RollItem(Agent)
if(DidRoll?):
# Roll Succeeded
Event method
RollSucceededEvent : event(agent) = event(agent){}
RollItem(Agent: agent):void=
Granter := GetGranter()
if (false?):
Granter.GrantItem(Agent)
RollSucceededEvent.Signal(Agent)
OnBegin()<suspends>:void=
loop:
Agent := RollSucceededEvent.Await()
# Roll Succeeded