Skip to content

Commit

Permalink
Add safeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
wn committed Jan 8, 2021
1 parent 710d9de commit 1f0d753
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions client/graphics/PIXIRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class PIXIRenderer {

updateEntity(update) {
const entity = this.entities.get(update.nid)
entity[update.prop] = update.value
if (entity) {
entity[update.prop] = update.value
}
}

processMessage(message) {
Expand Down Expand Up @@ -103,7 +105,7 @@ class PIXIRenderer {
drawHitscan(x, y, targetX, targetY, color) {
// draws a debug line showing a shot
const graphics = new PIXI.Graphics()
graphics.lineStyle(10, color)
graphics.lineStyle(2, color)
graphics.moveTo(x, y)
graphics.lineTo(targetX, targetY)
this.foreground.addChild(graphics)
Expand Down
4 changes: 1 addition & 3 deletions client/graphics/PlayerCharacter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PlayerCharacter extends PIXI.Container {
}

showMessage(msg) {
this.removeChild(this.messageBubble)
this.messageBubble && this.removeChild(this.messageBubble)

const messageCanvas = new PIXI.Text(msg, {
fontFamily: 'Arial',
Expand Down Expand Up @@ -81,9 +81,7 @@ class PlayerCharacter extends PIXI.Container {
}

update(delta) {
// this.rotation = 0
this.moodFace && this.removeChild(this.moodFace)
// let playerNameText;
let sprite;

if (this.mood === "neutral") {
Expand Down

0 comments on commit 1f0d753

Please sign in to comment.