Skip to content

Commit

Permalink
Remove minimap - fix condition where hole is removed but still attemp…
Browse files Browse the repository at this point in the history
…ted to draw

Remove unused import
  • Loading branch information
brian-nguyen committed Nov 4, 2018
1 parent b663477 commit 33b4aca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions client/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from 'react';
import GameOverModal from './components/GameOverModal';
import WelcomeModal from './components/WelcomeModal';
import { drawGame, drawWalls } from './components/GameObjects';
import Minimap from './components/Minimap';
import Leaderboard from './components/Leaderboard';

import {
Expand Down Expand Up @@ -217,15 +216,6 @@ export default class App extends React.Component {
<div style={styles.canvasContainer}>
<Leaderboard players={this.state.players} />
<canvas id="ctx" style={styles.canvas} display="inline" width={window.innerWidth - 20} height={window.innerHeight - 20} margin={0} />
{
this.state.showMiniMap &&
<Minimap
arena={this.state.arena}
junk={this.state.junk}
players={this.state.players}
holes={this.state.holes}
/>
}
{
this.state.showWelcomeModal &&
<WelcomeModal
Expand Down
2 changes: 1 addition & 1 deletion client/components/GameObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function drawGame(data, canvas) {
});

const holes = data.holes.map((h) => {
if (!h.position) {
if (!h || !h.position) {
return {
position: { x: 0, y: 0 },
radius: 0,
Expand Down

0 comments on commit 33b4aca

Please sign in to comment.