* move CHECK_DROID assertion up, such that it appears _before_ the return statement; this will ensure that this assertion actually gets executed!
* Don't use two definitions for CHECK_DROID; a debug, and empty non-debug variant. This because (aside from the for-statements) the assert macro is the only thing getting invoked by the CHECK_DROID macro, and the assert macro will automatically be defined to a NO-OP if NDEBUG is defined (which is defined for non-debug builds). git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1800 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
090e5e17a4
commit
39829e9ff3
|
@ -395,9 +395,9 @@ BOOL droidDamage(DROID *psDroid, UDWORD damage, UDWORD weaponClass, UDWORD weapo
|
|||
psDroid->lastHitWeapon = weaponSubClass;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
CHECK_DROID(psDroid);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* droidRelease: release all resources associated with a droid -
|
||||
|
|
|
@ -387,7 +387,6 @@ extern BOOL droidAudioTrackStopped( void *psObj );
|
|||
extern BOOL cyborgDroid(DROID *psDroid);
|
||||
|
||||
/* assert if droid is bad */
|
||||
#ifdef DEBUG
|
||||
#define CHECK_DROID(droid) \
|
||||
do { \
|
||||
unsigned int i; \
|
||||
|
@ -411,8 +410,5 @@ do { \
|
|||
if (droid->psActionTarget[i]) \
|
||||
assert(droid->psActionTarget[i]->direction >= 0.0f); \
|
||||
} while (0);
|
||||
#else
|
||||
#define CHECK_DROID(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue