mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 15:33:01 +00:00
36 lines
1 KiB
Lua
36 lines
1 KiB
Lua
|
if not _G.charSelectExists then
|
||
|
local first = false
|
||
|
hook_event(HOOK_ON_LEVEL_INIT, function()
|
||
|
if not first then
|
||
|
first = true
|
||
|
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||
|
djui_chat_message_create("\\#ffffa0\\[CS] Extra Characters requires Character Select to be enabled.\nPlease rehost with it enabled.")
|
||
|
end
|
||
|
end)
|
||
|
return
|
||
|
end
|
||
|
|
||
|
--- @param m MarioState
|
||
|
--- Checks if a player is currently active
|
||
|
function active_player(m)
|
||
|
local np = gNetworkPlayers[m.playerIndex]
|
||
|
if m.playerIndex == 0 then
|
||
|
return true
|
||
|
end
|
||
|
if not np.connected then
|
||
|
return false
|
||
|
end
|
||
|
if np.currCourseNum ~= gNetworkPlayers[0].currCourseNum then
|
||
|
return false
|
||
|
end
|
||
|
if np.currActNum ~= gNetworkPlayers[0].currActNum then
|
||
|
return false
|
||
|
end
|
||
|
if np.currLevelNum ~= gNetworkPlayers[0].currLevelNum then
|
||
|
return false
|
||
|
end
|
||
|
if np.currAreaIndex ~= gNetworkPlayers[0].currAreaIndex then
|
||
|
return false
|
||
|
end
|
||
|
return true
|
||
|
end
|