Skip to content

Commit e8a38f4

Browse files
fixes NextPratcamChunk (#155)
1 parent 0081b02 commit e8a38f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/DETHRACE/common/pratcam.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#include "pratcam.h"
2+
#include "brender/brender.h"
23
#include "displays.h"
34
#include "errors.h"
45
#include "flicplay.h"
5-
#include "input.h"
66
#include "globvars.h"
77
#include "globvrpb.h"
88
#include "grafdata.h"
99
#include "graphics.h"
10+
#include "harness/trace.h"
11+
#include "input.h"
1012
#include "loading.h"
13+
#include "pd/sys.h"
1114
#include "sound.h"
1215
#include "utility.h"
13-
#include "brender/brender.h"
14-
#include "pd/sys.h"
15-
#include "harness/trace.h"
1616
#include <stdlib.h>
1717

1818
tS3_sound_tag gWhirr_noise = 0;
@@ -208,8 +208,8 @@ void NextPratcamChunk() {
208208
} else {
209209
gLast_pratcam_frame_time = 0;
210210
random_number = IRandomBetween(0, 99);
211-
current_alternative = gPratcam_sequences[gCurrent_pratcam_index].chunks[gCurrent_pratcam_chunk].alternatives;
212211
for (i = 0; i < gPratcam_sequences[gCurrent_pratcam_index].chunks[gCurrent_pratcam_chunk].number_of_alternatives; i++) {
212+
current_alternative = &gPratcam_sequences[gCurrent_pratcam_index].chunks[gCurrent_pratcam_chunk].alternatives[i];
213213
random_number -= current_alternative->chance;
214214
if (random_number <= 0) {
215215
gCurrent_pratcam_alternative = i;
@@ -219,7 +219,7 @@ void NextPratcamChunk() {
219219
if (current_alternative->sound_chance == 0) {
220220
return;
221221
}
222-
if (!PercentageChance(current_alternative->sound_chance) == 0) {
222+
if (!PercentageChance(current_alternative->sound_chance)) {
223223
return;
224224
}
225225
if (gCurrent_pratcam_precedence == 0 && DRS3OutletSoundsPlaying(gDriver_outlet)) {

0 commit comments

Comments
 (0)