extern CGameEngine *g_psEngine; // assume g_psEngine is always valid.

#if !defined(BUILD_RELEASE) 
#define Debug(A) g_psEngine->DebugPrint(A);
#else 
#define Debug(A)
#endif 

if(!a)Debug(“Player Not Found”) 

ControlPlayer();

Recommended Answers

All 3 Replies

when BUILD_RELEASE is defined the Debug macro is not evaluated and the function on line 11 of the code you posted will only be executed if a == 0, in otherwords line 11 becomes part of the if condition on line 9, just as if it were written like this:

if(!a)
    ControlPlayer();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.