Actually listen to the joinable? function
Some checks failed
Build & Test / nix-build (push) Failing after 27s
Some checks failed
Build & Test / nix-build (push) Failing after 27s
This commit is contained in:
parent
8ae0c08e8d
commit
d63bd0a9b2
@ -96,7 +96,7 @@ defmodule Amethyst.GameCoordinator do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp _find(type, state) do
|
defp _find(type, state) do
|
||||||
case state.games |> Enum.find(fn {_, game} -> game.mod == type end) do
|
case state.games |> Enum.find(fn {_, game} -> game.mod == type && game[:mod].joinable?(game[:refs]) end) do
|
||||||
nil -> {nil, state}
|
nil -> {nil, state}
|
||||||
{_, game} -> {game, state}
|
{_, game} -> {game, state}
|
||||||
end
|
end
|
||||||
|
@ -20,4 +20,9 @@ defmodule Example.Game do
|
|||||||
Logger.info("Player at #{inspect(from)} moved to #{x}, #{y}, #{z}")
|
Logger.info("Player at #{inspect(from)} moved to #{x}, #{y}, #{z}")
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def joinable?(refs) do
|
||||||
|
true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user