Skip to content

Commit

Permalink
Remove need for fmt module
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jul 6, 2024
1 parent f211c96 commit 72a076a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rl_ball_sym::{Ball, Game, Vec3A};
use std::sync::RwLock;
use std::{io::{stdout, Write}, sync::RwLock};

const TPS: usize = 120;
const DT: f32 = 1.0 / TPS as f32;
Expand Down Expand Up @@ -113,7 +113,11 @@ pub extern "C" fn step(current_ball: BallSlice) -> BallSlice {
let state = GAME_AND_BALL.read().unwrap();

let Some(game) = state.game.as_ref() else {
println!("Warning: No game loaded");
let out = stdout();
let mut handle = out.lock();
handle.write_all(b"Warning: No game loaded\n").unwrap();
handle.flush().unwrap();

return BallSlice::default();
};

Expand Down

0 comments on commit 72a076a

Please sign in to comment.