MCPcopy Create free account
hub / github.com/SimHacker/micropolis / updateDate

Method updateDate

MicropolisCore/src/MicropolisEngine/src/update.cpp:147–171  ·  view source on GitHub ↗

* @bug Message is wrong. */

Source from the content-addressed store, hash-verified

145 * @bug Message is wrong.
146 */
147void 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
174void Micropolis::showValves()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected