Bug List

Member Micropolis::generateMap ()
We use a random number generator to draw a seed for initializing the random number generator?

Member Micropolis::treeSplash (short xloc, short yloc)
Function generates trees even if Micropolis::terrainTreeLevel is 0.

Member Micropolis::loadCity (const char *filename)
Function fails if lastDot<lastSlash (ie with "x.y/bla" )

Member Micropolis::saveCityAs (const char *filename)
Function fails if lastDot<lastSlash (ie with "x.y/bla" )

Member Micropolis::simRandom ()
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()).

Member Micropolis::simRandom ()
Code stores unsigned 16 bit numbers in short which is a signed type.

Member Micropolis::getRandom (short range)
Increment may cause range overflow.

Member Micropolis::getResource (const char *name, Quad id)
Function is not safely handling strings.

Member Micropolis::getResource (const char *name, Quad id)
File handling is not safe across platforms (text-mode may modify data).

Member Micropolis::getResource (const char *name, Quad id)
Not safe!

Member Micropolis::getResource (const char *name, Quad id)
Not safe (overflow, non-printable chars)

Member Micropolis::getIndString (char *str, int id, short num)
Make the function safe (should never overwrite data outside str, handle case where last line of file is not terminated with new-line)

Member Micropolis::getIndString (char *str, int id, short num)
Out of range num seems not correctly handled (strcpy(str,"Oops") is overwritten at least. Maybe use an assert() instead?).

Member Micropolis::updateFundEffects ()
I think this should be called after loading a city, or any time anything it depends on changes.

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

Member Micropolis::collectTax ()
If Micropolis::taxFlag is set, no variable is touched which seems non-robust at least

Member Micropolis::getDir (int orgX, int orgY, int desX, int desY)
Has a condition that never holds.

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::doPlayNewCity ()
Function is never called.

Member Micropolis::doReallyStartGame ()
Function is never called.

Member Micropolis::doStartLoad ()
Function is never called.

Member Micropolis::doStartScenario (int scenario)
Function is never called.

Member Micropolis::bulldozerTool (short x, short y, ToolEffects *effects)
Tool does not return TOOLRESULT_NO_MONEY.

Member Micropolis::bulldozerTool (short x, short y, ToolEffects *effects)
Sometimes we can delete parts of a residential zone, but not always. Decide what rule we should have, and fix accordingly.

Member Micropolis::doZoneStatus (short mapH, short mapV)
Program breaks for status on 'dirt'

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::zonePlop (const Position &pos, int base)
This function allows partial on-map construction. Is that intentional? No!

Member Micropolis::buildHouse (const Position &pos, int value)
score is never 0 !!

Member animatedTiles
Tile 620 points to 852. That should be tile 621.


Generated on Wed Feb 2 09:19:22 2011 for Micropolis by  doxygen 1.5.6