Skip to content

Split is not implemented correctly #55

@Fuco1

Description

@Fuco1
  let mandatory_mod1, mandatory_mod2 =
    let mod1 = Pool.pick pool in
    let mod2 = Pool.pick pool in
    match mod1, mod2 with
      | Some mod1, Some mod2 -> mod1, mod2
      | None, _ | _, None -> fail "cannot split an item with less than two modifiers"
  in
  let other_mods1, other_mods2 =
    List.partition (fun _ -> Random.bool ()) (Pool.to_list pool)

This could create a split with 1 and 4 mods for a 5 mod item. That can't happen. The recipe in game also states

Split an Item Into Two, With Half the Mods on Each Item

So it will be (2 and 3) or (1 and 2) in the odd cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions