Ejemplo n.º 1
0
        private void CreateAnimal(ushort buildingID, ref Building data)
        {
            SimulationManager instance1       = Singleton <SimulationManager> .instance;
            CitizenManager    instance2       = Singleton <CitizenManager> .instance;
            CitizenInfo       groupAnimalInfo = instance2.GetGroupAnimalInfo(ref instance1.m_randomizer, this.m_info.m_class.m_service, this.m_info.m_class.m_subService);
            //begin mod
            var animalIndex = WildlifeSpawnManager.instance.SpawnMap.ContainsKey(buildingID) ? WildlifeSpawnManager.instance.SpawnMap[buildingID] : 0;

            animalIndex--;
            groupAnimalInfo = WildlifeSpawnManager.instance.GetGroupAnimalInfo(ref instance1.m_randomizer, this.m_info.m_class.m_service, this.m_info.m_class.m_subService, animalIndex);
            //end mod
            ushort instance3;

            if (groupAnimalInfo == null || !instance2.CreateCitizenInstance(out instance3, ref instance1.m_randomizer, groupAnimalInfo, 0U))
            {
                return;
            }
            //begin mod
            PetAIDetour.isCaged = true;
            //end mod
            groupAnimalInfo.m_citizenAI.SetSource(instance3, ref instance2.m_instances.m_buffer[(int)instance3], buildingID);
            groupAnimalInfo.m_citizenAI.SetTarget(instance3, ref instance2.m_instances.m_buffer[(int)instance3], buildingID);
            //begin mod
            PetAIDetour.isCaged = false;
            //end mod
        }