Summary
On version 38.00 I noticed a change when using some extension functions changed the behavior and failed when they had to succeed.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Blank project
- Create script to test decides
- Play.
Expected Result
function that uses decides to compare values to succeed
Observed Result
function fails
Platform(s)
PC
Additional Notes
Script used for testing:
using { /Verse.org/SceneGraph }
decides_test := class<final_super>(component):
IntArray : []int = {0, 1, 2, 3, 4, 5}
StringArray :[]string = {"a","b","c","d","e"}
OnBeginSimulation<override>():void=
(super:)OnBeginSimulation()
SearchNumber := 3 #it does exist
if(IntArray.Exists[SearchNumber,CompareInts]):
Print("[INT] Value exists")
else:
Print("[INT] Value DOES NOT exists")
SearchString := "c" #it does exist
if(StringArray.Exists[SearchString,CompareStrings]):
Print("[STRING] Value exists")
else:
Print("[STRING] Value DOES NOT exists")
if(IntArray.ExistsNoDecides(SearchNumber,CompareIntsNoDecide)?):
Print("[INT NO DECIDES] Value exists")
else:
Print("[INT NO DECIDES] Value DOES NOT exists")
if(StringArray.ExistsNoDecides(SearchString,CompareStringsNoDecide)?):
Print("[STRING] Value exists")
else:
Print("[STRING] Value DOES NOT exists")
(Input:[]t where t:type).Exists<public>(Element:t, Compare(A:t, B:t)<decides><transacts>:void)<transacts><decides>:void=
for (InputElement : Input):
if (Compare[InputElement, Element]):
true?
false?
CompareStrings<public>(A:string, B:string)<decides><transacts>:void=
A = B
CompareInts<public>(A:int, B:int)<decides><transacts>:void=
A = B
(Input:[]t where t:type).ExistsNoDecides<public>(Element:t, Compare(A:t, B:t)<transacts>:logic)<transacts>:logic=
for (InputElement : Input):
if(Compare(InputElement, Element)?):
return true
return false
CompareIntsNoDecide<public>(A:int, B:int)<transacts>:logic=
if(A = B):
return true
return false
CompareStringsNoDecide<public>(A:string, B:string)<transacts>:logic=
if(A = B):
return true
return false