Oiltanker's special hook (adds hook gameSession.getSessionCrewCharacters)
This commit is contained in:
@@ -716,6 +716,13 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public static IEnumerable<Character> GetSessionCrewCharacters()
|
public static IEnumerable<Character> GetSessionCrewCharacters()
|
||||||
{
|
{
|
||||||
|
LuaResult result = new LuaResult(GameMain.Lua.hook.Call("gameSession.getSessionCrewCharacters"));
|
||||||
|
|
||||||
|
if (!result.IsNull())
|
||||||
|
{
|
||||||
|
return result.DynValue().ToObject<IEnumerable<Character>>();
|
||||||
|
}
|
||||||
|
|
||||||
#if SERVER
|
#if SERVER
|
||||||
return GameMain.Server.ConnectedClients.Select(c => c.Character).Where(c => c?.Info != null && !c.IsDead);
|
return GameMain.Server.ConnectedClients.Select(c => c.Character).Where(c => c?.Info != null && !c.IsDead);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -416,4 +416,14 @@ public class LuaResult
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DynValue DynValue()
|
||||||
|
{
|
||||||
|
if (result is DynValue dynValue)
|
||||||
|
{
|
||||||
|
return dynValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user