Old revision #ptp0qnve4 | New revision #pg37zx0bm | ||
---|---|---|---|
5 | bool is_lock_middle = IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE; | 5 | bool is_lock_middle = IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE; |
6 | 6 | ||
7 | /* No need to dirty company windows here, we'll redraw the whole screen anyway. */ | 7 | /* No need to dirty company windows here, we'll redraw the whole screen anyway. */ |
8 | if (is_lock_middle) | 8 | if (is_lock_middle) { |
9 | | 9 | Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts. |
10 | | 10 | if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(old_owner)->infrastructure.water--; |
11 | } | 11 | } |
12 | if (new_owner != INVALID_OWNER) { | 12 | if (new_owner != INVALID_OWNER) { |
13 | if (is_lock_middle) Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts. | 13 | if (is_lock_middle) Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts. |