fian46 / addons-btree

Visual Behavior Tree
MIT License
116 stars 19 forks source link

Invalid range checking causes unreachable code in runtime.gd #64

Open belzecue opened 1 year ago

belzecue commented 1 year ago

if idx < 0 and idx >= params.size():

This is found in each of the three get_params function in runtime.gd. The dependent code never runs because if idx = -1 (or lower) then it cannot also be >= 0 (or higher).

I believe the line should be:

if idx < 0 or idx >= params.size():

fian46 commented 1 year ago

i think you are correct. some code are pretty old and writing in hurry. pull request are welcome ; )