cleaned up code: some comiler-warnings fixed, obsolete code removed (oops..and some whitespace stuff) (by CleaningWoman)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6102 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-05-27 21:01:04 +00:00
parent f92f70c78d
commit 9bd26015e5
33 changed files with 167 additions and 291 deletions
+2 -2
View File
@@ -1284,7 +1284,7 @@ UINT32 UIHandleEndTurn( UI_EVENT *pUIEvent )
// Just try/catch (ugly, but works).
__try
{
for(UINT32 i=0; i<WORLD_MAX ;i+=4)
for(UINT32 i=0; i<(UINT32)WORLD_MAX ;i+=4)
{
gubWorldTileInLight[i] = InLightAtNight(i, gpWorldLevelData[ i ].sHeight);
gubIsCorpseThere[i] = IsCorpseAtGridNo( i, gpWorldLevelData[ i ].sHeight );
@@ -7049,4 +7049,4 @@ BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fChec
}
return( FALSE );
}
}
+1 -2
View File
@@ -6,7 +6,6 @@
#include "builddefines.h"
#include <stdio.h>
#include "sgp.h"
//#include "soldier control.h"
#include "Encrypted File.h"
#include "faces.h"
#include "wcheck.h"
@@ -25,7 +24,6 @@
#include "items.h"
#include "text.h"
#include "overhead.h"
//#include "soldier control.h"
#include "assignments.h"
#include "strategic.h"
#include "strategicmap.h"
@@ -4160,6 +4158,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
{
pSoldier = ChangeSoldierTeam( pSoldier, CIV_TEAM );
}
Assert(pSoldier);
// remove profile from map
gMercProfiles[ pSoldier->ubProfile ].sSectorX = 0;
gMercProfiles[ pSoldier->ubProfile ].sSectorY = 0;
+1 -3
View File
@@ -3515,13 +3515,11 @@ void HandleKilledQuote( SOLDIERTYPE *pKilledSoldier, SOLDIERTYPE *pKillerSoldier
UINT8 ubNumMercs = 0;
UINT8 ubChosenMerc;
BOOLEAN fDoSomeoneElse = FALSE;
BOOLEAN fCanWeSeeLocation = FALSE;
gfLastMercTalkedAboutKillingID = pKilledSoldier->ubID;
// Can we see location?
fCanWeSeeLocation = ( SoldierTo3DLocationLineOfSightTest( pKillerSoldier, sGridNo, bLevel, 3, TRUE, CALC_FROM_ALL_DIRS ) != 0 );
BOOLEAN fCanWeSeeLocation = ( SoldierTo3DLocationLineOfSightTest( pKillerSoldier, sGridNo, bLevel, 3, TRUE, CALC_FROM_ALL_DIRS ) != 0 );
// Are we killing mike?
if ( pKilledSoldier->ubProfile == MIKE && pKillerSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
+7 -3
View File
@@ -1715,7 +1715,7 @@ public:
// Copy Constructor
OLDSOLDIERTYPE_101(const OLDSOLDIERTYPE_101& src) {
memcpy(this, &src, SIZEOF_OLDSOLDIERTYPE_101_POD);
memcpy(this, &src, SIZEOF_OLDSOLDIERTYPE_101_POD); // FIXME: memcpy std::vector
inv = src.inv;
bNewItemCount = src.bNewItemCount;
bNewItemCycleCount = src.bNewItemCycleCount;
@@ -1725,7 +1725,7 @@ public:
OLDSOLDIERTYPE_101& operator=(const OLDSOLDIERTYPE_101& src)
{
if (this != &src) {
memcpy(this, &src, SIZEOF_OLDSOLDIERTYPE_101_POD);
memcpy(this, &src, SIZEOF_OLDSOLDIERTYPE_101_POD); // FIXME: memcpy std::vector
inv = src.inv;
bNewItemCount = src.bNewItemCount;
bNewItemCycleCount = src.bNewItemCycleCount;
@@ -1741,7 +1741,7 @@ public:
// Use this instead of the old method of calling memset!
// Note that the constructor does this automatically.
void initialize() {
memset( this, 0, SIZEOF_OLDSOLDIERTYPE_101_POD);
memset( this, 0, SIZEOF_OLDSOLDIERTYPE_101_POD); // FIXME: memcpy std::vector
inv.clear();
for (int idx=0; idx < (int)inv.size(); ++idx) {
bNewItemCount[idx] = 0;
@@ -2402,6 +2402,10 @@ public:
INT32 sPlotSrcGrid;
}; // OLDSOLDIERTYPE_101;
void HandleTakeDamageDeath( SOLDIERTYPE *pSoldier, UINT8 bOldLife, UINT8 ubReason );
#endif
+1 -1
View File
@@ -219,7 +219,7 @@ public:
UINT16 GetChecksum();
SOLDIERCREATE_STRUCT& SOLDIERCREATE_STRUCT::operator=(const _OLD_SOLDIERCREATE_STRUCT& src);//dnl ch42 250909
SOLDIERCREATE_STRUCT& operator=(const _OLD_SOLDIERCREATE_STRUCT& src);//dnl ch42 250909
// Initialize the soldier.
// Use this instead of the old method of calling memset!
+1 -4
View File
@@ -15,7 +15,6 @@
#include "math.h"
#include "jascreens.h"
#include "pathai.h"
//#include "Soldier Control.h"
#include "Animation Control.h"
#include "Animation Data.h"
#include "Event Pump.h"
@@ -356,11 +355,9 @@ void QueryTBLeftButton( UINT32 *puiNewEvent )
// If we're on terrain,
if ( gusSelectedSoldier != NOBODY )
{
INT8 bReturnVal = FALSE;
GetSoldier( &pSoldier, gusSelectedSoldier );
bReturnVal = HandleMoveModeInteractiveClick( usMapPos, puiNewEvent );
INT8 bReturnVal = HandleMoveModeInteractiveClick( usMapPos, puiNewEvent );
// All's OK for interactive tile?
if ( bReturnVal == -2 )
+1
View File
@@ -1739,6 +1739,7 @@ void HandleCriticalHitForVehicleInLocation( UINT8 ubID, INT16 sDmg, INT32 sGridN
#endif
pSoldier = GetSoldierStructureForVehicle( ubID );
Assert(pSoldier);
if ( sDmg > pSoldier->stats.bLife )
{
+1
View File
@@ -4304,6 +4304,7 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UIN
OBJECTTYPE * pObj;
pBullet = GetBulletPtr( iBullet );
Assert(pBullet);
// Flugente: check for underbarrel weapons and use that object if necessary
pObj = MercPtrs[ ubAttackerID ]->GetUsedWeapon( &MercPtrs [ ubAttackerID ]->inv[MercPtrs[ubAttackerID]->ubAttackingHand] );
+3 -2
View File
@@ -349,7 +349,8 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
if ( gubGridNoValue == 255 )
{
// Reset!
memset( gubGridNoMarkers, 0, sizeof( gubGridNoMarkers ) );
Assert(gubGridNoMarkers);
memset(gubGridNoMarkers, 0, sizeof(UINT8)*WORLD_MAX);
gubGridNoValue = 1;
}
@@ -373,7 +374,7 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
range = pSoldier->bViewRange;
// Flugente: adjust sightrange
range = (UINT16)( (range * (100 + pSoldier->GetSightRangeBonus()) ) / 100);
range = (UINT8)( (range * (100 + pSoldier->GetSightRangeBonus()) ) / 100);
// balance item viewing range between normal and the limit set by opplist-type functions -- CJC
range = (AdjustMaxSightRangeForEnvEffects( pSoldier, LightTrueLevel( pSoldier->sGridNo, pSoldier->pathing.bLevel), range ) + range) / 2;