Skip to content

Commit e715f97

Browse files
committed
pass --tier to encounters via put_int, fix run_visual signature
1 parent 9a97539 commit e715f97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pufferlib/ocean/osrs_pvp/osrs_pvp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void replay_free(ReplayFile* rf) {
136136
if (rf) { free(rf->actions); free(rf); }
137137
}
138138

139-
static void run_visual(OsrsPvp* env, const char* encounter_name, const char* replay_path) {
139+
static void run_visual(OsrsPvp* env, const char* encounter_name, const char* replay_path, int gear_tier) {
140140
env->client = NULL;
141141

142142
/* set up encounter if specified, otherwise default to PvP */
@@ -149,6 +149,8 @@ static void run_visual(OsrsPvp* env, const char* encounter_name, const char* rep
149149
env->encounter_def = (void*)edef;
150150
env->encounter_state = edef->create();
151151
edef->put_int(env->encounter_state, "seed", 42);
152+
/* pass gear tier to encounter (--tier flag, default 0) */
153+
if (gear_tier >= 0) edef->put_int(env->encounter_state, "gear_tier", gear_tier);
152154

153155
/* load encounter-specific collision map.
154156
world offset translates encounter-local (0,0) → world coords for cmap lookup.
@@ -490,7 +492,7 @@ int main(int argc, char** argv) {
490492
env.ocean_obs = env._obs_buf;
491493
env.ocean_rew = env.rewards;
492494
env.ocean_term = env.terminals;
493-
run_visual(&env, encounter_name, replay_path);
495+
run_visual(&env, encounter_name, replay_path, gear_tier);
494496
pvp_close(&env);
495497
#else
496498
fprintf(stderr, "not compiled with visual support (use: make visual)\n");

0 commit comments

Comments
 (0)