Пример #1
0
        public override bool ArriveAtDestination(ushort vehicleID, ref Vehicle vehicleData)
        {
            try
            {
                if (currentClaim[vehicleID] != null)
                {
                    DeathRegistry.RestClaim(currentClaim[vehicleID]);
                }
            } catch (Exception E) { }

            try
            {
                currentClaim[vehicleID] = null;
            } catch (Exception E) { }

            return(base.ArriveAtDestination(vehicleID, ref vehicleData));
        }
Пример #2
0
        private void ClearPhantoms()
        {
            CitizenManager CM = Singleton <CitizenManager> .instance;

            DeathClaim[] claims = GetArray();

            count = 0;
            head  = null;
            tail  = null;

            for (int i = 0; i < claims.Length; i++)
            {
                switch (claims[i].location)
                {
                case Citizen.Location.Home:
                    if (CM.m_citizens.m_buffer[claims[i].citizenID].m_homeBuilding != 0)
                    {
                        Add(claims[i]);
                    }
                    break;

                case Citizen.Location.Visit:
                    if (CM.m_citizens.m_buffer[claims[i].citizenID].m_visitBuilding != 0)
                    {
                        Add(claims[i]);
                    }
                    break;

                case Citizen.Location.Work:
                    if (CM.m_citizens.m_buffer[claims[i].citizenID].m_workBuilding != 0)
                    {
                        Add(claims[i]);
                    }
                    break;

                default:
                    DeathRegistry.RestClaim(claims[i]);
                    break;
                }
            }
        }