- fixed fog of war bug in map preview for connected client

- in headless mode keep three caches in case its related to out of synch
- comment out spurious irc console text
This commit is contained in:
Mark Vejvoda 2011-12-03 01:19:54 +00:00
parent 01ea0787a3
commit 609bc528d2
5 changed files with 8 additions and 8 deletions

View File

@ -2776,6 +2776,7 @@ void MenuStateConnectedGame::update() {
listBoxFogOfWar.setSelectedItemIndex(1);
}
}
cleanupMapPreviewTexture();
// Allow Observers
if(gameSettings->getAllowObservers()) {

View File

@ -416,9 +416,6 @@ private:
CauseOfDeathType causeOfDeath;
public:
Unit() : id(-1) {
assert(false);
}
Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing);
~Unit();

View File

@ -2178,7 +2178,8 @@ bool UnitUpdater::findCachedCellsEnemies(Vec2i center, int range, int size, vect
bool result = false;
//return result;
if(game->isMasterserverMode() == false) {
//if(game->isMasterserverMode() == false) {
{
MutexSafeWrapper safeMutex(&mutexUnitRangeCellsLookupItemCache,string(__FILE__) + "_" + intToStr(__LINE__));
std::map<Vec2i, std::map<int, std::map<int, UnitRangeCellsLookupItem > > >::iterator iterFind = UnitRangeCellsLookupItemCache.find(center);

View File

@ -1436,8 +1436,8 @@ void World::exploreCells(const Vec2i &newPos, int sightRange, int teamIndex) {
//bool cacheLookupSightResult = false;
// cache lookup of previously calculated cells + sight range
if(MaxExploredCellsLookupItemCache > 0 && game->isMasterserverMode() == false) {
//if(MaxExploredCellsLookupItemCache > 0) {
//if(MaxExploredCellsLookupItemCache > 0 && game->isMasterserverMode() == false) {
if(MaxExploredCellsLookupItemCache > 0) {
if(difftime(time(NULL),ExploredCellsLookupItem::lastDebug) >= 10) {
ExploredCellsLookupItem::lastDebug = time(NULL);
//printf("In [%s::%s Line: %d] ExploredCellsLookupItemCache.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,ExploredCellsLookupItemCache.size());
@ -1704,7 +1704,8 @@ void World::computeFow(int factionIdxToTick) {
//compute texture
//printf("Masterserver = %d\n",game->isMasterserverMode());
if(fogOfWar == true && game->isMasterserverMode() == false) {
//if(fogOfWar == true && game->isMasterserverMode() == false) {
if(fogOfWar == true) {
for(int i=0; i<getFactionCount(); ++i) {
Faction *faction= getFaction(i);
if(faction->getTeam() == thisTeamIndex) {

View File

@ -235,7 +235,7 @@ void dcc_file_recv_callback (irc_session_t * session, irc_dcc_t id, int status,
void event_channel(irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count) {
//IRC: Event "433", origin: "leguin.freenode.net", params: 3 [*|softcoder|Nickname is already in use.]
printf("In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
if ( count != 2 )
return;