[Top][All Lists]
[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
- [glob2-devel] my experiments on pathfinding and gradients (huge), Nuage, 2005/11/23
- [glob2-devel] the random map generator (big), Nuage, 2005/11/25
- Re: [glob2-devel] the random map generator (big), Andrew Sayers, 2005/11/25
- Re: [glob2-devel] the random map generator (big), Matthew Marshall, 2005/11/26
- [glob2-devel] Optimisation of the gradients. Pointer vs integers., Nuage, 2005/11/25
- Re: [glob2-devel] Optimisation of the gradients. Pointer vs integers., Andrew Sayers, 2005/11/25