forked from phenom/healer-man
updated the dungeon loading so it doesnt fail first try
This commit is contained in:
1 parent
e39aebf3a1
commit
7e60864e70
11 files changed
+383
-69
No files matched your search
@@ -0,0 +1,14 @@
|
||||
export const DUNGEON_VISUAL_LOAD_BATCH_SIZE = 1;
|
||||
export const DUNGEON_COLLISION_LOAD_BATCH_SIZE = 4;
|
||||
|
||||
/** Advances a staged asset window without overshooting the available files. */
|
||||
export function advanceDungeonAssetCount(
|
||||
loaded: number,
|
||||
total: number,
|
||||
batchSize: number,
|
||||
): number {
|
||||
const safeLoaded = Math.max(0, Math.trunc(loaded));
|
||||
const safeTotal = Math.max(0, Math.trunc(total));
|
||||
const safeBatchSize = Math.max(1, Math.trunc(batchSize));
|
||||
return Math.min(safeTotal, safeLoaded + safeBatchSize);
|
||||
}
|
||||
Reference in new issue
Block a user