Skip to content

Commit

Permalink
hits: i64
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Feb 5, 2024
1 parent fc423c5 commit 3114c3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl LoadRemover {

struct HitCounter {
count_dream_falling: bool,
hits: u64,
hits: i64,
last_recoiling: bool,
last_hazard: bool,
last_dead_or_0: bool,
Expand Down Expand Up @@ -403,7 +403,7 @@ impl HitCounter {
if let Some(r) = maybe_recoiling {
if !self.last_recoiling && r {
self.hits += 1;
asr::timer::set_game_time(Duration::seconds(self.hits as i64));
asr::timer::set_game_time(Duration::seconds(self.hits));
asr::timer::set_variable_int("hits", self.hits);
asr::print_message(&format!("hit: {}, from recoiling", self.hits));
}
Expand All @@ -413,7 +413,7 @@ impl HitCounter {
if let Some(h) = maybe_hazard {
if !self.last_hazard && h {
self.hits += 1;
asr::timer::set_game_time(Duration::seconds(self.hits as i64));
asr::timer::set_game_time(Duration::seconds(self.hits));
asr::timer::set_variable_int("hits", self.hits);
asr::print_message(&format!("hit: {}, from hazard", self.hits));
}
Expand All @@ -425,7 +425,7 @@ impl HitCounter {
let d = maybe_dead == Some(true) || (maybe_health == Some(0) && maybe_game_state == Some(GAME_STATE_PLAYING));
if !self.last_dead_or_0 && d {
self.hits += 1;
asr::timer::set_game_time(Duration::seconds(self.hits as i64));
asr::timer::set_game_time(Duration::seconds(self.hits));
asr::timer::set_variable_int("hits", self.hits);
asr::print_message(&format!("hit: {}, from dead", self.hits));
}
Expand All @@ -436,7 +436,7 @@ impl HitCounter {
if let Some(s) = maybe_scene_name {
if maybe_game_state == Some(GAME_STATE_ENTERING_LEVEL) && self.last_exiting_level.as_deref() == Some(&s) && s.starts_with("Dream_") {
self.hits += 1;
asr::timer::set_game_time(Duration::seconds(self.hits as i64));
asr::timer::set_game_time(Duration::seconds(self.hits));
asr::timer::set_variable_int("hits", self.hits);
asr::print_message(&format!("hit: {}, from dream falling", self.hits));
}
Expand Down

0 comments on commit 3114c3e

Please sign in to comment.