| 75 | } |
| 76 | |
| 77 | int CheckBuildLimit(HouseClass const* const pHouse, BuildingTypeClass const* const pItem, bool const includeQueued) |
| 78 | { |
| 79 | enum { NotReached = 1, ReachedPermanently = -1, ReachedTemporarily = 0 }; |
| 80 | |
| 81 | int BuildLimit = pItem->BuildLimit; |
| 82 | int Remaining = BuildLimitRemaining(pHouse, pItem); |
| 83 | |
| 84 | if (BuildLimit >= 0 && Remaining <= 0) |
| 85 | return (includeQueued && FactoryClass::FindByOwnerAndProduct(pHouse, pItem)) ? NotReached : ReachedPermanently; |
| 86 | |
| 87 | return Remaining > 0 ? NotReached : ReachedTemporarily; |
| 88 | |
| 89 | } |
| 90 | |
| 91 | DEFINE_HOOK(0x4F8361, HouseClass_CanBuild_UpgradesInteraction, 0x5) |
| 92 | { |
nothing calls this directly
no test coverage detected