/* only objects within the same city and with the same type */
if (lobj->town == obj->town && lobj->IsOfType(obj)) {
/* if lobj->town_cn < next, uint will overflow to '+inf' */
uint i = (uint)lobj->town_cn - next;
if (i < 32) {
SetBit(used, i); // update bitmap
if (i == 0) {
/* shift bitmap while the lowest bit is '1';
* increase the base of the bitmap too */
do {
used >>= 1;
next++;
} while (HasBit(used, 0));
src/waypoint_base.h
➞
Show inline comments
@@ -6,25 +6,25 @@
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.