summaryrefslogtreecommitdiff
path: root/src/com/sneed/pkrandom
diff options
context:
space:
mode:
authortom-overton <tom.overton@outlook.com>2022-07-02 17:49:02 -0700
committerrafa_99 <raroma09@gmail.com>2022-07-03 02:01:58 +0100
commitc96c5028316877a8a764da7fdba4b56904e393d5 (patch)
tree0f575078cc136bbf0c5cd10ddb7fb80e4a11a447 /src/com/sneed/pkrandom
parentad294174ced8ef458c874cca2d855f7b9d2987e0 (diff)
Fix issue where Force Fully Evolved could have different results even with the same seed/settings (fixes #476)
Diffstat (limited to 'src/com/sneed/pkrandom')
-rw-r--r--src/com/sneed/pkrandom/Version.java5
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java7
2 files changed, 9 insertions, 3 deletions
diff --git a/src/com/sneed/pkrandom/Version.java b/src/com/sneed/pkrandom/Version.java
index 49a1657..9a1d00a 100644
--- a/src/com/sneed/pkrandom/Version.java
+++ b/src/com/sneed/pkrandom/Version.java
@@ -28,8 +28,8 @@ import java.util.HashMap;
import java.util.Map;
public class Version {
- public static final int VERSION = 319; // Increment by 1 for new version. Updated for 4.5.0-dev
- public static final String VERSION_STRING = "4.5.0-dev";
+ public static final int VERSION = 320; // Increment by 1 for new version. Updated for 4.5.1-dev.
+ public static final String VERSION_STRING = "4.5.1-dev";
public static final Map<Integer,String> oldVersions = setupVersionsMap();
@@ -59,6 +59,7 @@ public class Version {
map.put(316, "4.2.1");
map.put(317, "4.3.0");
map.put(318, "4.4.0");
+ map.put(319, "4.5.0");
// Latest version - when version is updated, add the old version as an explicit put
map.put(VERSION, VERSION_STRING);
diff --git a/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java b/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java
index 3c29e0c..f8f0f21 100755
--- a/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java
+++ b/src/com/sneed/pkrandom/romhandlers/AbstractRomHandler.java
@@ -64,7 +64,7 @@ public abstract class AbstractRomHandler implements RomHandler {
public AbstractRomHandler(Random random, PrintStream logStream) {
this.random = random;
this.cosmeticRandom = RandomSource.cosmeticInstance();
- this.fullyEvolvedRandomSeed = random.nextInt(GlobalConstants.LARGEST_NUMBER_OF_SPLIT_EVOS);
+ this.fullyEvolvedRandomSeed = -1;
this.logStream = logStream;
}
@@ -6698,6 +6698,11 @@ public abstract class AbstractRomHandler implements RomHandler {
}
private Pokemon fullyEvolve(Pokemon pokemon, int trainerIndex) {
+ // If the fullyEvolvedRandomSeed hasn't been set yet, set it here.
+ if (this.fullyEvolvedRandomSeed == -1) {
+ this.fullyEvolvedRandomSeed = random.nextInt(GlobalConstants.LARGEST_NUMBER_OF_SPLIT_EVOS);
+ }
+
Set<Pokemon> seenMons = new HashSet<>();
seenMons.add(pokemon);