From dfb8a12c6ebfc9e638de29bcdd50bc31ba47781d Mon Sep 17 00:00:00 2001 From: Fabien Grzeskowiak <fabien.grzeskowiak@inria.fr> Date: Mon, 15 Jun 2020 12:03:43 +0200 Subject: [PATCH] fix crowdpub when crowd is null --- .../MainAssets/Scripts/Managers/CrowdBotSim_TrialManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/MainAssets/Scripts/Managers/CrowdBotSim_TrialManager.cs b/Assets/MainAssets/Scripts/Managers/CrowdBotSim_TrialManager.cs index 36df010d..db269b93 100644 --- a/Assets/MainAssets/Scripts/Managers/CrowdBotSim_TrialManager.cs +++ b/Assets/MainAssets/Scripts/Managers/CrowdBotSim_TrialManager.cs @@ -317,9 +317,10 @@ public class CrowdBotSim_TrialManager : MonoBehaviour, TrialManager { if( crowdpub != null) { - int start_index = 1; //player + int start_index = 0; + if(player_in_sim) start_index++; //player if(robots != null) start_index += robots.Count; - crowdpub.UpdateAgents(currPos.GetRange(start_index, currPos.Count-start_index), agentsList); + if(currPos.Count - start_index > 0) crowdpub.UpdateAgents(currPos.GetRange(start_index, currPos.Count-start_index), agentsList); } sims.doStep(ToolsTime.DeltaTime, currPos, player, agentsList, robots); -- GitLab