Skip to content

Commit cdb223f

Browse files
committed
Merge branch 'game-engine-sdk-message' into 'master'
[FIX][SDK] Correct sdk when player message is $2 See merge request codingame/game-engine!271
2 parents d4b6b57 + 08c53a9 commit cdb223f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

engine/modules/entities/src/main/resources/view/entity-module/properties.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ export const PROPERTIES = {
105105
let res = ''
106106
let prevIdx = 0
107107
while (match) {
108-
res += value.substring(prevIdx, match.index)
109-
res += globalData.players[+match[1]].name
108+
if (match[1] < globalData.players.length) {
109+
res += value.substring(prevIdx, match.index)
110+
res += globalData.players[+match[1]].name
111+
}
110112
prevIdx = match.index + match[0].length
111113
match = regexp.exec(value)
112114
}

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

Lines changed: 1 addition & 0 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 CSS issues in statement editor preview
10+
- Texts no longer parse nickname tokens for player ids that are out of range
1011

1112
## 3.13.0
1213

0 commit comments

Comments
 (0)