diff --git a/src/visibility.c b/src/visibility.c index eb2355ee3..ec7f5d318 100644 --- a/src/visibility.c +++ b/src/visibility.c @@ -2,7 +2,6 @@ #include #include -#include "lib/framework/frame.h" #include "objects.h" #include "map.h" #include "loop.h" @@ -205,15 +204,22 @@ static BOOL rayTerrainCallback(SDWORD x, SDWORD y, SDWORD dist) } // new - ask alex M - if (selectedPlayer != rayPlayer && bMultiPlayer && aiCheckAlliances(selectedPlayer, rayPlayer)) + if( (selectedPlayer!=rayPlayer) AND + (bMultiPlayer && game.type == TEAMPLAY && aiCheckAlliances(selectedPlayer,rayPlayer)) ) { SET_TILE_VISIBLE(selectedPlayer,psTile); } - /* Not true visibility - done on sensor range */ + // new - ask Alex M + /* Not true visibility - done on sensor range */ + if(getRevealStatus()) { - if (rayPlayer == selectedPlayer || (bMultiPlayer && aiCheckAlliances(selectedPlayer, rayPlayer))) + if( ((UDWORD)rayPlayer == selectedPlayer) OR + // new - ask AM + (bMultiPlayer && game.type == TEAMPLAY && aiCheckAlliances(selectedPlayer,rayPlayer)) // can see opponent moving + // new - ask AM + ) { avInformOfChange(x>>TILE_SHIFT,y>>TILE_SHIFT); // SET_TILE_SENSOR(psTile); @@ -225,8 +231,9 @@ static BOOL rayTerrainCallback(SDWORD x, SDWORD y, SDWORD dist) return TRUE; } + /* The los ray callback */ -BOOL rayLOSCallback(SDWORD x, SDWORD y, SDWORD dist) +static BOOL rayLOSCallback(SDWORD x, SDWORD y, SDWORD dist) { SDWORD newG; // The new gradient // MAPTILE *psTile; @@ -516,10 +523,9 @@ BOOL visibleObject(BASE_OBJECT *psViewer, BASE_OBJECT *psTarget) break; } - // fix to see units and structures of your ally - // FIXME: needed? - Per + // fix to see units and structures of your ally in teamplay mode /* - if(bMultiPlayer && aiCheckAlliances(psViewer->player,psTarget->player)) + if(bMultiPlayer && game.type == TEAMPLAY && aiCheckAlliances(psViewer->player,psTarget->player)) { if( (psViewer->type == OBJ_DROID) OR (psViewer->type == OBJ_STRUCTURE) ) { @@ -843,8 +849,8 @@ void processVisibility(BASE_OBJECT *psObj) gridStartIterate((SDWORD)psObj->x, (SDWORD)psObj->y); - // Allow allies to see your droids - if (bMultiPlayer) + // Fix for ally vis + if( bMultiPlayer && (game.type == TEAMPLAY) ) { for(player=0; player