202c202 < private readonly Vector3[] Dir_Vectors = new Vector3[9]; --- > private readonly Vector3[] Dir_Vectors = new Vector3[11]; 266,268c266,268 < DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG < < --- > DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG, > DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, > DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG 861,862c861,862 < < --- > Dir_Vectors[9] = new Vector3(0, 4, 0); //LEFT Nudge > Dir_Vectors[10] = new Vector3(0, -4, 0); //RIGHT Nudge 867c867 < Vector3[] vector = new Vector3[9]; --- > Vector3[] vector = new Vector3[11]; 876a877,878 > vector[9] = new Vector3(0, 2, 0); //LEFT Nudge > vector[10] = new Vector3(0, -2, 0); //RIGHT Nudge 1411,1413c1413,1415 < < < --- > if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) != AgentManager.ControlFlags.NONE) > { > } 1568c1570,1586 < foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) --- > //foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) > //Do these two like this to block out all others because it will slow it down > if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) > { > m_forceToApply = Vector3.Zero; > bResetMoveToPosition = true; > DCFlagKeyPressed = true; > m_forceToApply = agent_control_v3 += dirVectors[9]; > } > else if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) > { > m_forceToApply = Vector3.Zero; > bResetMoveToPosition = true; > DCFlagKeyPressed = true; > m_forceToApply = agent_control_v3 += dirVectors[10]; > } > else 1570c1588 < if (((uint)flags & (uint)DCF) != 0) --- > foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) 1572,1579c1590 < bResetMoveToPosition = true; < DCFlagKeyPressed = true; < try < { < agent_control_v3 += dirVectors[i]; < //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); < } < catch (IndexOutOfRangeException) --- > if (((uint)flags & (uint)DCF) != 0) 1581,1586c1592,1594 < // Why did I get this? < } < < if ((m_movementflag & (byte)(uint)DCF) == 0) < { < if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) --- > bResetMoveToPosition = true; > DCFlagKeyPressed = true; > try 1588c1596,1597 < m_movementflag |= (byte)nudgehack; --- > agent_control_v3 += dirVectors[i]; > //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); 1590,1606c1599,1605 < m_movementflag += (byte)(uint)DCF; < update_movementflag = true; < } < } < else < { < if ((m_movementflag & (byte)(uint)DCF) != 0 || < ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) < && ((m_movementflag & (byte)nudgehack) == nudgehack)) < ) // This or is for Nudge forward < { < m_movementflag -= ((byte)(uint)DCF); < < update_movementflag = true; < /* < if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) < && ((m_movementflag & (byte)nudgehack) == nudgehack)) --- > catch (IndexOutOfRangeException) > { > // Why did I get this? > } > if ((m_movementflag & (byte)(uint)DCF) == 0) > { > if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) 1608c1607 < m_log.Debug("Removed Hack flag"); --- > m_movementflag |= (byte)nudgehack; 1610c1609,1611 < */ --- > m_movementflag += (byte)(uint)DCF; > update_movementflag = true; > } 1614c1615,1634 < bAllowUpdateMoveToPosition = true; --- > if ((m_movementflag & (byte)(uint)DCF) != 0 || > ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) > && ((m_movementflag & (byte)nudgehack) == nudgehack)) > ) // This or is for Nudge forward > { > m_movementflag -= ((byte)(uint)DCF); > > update_movementflag = true; > /* > if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) > && ((m_movementflag & (byte)nudgehack) == nudgehack)) > { > m_log.Debug("Removed Hack flag"); > } > */ > } > else > { > bAllowUpdateMoveToPosition = true; > } 1615a1636 > i++; 1617c1638 < i++; --- > //i++;