diff --git a/lib/ship_web/live/game_live.ex b/lib/ship_web/live/game_live.ex index fd57b36..485a1fb 100644 --- a/lib/ship_web/live/game_live.ex +++ b/lib/ship_web/live/game_live.ex @@ -20,9 +20,11 @@ defmodule ShipWeb.GameLive do |> assign_loading_state() if connected?(socket) do - ECSx.ClientEvents.add(player.id, :spawn_ship) - # The first load will now have additional responsibilities - send(self(), :first_load) + unless PlayerSpawned.exists?(player.id) do + ECSx.ClientEvents.add(player.id, :spawn_ship) + # The first load will now have additional responsibilities + send(self(), :first_load) + end end {:ok, socket}