rustyscreeps/screeps-game-api

Position::find_path_to causes JavaScript syntax error

chlobes opened this issue · 0 comments

any code containing a call to Position::find_path_to causes the javascript generated to be missing a comma before costCallback, giving SyntaxError: Unexpected identifier [main:926:666]. Manually fixing this causes TypeError: $1.search is not a function. example code to cause this error:

use screeps::prelude::*;

fn game_loop() {
  let a = &screeps::game::spawns::values()[0];
  let b = a.room().controller().unwrap();
  let find_ops = FindOptions::new();
  warn!("foo"); //this is printed
  let _path = a.pos().find_path_to(&b, find_ops);
  warn!("bar"); //this is not
}