* @bug Message is wrong. */
| 145 | * @bug Message is wrong. |
| 146 | */ |
| 147 | void Micropolis::updateDate() |
| 148 | { |
| 149 | int megalinium = 1000000; |
| 150 | |
| 151 | cityTimeLast = cityTime >> 2; |
| 152 | |
| 153 | cityYear = ((int)cityTime / 48) + (int)startingYear; |
| 154 | cityMonth = ((int)cityTime % 48) >> 2; |
| 155 | |
| 156 | if (cityYear >= megalinium) { |
| 157 | setYear(startingYear); |
| 158 | cityYear = startingYear; |
| 159 | sendMessage(MESSAGE_NOT_ENOUGH_POWER, NOWHERE, NOWHERE, true); |
| 160 | |
| 161 | } |
| 162 | |
| 163 | if ((cityYearLast != cityYear) || |
| 164 | (cityMonthLast != cityMonth)) { |
| 165 | |
| 166 | cityYearLast = cityYear; |
| 167 | cityMonthLast = cityMonth; |
| 168 | |
| 169 | callback("update", "s", "date"); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | |
| 174 | void Micropolis::showValves() |
nothing calls this directly
no outgoing calls
no test coverage detected