Skip to content

Commit

Permalink
better YAKEKUSO
Browse files Browse the repository at this point in the history
  • Loading branch information
iwiwi committed Jul 20, 2020
1 parent 98f3b9e commit 575c80c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ impl Router {
/// TODO: a starにする
/// TODO: 早くなったらvelocity上限あげたい
pub fn get_next_move(&mut self, sx: i32, sy: i32, vx: i32, vy: i32, tx: i32, ty: i32) -> ((i32, i32), i32) {
if !PosVel::new(sx, sy, vx, vy).is_in_valid_area() {
eprintln!("YAKEKUSO");
return ((sx.signum() * (-2), sy.signum() * (-2)), 0)
}

// できればこれが起こるべきではない(外側でこういうパターンに対してケアされているべき)がout of boundsで死ぬよりよい
let sx = clip_pos(sx);
let sy = clip_pos(sy);
Expand Down

0 comments on commit 575c80c

Please sign in to comment.