private static bool Prefix(ref GameObject __result, RoleType classID) { if (!CustomPlayerSpawning.Configs.IsEnabled) { return(true); } var spawnPoint = OnGetRandomSpawnPoint?.Invoke(classID); if (spawnPoint == null) { Log.Error("No SpawnPoint set."); return(true); } OnPlayerSpawningAtPoint?.Invoke(spawnPoint, classID); __result = spawnPoint?.GameObject; return(__result == null); }
static SpawnerAPI() { GetRandomSpawnPointPatch.OnPlayerSpawningAtPoint += (a, b) => OnPlayerSpawningAtPoint?.Invoke(a, b); }