It looks like you're new here. If you want to get involved, click one of these buttons!
<<for $i to 0; $i lt $knownCities.length; $i++>> <<set $tmp = $knownCities[$i]>> <<if $knownCities[$i].name neq $currentCity.name>> <<click $knownCities[$i].name "TravelTo">> <<set $nextCity = $knownCities[$i]>> <</click>> <</if>> <</for>>Apparently the variable $nextCity gets assigned to undef. Which means that the
<<set $nextCity = $knownCities[$i]>>Part executes with the last $i. What would be a better way to solve this?
Comments
note: I am not at a machine ATM with SugarCube installed so the above was written from memory and has not been tested.