MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CheckUnderflow

Function CheckUnderflow

src/viewport.cpp:3046–3052  ·  view source on GitHub ↗

* Check for underflowing the map. * @param test the variable to test for underflowing * @param other the other variable to update to keep the line * @param mult the constant to multiply the difference by for \c other */

Source from the content-addressed store, hash-verified

3044 * @param mult the constant to multiply the difference by for \c other
3045 */
3046static void CheckUnderflow(int &test, int &other, int mult)
3047{
3048 if (test >= 0) return;
3049
3050 other += mult * test;
3051 test = 0;
3052}
3053
3054/**
3055 * Check for overflowing the map.

Callers 1

CalcRaildirsDrawstyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected