Skip to content

Commit

Permalink
Fix for not listening for mapLoaded event, trim whitespace from player
Browse files Browse the repository at this point in the history
names
  • Loading branch information
rrgeorge committed Jan 26, 2022
1 parent 5bdf2ff commit 481ba06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ async function connectGameLog(gameId,userId,campaignName) {
let conditions = f.conditions.map(c=>`i-condition-white-${c.name.toLowerCase()}`)
let senses = f.senses.map(s=>`${s.name} ${s.distance}`)
let exhaustion = f.conditions.find(c=>c.name.toLowerCase()=="exhaustion")?.level||0
const token = _eTokens.filter(t=>t.reference.startsWith('/player/')).find(t=>t.name==f.name)
const token = _eTokens.filter(t=>t.reference.startsWith('/player/')).find(t=>t.name.trim()==f.name.trim())
if (token && (token.health != (f.hitPointInfo.current+f.hitPointInfo.temp) || token.hitpoints != f.hitPointInfo.maximum)) {
console.log(`Update ${f.name}`)
const model = {
Expand Down Expand Up @@ -1262,7 +1262,7 @@ function connectEWS(msg=null) {
let token = _eTokens.findIndex(t=>t.id==msg.data.id)
if (token>=0)
_eTokens[token] = msg.data
} else if (msg?.name == 'mapUpdated') {
} else if (msg?.name == 'mapUpdated' || msg?.name == 'mapLoaded') {
getEAPI()
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "encounterlog",
"productName": "EncounterLog",
"version": "2.4.4",
"version": "2.4.5",
"repository": {
"type": "git",
"url": "https://github.com/rrgeorge/encounterlog"
Expand Down

0 comments on commit 481ba06

Please sign in to comment.