Fix type punning of pointers in missionGetTransporterExit

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2662 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2007-10-29 19:44:36 +00:00
parent 81ccff31f7
commit a788510e27
4 changed files with 9 additions and 10 deletions

View File

@ -1092,7 +1092,6 @@ done:
// Update the action state for a droid
void actionUpdateDroid(DROID *psDroid)
{
// UDWORD structX,structY;
UDWORD droidX,droidY;
UDWORD tlx,tly;
STRUCTURE *psStruct;
@ -1276,9 +1275,9 @@ void actionUpdateDroid(DROID *psDroid)
}
addDroid(psDroid, apsDroidLists);
//set the x/y up since they were set to INVALID_XY when moved offWorld
missionGetTransporterExit(selectedPlayer, (UWORD*)&droidX, (UWORD*)&droidY); // FIXME passing type-punned pointer of wrong size!
psDroid->x = (UWORD)droidX;
psDroid->y = (UWORD)droidY;
missionGetTransporterExit(selectedPlayer, &droidX, &droidY);
psDroid->x = droidX;
psDroid->y = droidY;
//fly Transporter back to get some more droids
orderDroidLoc( psDroid, DORDER_TRANSPORTIN,
getLandingX(selectedPlayer), getLandingY(selectedPlayer));

View File

@ -2590,7 +2590,7 @@ void unloadTransporter(DROID *psTransporter, UDWORD x, UDWORD y, BOOL goingHome)
DROID *psDroid, *psNext;
DROID **ppCurrentList, **ppStoredList;
UDWORD droidX, droidY;
UWORD iX, iY;
UDWORD iX, iY;
DROID_GROUP *psGroup;
if (goingHome)
@ -4037,12 +4037,12 @@ void missionGetTransporterEntry( SDWORD iPlayer, UWORD *iX, UWORD *iY )
*iY = (UWORD) world_coord(mission.iTranspEntryTileY[iPlayer]);
}
void missionGetTransporterExit( SDWORD iPlayer, UWORD *iX, UWORD *iY )
void missionGetTransporterExit( SDWORD iPlayer, UDWORD *iX, UDWORD *iY )
{
ASSERT( iPlayer<MAX_PLAYERS, "missionGetTransporterExit: player %i too high", iPlayer );
*iX = (UWORD) world_coord(mission.iTranspExitTileX[iPlayer]);
*iY = (UWORD) world_coord(mission.iTranspExitTileY[iPlayer]);
*iX = world_coord(mission.iTranspExitTileX[iPlayer]);
*iY = world_coord(mission.iTranspExitTileY[iPlayer]);
}
/*update routine for mission details */

View File

@ -169,7 +169,7 @@ extern DROID * buildMissionDroid(DROID_TEMPLATE *psTempl, UDWORD x, UDWORD y,
extern void missionSetTransporterEntry( SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEntryTileY );
extern void missionSetTransporterExit( SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitTileY );
extern void missionGetTransporterEntry( SDWORD iPlayer, UWORD *iX, UWORD *iY );
extern void missionGetTransporterExit( SDWORD iPlayer, UWORD *iX, UWORD *iY );
extern void missionGetTransporterExit( SDWORD iPlayer, UDWORD *iX, UDWORD *iY );
//access functions for droidsToSafety flag
extern void setDroidsToSafetyFlag(BOOL set);

View File

@ -1719,7 +1719,7 @@ void transporterSetLaunchTime(UDWORD time)
/*launches the defined transporter to the offworld map*/
BOOL launchTransporter(DROID *psTransporter)
{
UWORD iX, iY;
UDWORD iX, iY;
//close the interface
intResetScreen(TRUE);