Remove visibility information when changing between campaigns. This closes ticket:1461

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9435 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-23 22:57:20 +00:00 committed by Git SVN Gateway
parent 8b9dfd0789
commit ca1d602ccb
2 changed files with 4 additions and 6 deletions

View File

@ -1309,6 +1309,7 @@ static void clearCampaignUnits(void)
{ {
orderDroid(psDroid, DORDER_STOP); orderDroid(psDroid, DORDER_STOP);
setDroidBase(psDroid, NULL); setDroidBase(psDroid, NULL);
visRemoveVisibilityOffWorld((BASE_OBJECT *)psDroid);
CHECK_DROID(psDroid); CHECK_DROID(psDroid);
} }
} }

View File

@ -307,12 +307,9 @@ void visRemoveVisibility(BASE_OBJECT *psObj)
void visRemoveVisibilityOffWorld(BASE_OBJECT *psObj) void visRemoveVisibilityOffWorld(BASE_OBJECT *psObj)
{ {
if (psObj->watchedTiles && psObj->numWatchedTiles > 0) free(psObj->watchedTiles);
{ psObj->watchedTiles = NULL;
free(psObj->watchedTiles); psObj->numWatchedTiles = 0;
psObj->watchedTiles = NULL;
psObj->numWatchedTiles = 0;
}
} }
/* Check which tiles can be seen by an object */ /* Check which tiles can be seen by an object */