Code review comment for lp:~widelands-dev/widelands/bug-1746481

Revision history for this message
GunChleoc (gunchleoc) wrote :

You probably need 2 lists, one with the buildings to build, and one with the buildings built. The buildings built list can then be checked whether they're occupied and if so, be removed from the second list.

Or you can expand the first list with number of buildings built and only build new buildings if there is a difference. Then remove fro the list if all buildings are occupied.

Regarding printf, that function is insecure and should be replaced with sprintf in all cases - our custom-built log function will do that for you. You also accidentally added a long list of "#include <unistd.h>" to main.cc in the commit that fixed the printf.

« Back to merge proposal