- Member animatedTiles [TILE_COUNT]
- Tile 620 points to 852. That should be tile 621.
- Member Micropolis::buildHouse (const Position &pos, int value)
- score is never 0 !!
- Member Micropolis::bulldozerTool (short x, short y, ToolEffects *effects)
Tool does not return TOOLRESULT_NO_MONEY.
Sometimes we can delete parts of a residential zone, but not always. Decide what rule we should have, and fix accordingly.
- Member Micropolis::collectTax ()
Function seems to be doing different things depending on Micropolis::totalPop value. With an non-empty city it does fund calculations. For an empty city, it immediately sets effects of funding, which seems inconsistent at least, and may be wrong
If Micropolis::taxFlag is set, no variable is touched which seems non-robust at least
- Member Micropolis::doZoneStatus (short mapH, short mapV)
- Program breaks for status on 'dirt'
- Member Micropolis::generateSomeRandomCity ()
- We use a random number generator to draw a seed for initializing the random number generator?
- Member Micropolis::getDir (int orgX, int orgY, int desX, int desY)
- Has a condition that never holds.
- Member Micropolis::getRandom (short range)
- Increment may cause range overflow.
- Member Micropolis::loadCity (const std::string &filename)
- Function fails if
lastDot<lastSlash
(ie with "x.y/bla"
)
- Member Micropolis::saveCityAs (const std::string &filename)
- Function fails if
lastDot<lastSlash
(ie with "x.y/bla"
)
- Member Micropolis::tickCount ()
- Unix version looks wrong,
time.tv_usec
should be divided to get seconds or time.tc_sec
should be multiplied.
- Member Micropolis::treeSplash (short xloc, short yloc)
- Function generates trees even if Micropolis::terrainTreeLevel is 0.
- Member Micropolis::tryDrive (const Position &startPos, ZoneType destZone)
- The stack is popped, but position (and dirLast) is not updated.
- Member Micropolis::updateDate ()
- Message is wrong.
- Member Micropolis::updateFundEffects ()
- I think this should be called after loading a city, or any time anything it depends on changes.
- Member Micropolis::zonePlop (const Position &pos, int base)
- This function allows partial on-map construction. Is that intentional? No!
- File random.cpp
Code seems to assume that sizeof(short)==2
and sizeof(int)==4
However, this depends on the compiler. We should introduce typedefs for them, and check correctness of our assumptions w.r.t. size of them (eg in Micropolis::randomlySeedRandom() or in Micropolis::Micropolis()).
Code stores unsigned 16 bit numbers in short
which is a signed type.