When adding droids to a transporter or sending a transporter to a new map, reset

their visibility caches. This closes ticket:1300 and closes ticket:1304


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8919 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-02 20:51:59 +00:00 committed by Git SVN Gateway
parent d2f4eea3f1
commit 0d6ded48d0
2 changed files with 16 additions and 10 deletions

View File

@ -655,15 +655,20 @@ void missionFlyTransportersIn( SDWORD iPlayer, BOOL bTrackTransporter )
psNext = psTransporter->psNext;
if (psTransporter->droidType == DROID_TRANSPORTER)
{
//check that this transporter actually contains some droids
if (psTransporter->psGroup && psTransporter->psGroup->refCount > 1)
{
//remove out of stored list and add to current Droid list
if (droidRemove(psTransporter, mission.apsDroidLists))
{
//don't want to add it unless managed to remove it from the previous list
addDroid(psTransporter, apsDroidLists);
}
// Check that this transporter actually contains some droids
if (psTransporter->psGroup && psTransporter->psGroup->refCount > 1)
{
// Remove map information from previous map
free(psTransporter->watchedTiles);
psTransporter->watchedTiles = NULL;
psTransporter->numWatchedTiles = 0;
// Remove out of stored list and add to current Droid list
if (droidRemove(psTransporter, mission.apsDroidLists))
{
// Do not want to add it unless managed to remove it from the previous list
addDroid(psTransporter, apsDroidLists);
}
/* set start position */
psTransporter->pos.x = iX;

View File

@ -56,7 +56,7 @@
#include "lib/framework/fixedpoint.h"
#include "lib/ivis_opengl/piematrix.h"
#include "mapgrid.h"
#include "visibility.h"
#include "multiplay.h"
//#define IDTRANS_FORM 9000 //The Transporter base form
@ -1523,6 +1523,7 @@ void transporterAddDroid(DROID *psTransporter, DROID *psDroidToAdd)
{
debug(LOG_ERROR,"droid %d not found, so nothing added to transporter!",psDroidToAdd->id);
}
visRemoveVisibility((BASE_OBJECT *)psDroidToAdd);
//this is called by droidRemove
//intRefreshScreen();