clippy
This commit is contained in:
@@ -163,7 +163,7 @@ impl GameState {
|
||||
/// the game is about to start — never during map deserialization, since a script
|
||||
/// may inspect the board.
|
||||
pub fn run_init(&mut self) {
|
||||
self.scripts.run_init(ScriptState::from_game_state(&self));
|
||||
self.scripts.run_init(ScriptState::from_game_state(self));
|
||||
self.resolve();
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ impl GameState {
|
||||
// this runs exactly once per player interaction with a scroll.
|
||||
self.handle_scroll();
|
||||
let secs = dt.as_secs_f64();
|
||||
self.scripts.run_tick(ScriptState::from_game_state(&self), secs);
|
||||
self.scripts.run_tick(ScriptState::from_game_state(self), secs);
|
||||
// Expire speech bubbles before resolving new actions so a fresh say()
|
||||
// this frame isn't immediately culled.
|
||||
self.speech_bubbles.retain_mut(|b| {
|
||||
@@ -370,7 +370,7 @@ impl GameState {
|
||||
if let Some(scroll) = self.active_scroll.take()
|
||||
&& let Some(choice) = scroll.choice
|
||||
{
|
||||
self.scripts.run_send(ScriptState::from_game_state(&self), scroll.source, &choice, SendArg::None);
|
||||
self.scripts.run_send(ScriptState::from_game_state(self), scroll.source, &choice, SendArg::None);
|
||||
self.drain_errors();
|
||||
}
|
||||
}
|
||||
@@ -437,7 +437,7 @@ impl GameState {
|
||||
{
|
||||
let (dx, dy): (i64, i64) = dir.into();
|
||||
let mut board = self.board_mut();
|
||||
let target = (board.player.x as i64 + dx, board.player.y as i64 + dy);
|
||||
let target = (board.player.x + dx, board.player.y + dy);
|
||||
if !board.in_bounds(target) {
|
||||
return;
|
||||
}
|
||||
@@ -476,7 +476,7 @@ impl GameState {
|
||||
}
|
||||
// Fire the grab hook and resolve it immediately so the grabbed thing's
|
||||
// die()/add_gems() apply now — no player+object overlap survives this call.
|
||||
let state = ScriptState::from_game_state(&self);
|
||||
let state = ScriptState::from_game_state(self);
|
||||
if let Some(id) = grabbed {
|
||||
self.scripts.run_grab(state.clone(), id);
|
||||
self.resolve();
|
||||
|
||||
Reference in New Issue
Block a user