Skip to content

Commit

Permalink
cleaner saves fix
Browse files Browse the repository at this point in the history
double spawn on cell fix (?)
  • Loading branch information
Mikhael-Danilov committed Jan 4, 2025
1 parent b73c3bc commit 7417738
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,6 @@ public static String modDataFile() {
return "ModDataFor_"+ModdingMode.activeMod() + ".dat";
}

public static String depthFileForLoad(HeroClass cl, int depth, String levelKind, String levelId) {
String newFormat = depthFileForSave(cl, depth, levelKind, levelId);
if(FileSystem.getInternalStorageFile(newFormat).exists()) {
return newFormat;
}

return Utils.format(levelKind + "_" + _depthFile(cl), depth);
}

public static String depthFileForSave(HeroClass heroClass, int levelDepth, String levelKind, String levelId) {
return Utils.format(levelKind + "_" + levelId + "_" + _depthFile(heroClass), levelDepth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ public static Level loadLevel(Position next) {

DungeonGenerator.loadingLevel(next);

String loadFrom = SaveUtils.depthFileForLoad(heroClass,
String loadFrom = SaveUtils.depthFileForSave(heroClass,
DungeonGenerator.getLevelDepth(levelId),
DungeonGenerator.getLevelKind(levelId),
levelId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.watabou.pixeldungeon.actors.hero.Hero;
import com.watabou.pixeldungeon.actors.mobs.Mob;
import com.watabou.pixeldungeon.levels.Level;
import com.watabou.pixeldungeon.scenes.GameScene;
import com.watabou.pixeldungeon.sprites.CharSprite;
import com.watabou.pixeldungeon.utils.GLog;
import com.watabou.utils.Bundlable;
Expand Down Expand Up @@ -472,6 +471,6 @@ public boolean testAct() {
}

public boolean isOnStage() {
return added && GameScene.isSceneReady();
return added;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ public static String modDataFile() {
return "ModDataFor_"+ModdingMode.activeMod() + ".dat";
}

public static String depthFileForLoad(HeroClass cl, int depth, String levelKind, String levelId) {
return depthFileForSave(cl, depth, levelKind, levelId);
}

public static String depthFileForSave(HeroClass heroClass, int levelDepth, String levelKind, String levelId) {
return Utils.format(levelKind + "_" + levelId + "_" + _depthFile(heroClass), levelDepth);
}
Expand Down

0 comments on commit 7417738

Please sign in to comment.