mirror of
https://github.com/diamante0018/PP-GSC.git
synced 2025-04-22 13:15:42 +00:00
init
This commit is contained in:
commit
19894715b1
6
README.md
Normal file
6
README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Reusable preprocessor directives for GSC
|
||||||
|
|
||||||
|
## What is this?
|
||||||
|
|
||||||
|
This is a collection of useful preprocessor directives that can be used by gsc-tool, Plutonium clients and XLabs clients.
|
||||||
|
It is also possible to use gsc-tool to expand these macros and produce a gsc file that is readable by older GSC compilers that do not have a preprocessor.
|
40
_utility.gsh
Normal file
40
_utility.gsh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#define TRUE 1
|
||||||
|
#define FALSE 0
|
||||||
|
|
||||||
|
#define ZERO_VEC3 (0, 0, 0)
|
||||||
|
|
||||||
|
#define GENERIC_INIT \
|
||||||
|
init() \
|
||||||
|
{ \
|
||||||
|
thread onPlayerConnect(); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define WAIT_CNT(ent) level waittill ( "connected", ent )
|
||||||
|
|
||||||
|
#define WAIT_ANY_RET(ent, ...) \
|
||||||
|
ent common_scripts\utility::waittill_any_return( __VA_ARGS__ )
|
||||||
|
|
||||||
|
#define PLAYER_NOTIFY_CMD(ent, str, action) ent notifyOnPlayerCommand( str, action )
|
||||||
|
|
||||||
|
/* Tweak as necessary. Can be return, continue or break */
|
||||||
|
#define CHK_ACTION continue
|
||||||
|
|
||||||
|
#ifdef IW4
|
||||||
|
#define BOT_CHK(ent) \
|
||||||
|
if ( ent isBot() ) \
|
||||||
|
{ \
|
||||||
|
CHK_ACTION; \
|
||||||
|
}
|
||||||
|
#else /* Valid for Plutinium IW5 with bot warfare */
|
||||||
|
#define BOT_CHK(ent) \
|
||||||
|
if ( isDefined( ent.pers["isBot"] ) && ent.pers["isBot"] ) \
|
||||||
|
{ \
|
||||||
|
CHK_ACTION; \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DEFINE_CHK(x) \
|
||||||
|
if ( !isDefined( (x) ) ) \
|
||||||
|
{ \
|
||||||
|
CHK_ACTION; \
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user