Old revision #ptp0qnve4 | New revision #pt53yaqwv | ||
---|---|---|---|
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) | 13 | if (is_lock_middle) { |
14 | | 14 | Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts. |
15 | | 15 | if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(new_owner)->infrastructure.water++; |
16 | } | 16 | } |
17 | /* Only subtract from the old owner here if the new owner is valid, | 17 | /* Only subtract from the old owner here if the new owner is valid, |
18 | * otherwise we clear ship depots and canal water below. */ | 18 | * otherwise we clear ship depots and canal water below. */ |