diff --git a/src/droid.c b/src/droid.c index 2f1bbe29d..b8b6d1bcb 100644 --- a/src/droid.c +++ b/src/droid.c @@ -2534,6 +2534,7 @@ DROID* buildDroid(DROID_TEMPLATE *pTemplate, UDWORD x, UDWORD y, UDWORD player, psDroid->resistance = ACTION_START_TIME; memset(psDroid->visible, 0, sizeof(psDroid->visible)); + memset(psDroid->visible, 0, sizeof(psDroid->seenThisTick)); psDroid->visible[psDroid->player] = UBYTE_MAX; psDroid->died = 0; psDroid->inFire = false; diff --git a/src/feature.c b/src/feature.c index 2977dba6b..5dd7ad446 100644 --- a/src/feature.c +++ b/src/feature.c @@ -354,12 +354,10 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave) } } - for(i=0; ivisible[i] = 0;//vis; - } - //load into the map data + memset(psFeature->seenThisTick, 0, sizeof(psFeature->seenThisTick)); + memset(psFeature->visible, 0, sizeof(psFeature->visible)); + //load into the map data if(FromSave) { mapX = map_coord(x) - psStats->baseWidth / 2; mapY = map_coord(y) - psStats->baseBreadth / 2; @@ -523,10 +521,8 @@ bool removeFeature(FEATURE *psDel) if (psDel->psStats->subType == FEAT_GEN_ARTE || psDel->psStats->subType == FEAT_OIL_RESOURCE) { - // have to check all players cos if you cheat you'll get em. for (player = 0; player < MAX_PLAYERS; player++) { - //see if there is a proximity message FOR THE SELECTED PLAYER at this location psMessage = findMessage((MSG_VIEWDATA *)psDel, MSG_PROXIMITY, player); while (psMessage) { diff --git a/src/structure.c b/src/structure.c index 850ce6ce8..a152d59ba 100644 --- a/src/structure.c +++ b/src/structure.c @@ -1783,8 +1783,9 @@ STRUCTURE* buildStructure(STRUCTURE_STATS* pStructureType, UDWORD x, UDWORD y, U psBuilding->resistance = (UWORD)structureResistance(pStructureType, (UBYTE)player); psBuilding->lastResistance = ACTION_START_TIME; - //do the visiblilty stiff before setFunctionality - so placement of DP's can work - memset(psBuilding->visible, 0, (sizeof(UBYTE) * MAX_PLAYERS) ); + // Do the visibility stuff before setFunctionality - so placement of DP's can work + memset(psBuilding->visible, 0, sizeof(psBuilding->visible)); + memset(psBuilding->seenThisTick, 0, sizeof(psBuilding->seenThisTick)); /* Structure is trivially visible to the builder (owner) */ psBuilding->visible[player] = UBYTE_MAX;