glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] half solved bug when using random maps


From: Nuage
Subject: [glob2-devel] half solved bug when using random maps
Date: Fri, 25 Nov 2005 18:56:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051102

> Another more important thing is that the island and random map
> generators don't work - any maps created with them will exit with a
> failed assertion within a few seconds of starting.  I've not been able
> to trace the source of the error - is this something you can easily fix?


$ grep ressourcesGradient *.cpp | grep new
Map.cpp: ressourcesGradient[t][r][s]=new Uint8[size];
Map.cpp: ressourcesGradient[t][r][s]=new Uint8[size];

// mhhh, two times

$ grep forbiddenGradient *.cpp | grep new
Map.cpp: forbiddenGradient[t][s] = new Uint8[size];

// mhh, one time :/


It is because the "forbiddenGradient" and "guardAreasGradient" are not
initalized into Map::addTeam(), which is used by MapGenerator. But when you load
the map, the mallocation is manualy inlined!

I "fixed" the bug and commite dit right now, but it is still inlined. Maybe one
solution would be to change the
Map::addTeam()
by
Map::initTeam(int teamNumber)
Which would actualy be mroe correct given what the method does.


Luc-Olivier




reply via email to

[Prev in Thread] Current Thread [Next in Thread]