Commit 135ec7b4 authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Fix creation of "undefined" boid

parent 21cbe74c
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.38",
version: "0.0.39",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -173,17 +173,18 @@ let PresenceSketch = {
addBoids(joins) {
_.each(joins, function(val, name) {
console.log("adding " + name);
PresenceSketch.boids[name] = new Boid(PresenceSketch.p5,
if (name) {
PresenceSketch.boids[name] = new Boid(PresenceSketch.p5,
Math.random() * PresenceSketch.width,
Math.random() * PresenceSketch.height);
Math.random() * PresenceSketch.height);
}
});
},
removeBoids(leaves) {
_.each(leaves, function(val, name) {
console.log("removing " + name);
delete PresenceSketch.boids[name];
});
......@@ -199,10 +200,11 @@ let PresenceSketch = {
console.log("have boid");
} else
{
console.log("adding boid");
PresenceSketch.boids[p.user] = new Boid(PresenceSketch.p5,
if (p.user) {
PresenceSketch.boids[p.user] = new Boid(PresenceSketch.p5,
Math.random() * PresenceSketch.width,
Math.random() * PresenceSketch.height);
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment