mirror of https://github.com/OpenTTD/OpenTTD
(svn r3266) -Codechange: added comments for why the revert of r3625 inside the code.
Also, I forgot to tnx GraphiteNL for his help with this problem. Tnx GraphiteNL :)release/0.4.5
parent
af87b2916a
commit
4f9bb11846
|
@ -7,12 +7,20 @@
|
||||||
# include "ai.h"
|
# include "ai.h"
|
||||||
|
|
||||||
/* This is how we call events (with safety-check) to GPMI */
|
/* This is how we call events (with safety-check) to GPMI */
|
||||||
|
/* XXX -- This macro works only for some compilers (all GCCs for example).
|
||||||
|
* Some compilers on the other hand (MSCV!!) doesn't support variadic macros
|
||||||
|
* causing this to fail. There is no known solution. If you know any, please
|
||||||
|
* tell us ASAP! */
|
||||||
# define ai_event(player, event, ...) \
|
# define ai_event(player, event, ...) \
|
||||||
if ((player) < MAX_PLAYERS && _ai_player[(player)].module != NULL) \
|
if ((player) < MAX_PLAYERS && _ai_player[(player)].module != NULL) \
|
||||||
gpmi_event(_ai_player[(player)].module, (event), ##__VA_ARGS__)
|
gpmi_event(_ai_player[(player)].module, (event), ##__VA_ARGS__)
|
||||||
|
|
||||||
#else /* GPMI */
|
#else /* GPMI */
|
||||||
|
|
||||||
|
/* XXX -- Some compilers (like MSVC :() doesn't support variadic macros,
|
||||||
|
* which means we have to go to a lot of trouble to get the ai_event() ignored
|
||||||
|
* in case GPMI is disabled... KILL KILL KILL!
|
||||||
|
*/
|
||||||
# ifdef DEF_EVENTS
|
# ifdef DEF_EVENTS
|
||||||
void CDECL empty_function(PlayerID player, int event, ...) {}
|
void CDECL empty_function(PlayerID player, int event, ...) {}
|
||||||
# else
|
# else
|
||||||
|
|
Loading…
Reference in New Issue