Skip to content

Commit 575c80c

Browse files
committed
better YAKEKUSO
1 parent 98f3b9e commit 575c80c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/routing.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ impl Router {
277277
/// TODO: a starにする
278278
/// TODO: 早くなったらvelocity上限あげたい
279279
pub fn get_next_move(&mut self, sx: i32, sy: i32, vx: i32, vy: i32, tx: i32, ty: i32) -> ((i32, i32), i32) {
280+
if !PosVel::new(sx, sy, vx, vy).is_in_valid_area() {
281+
eprintln!("YAKEKUSO");
282+
return ((sx.signum() * (-2), sy.signum() * (-2)), 0)
283+
}
284+
280285
// できればこれが起こるべきではない(外側でこういうパターンに対してケアされているべき)がout of boundsで死ぬよりよい
281286
let sx = clip_pos(sx);
282287
let sy = clip_pos(sy);

0 commit comments

Comments
 (0)