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
|
||||
|
||||
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}
|
||||
{_, game} -> {game, state}
|
||||
end
|
||||
|
@ -20,4 +20,9 @@ defmodule Example.Game do
|
||||
Logger.info("Player at #{inspect(from)} moved to #{x}, #{y}, #{z}")
|
||||
:ok
|
||||
end
|
||||
|
||||
@impl true
|
||||
def joinable?(refs) do
|
||||
true
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user