Skip to content

Commit fcc3240

Browse files
Merge branch '6328-sdk-duplicate-font-files-in-the-assets-folder-causees-game-to-crash-in-ide' into 'master'
fix(renderer): added duplication checking for font assets See merge request codingame/game-engine!246
2 parents 4cf2125 + b4173a4 commit fcc3240

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

playground/misc/misc-3-release-notes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
77
### 🐞 Bug fix
88

99
- Fixed a small issue with the loading of avatars
10+
- Fixed crashes when the same font asset is included twice
1011

1112
## 3.8.3
1213

@@ -107,8 +108,8 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
107108

108109
### 🐞 Bug fix
109110

110-
- Fixed Tooltip not showing all texts of stacked sprites below the cursor
111-
- Fixed viewer not updating on mouse wheel event
111+
- Fixed Tooltip not showing all texts of stacked sprites below the cursor
112+
- Fixed viewer not updating on mouse wheel event
112113

113114
## 3.4.9
114115

@@ -414,4 +415,4 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
414415

415416
## 1.37 and older versions
416417

417-
These versions are not handled anymore and your game will not work if you upload it on CodinGame. If you are still using this version, it is strongly recommended to update your project to the latest release.
418+
These versions are not handled anymore and your game will not work if you upload it on CodinGame. If you are still using this version, it is strongly recommended to update your project to the latest release.

runner/src/main/java/com/codingame/gameengine/runner/Renderer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ private static void generateAssetsFile(Path tmpdir, String assetsPath) {
255255
newContent = newContent.concat("\n".concat(newLine));
256256
}
257257
String newName = hashAsset(f);
258-
fonts.add(newName);
258+
if (!fonts.contains(new JsonPrimitive(newName))) {
259+
fonts.add(newName);
260+
}
261+
259262
Files.write(
260263
tmpdir.resolve("hashed_assets").resolve(newName),
261264
newContent.getBytes(),

0 commit comments

Comments
 (0)