* Loop over all units, performing various of tasks. */
| 121 | * Loop over all units, performing various of tasks. |
| 122 | */ |
| 123 | void GameLoop_Unit(void) |
| 124 | { |
| 125 | PoolFindStruct find; |
| 126 | bool tickMovement = false; |
| 127 | bool tickRotation = false; |
| 128 | bool tickBlinking = false; |
| 129 | bool tickUnknown4 = false; |
| 130 | bool tickScript = false; |
| 131 | bool tickUnknown5 = false; |
| 132 | bool tickDeviation = false; |
| 133 | |
| 134 | if (g_debugScenario) return; |
| 135 | |
| 136 | if (s_tickUnitMovement <= g_timerGame) { |
| 137 | tickMovement = true; |
| 138 | s_tickUnitMovement = g_timerGame + 3; |
| 139 | } |
| 140 | |
| 141 | if (s_tickUnitRotation <= g_timerGame) { |
| 142 | tickRotation = true; |
| 143 | s_tickUnitRotation = g_timerGame + Tools_AdjustToGameSpeed(4, 2, 8, true); |
| 144 | } |
| 145 | |
| 146 | if (s_tickUnitBlinking <= g_timerGame) { |
| 147 | tickBlinking = true; |
| 148 | s_tickUnitBlinking = g_timerGame + 3; |
| 149 | } |
| 150 | |
| 151 | if (s_tickUnitUnknown4 <= g_timerGame) { |
| 152 | tickUnknown4 = true; |
| 153 | s_tickUnitUnknown4 = g_timerGame + 20; |
| 154 | } |
| 155 | |
| 156 | if (s_tickUnitScript <= g_timerGame) { |
| 157 | tickScript = true; |
| 158 | s_tickUnitScript = g_timerGame + 5; |
| 159 | } |
| 160 | |
| 161 | if (s_tickUnitUnknown5 <= g_timerGame) { |
| 162 | tickUnknown5 = true; |
| 163 | s_tickUnitUnknown5 = g_timerGame + 5; |
| 164 | } |
| 165 | |
| 166 | if (s_tickUnitDeviation <= g_timerGame) { |
| 167 | tickDeviation = true; |
| 168 | s_tickUnitDeviation = g_timerGame + 60; |
| 169 | } |
| 170 | |
| 171 | find.houseID = HOUSE_INVALID; |
| 172 | find.index = 0xFFFF; |
| 173 | find.type = 0xFFFF; |
| 174 | |
| 175 | while (true) { |
| 176 | const UnitInfo *ui; |
| 177 | Unit *u; |
| 178 | |
| 179 | u = Unit_Find(&find); |
| 180 | if (u == NULL) break; |
no test coverage detected