Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goldport doesn't split after death #34

Open
Eein opened this issue Nov 30, 2022 · 0 comments
Open

Goldport doesn't split after death #34

Eein opened this issue Nov 30, 2022 · 0 comments

Comments

@Eein
Copy link
Owner

Eein commented Nov 30, 2022

may be a weird state issue

Replicate: Die before entering goldport, then enter goldport

Notes:

  • check current.zoneId and old.zoneId for hints
  • there may be a old.zoneId equal to zero (bad pointer potentially) that causes this issue.

we optimize the looping by:

  // Enter & Exit Area
  if (old.zoneID != current.zoneID && old.zoneID != 0) {
    // Enter Area
    if (vars.AreaZoneIDs.ContainsKey(current.zoneID) && current.gameState == 2 && old.gameState == 2 && vars.Split("enter_" + current.zoneID)) {
      return true;
    }
    // Exit Area
    if (vars.AreaZoneIDs.ContainsKey(old.zoneID) && (old.gameState == 2 || old.gameState == 4) && vars.Split("exit_" + old.zoneID)) {
      return true;
    }
  }

on the wasm splitter it does not do this as i've deoptimized this:

    if SHRINES.contains_key(&vars.zone_id.current)
        && vars.game_state.current == 5
        && vars.game_state.old == 2
    {
        if let Some(shrine) = SHRINES.get(&vars.zone_id.current) {
            let key = format!("get_{}", vars.name_to_key(&shrine));
            return vars.split(&key);
        }
    }

    // Advanced Job Fights
    if ADVANCED_JOB_FIGHTS.contains_key(&vars.zone_id.current)
        && vars.game_state.current == 5
        && vars.game_state.old == 6
    {
        if let Some(advanced_job) = ADVANCED_JOB_FIGHTS.get(&vars.zone_id.current) {
            let key = format!("advanced_job_fight_{}", vars.name_to_key(&advanced_job));
            return vars.split(&key);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant