Skip to content

Commit 3a8f662

Browse files
Count practice mode level time from level load, not player spawn
1 parent 5d81f61 commit 3a8f662

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/classic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ Player::Player(int x, int y) : Object(x, y) {
134134
type = PLAYER;
135135
create_hair(this);
136136
player = this;
137-
practice_on_player_spawn();
138137
}
139138

140139
Player::~Player() {
@@ -1279,6 +1278,8 @@ void load_room(uint8_t x, uint8_t y) {
12791278
if(!is_title()) {
12801279
new RoomTitle(0, 0);
12811280
}
1281+
1282+
practice_on_load();
12821283
}
12831284

12841285
// update function //

src/practice.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void practice_update() {
2323
}
2424
}
2525
if(!practice_mode) return;
26-
if(player && level_index() != 30) current_time++;
26+
if(level_index() != 30) current_time++;
2727
if(kb_IsDown(kb_KeyYequ)) {
2828
// while(kb_IsDown(kb_KeyYequ));
2929
prev_room();
@@ -51,7 +51,7 @@ void practice_update() {
5151
}
5252
}
5353

54-
void practice_on_player_spawn() {
54+
void practice_on_load() {
5555
current_time = 0;
5656
}
5757

src/practice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
extern bool practice_mode;
44

55
void practice_update();
6-
void practice_on_player_spawn();
6+
void practice_on_load();
77
void practice_on_complete();
88
void practice_draw_hud();
99
int practice_get_total_time();

0 commit comments

Comments
 (0)