3939const char * pr2_ent_data_ptr ;
4040vm_t * sv_vm = NULL ;
4141extern gameData_t gamedata ;
42+ #ifdef FTE_PEXT_CSQC
43+ extern sizebuf_t * csqcmsgbuffer ;
44+ #endif
4245
4346static int PASSFLOAT (float f )
4447{
@@ -59,6 +62,9 @@ static float GETFLOAT(int i)
5962typedef intptr_t (* ext_syscall_t )(intptr_t * arg );
6063static intptr_t EXT_GetSoundIndex (intptr_t * args );
6164static intptr_t EXT_GetModelIndex (intptr_t * args );
65+ #ifdef FTE_PEXT_CSQC
66+ static intptr_t EXT_SetSendNeeded (intptr_t * args );
67+ #endif
6268static intptr_t EXT_MapExtFieldPtr (intptr_t * args );
6369static intptr_t EXT_SetExtFieldPtr (intptr_t * args );
6470static intptr_t EXT_GetExtFieldPtr (intptr_t * args );
7379 {"GetExtFieldPtr" , EXT_GetExtFieldPtr },
7480 {"getsoundindex" , EXT_GetSoundIndex },
7581 {"getmodelindex" , EXT_GetModelIndex },
82+ #ifdef FTE_PEXT_CSQC
83+ {"setsendneeded" , EXT_SetSendNeeded },
84+ #endif
7685};
7786ext_syscall_t ext_syscall_tbl [256 ];
7887
@@ -1177,6 +1186,9 @@ MESSAGE WRITING
11771186#define MSG_ALL 2 // reliable to all
11781187#define MSG_INIT 3 // write to the init string
11791188#define MSG_MULTICAST 4 // for multicast()
1189+ #ifdef FTE_PEXT_CSQC
1190+ #define MSG_CSQC 5 // for csqc
1191+ #endif
11801192
11811193
11821194sizebuf_t * WriteDest2 (int dest )
@@ -1213,6 +1225,9 @@ sizebuf_t *WriteDest2(int dest)
12131225 case MSG_MULTICAST :
12141226 return & sv .multicast ;
12151227
1228+ case MSG_CSQC :
1229+ return csqcmsgbuffer ;
1230+
12161231 default :
12171232 PR2_RunError ("WriteDest: bad destination" );
12181233 break ;
@@ -1990,6 +2005,36 @@ intptr_t PF2_FS_GetFileList(char *path, char *ext,
19902005 return numfiles ;
19912006}
19922007
2008+ #ifdef FTE_PEXT_CSQC
2009+ intptr_t EXT_SetSendNeeded (intptr_t * args )
2010+ {
2011+ unsigned int subject = args [1 ];
2012+ unsigned int fl = args [2 ];
2013+ unsigned int to = args [3 ];
2014+
2015+ if (!to )
2016+ { //broadcast
2017+ for (to = 0 ; to < MAX_CLIENTS ; to ++ )
2018+ {
2019+ svs .clients [to ].csqcentitysendflags [subject ] |= fl ;
2020+ }
2021+ }
2022+ else
2023+ {
2024+ to -- ;
2025+ if (to >= MAX_CLIENTS )
2026+ {
2027+ ; //some kind of error.
2028+ }
2029+ else
2030+ {
2031+ svs .clients [to ].csqcentitysendflags [subject ] |= fl ;
2032+ }
2033+ }
2034+ return 0 ;
2035+ }
2036+ #endif
2037+
19932038static intptr_t EXT_GetModelIndex (intptr_t * args )
19942039{
19952040 int model_num ;
@@ -2105,6 +2150,14 @@ static intptr_t EXT_MapExtFieldPtr(intptr_t *args)
21052150 {
21062151 return offsetof(ext_entvars_t , colourmod ) | GetExtFieldCookie ();
21072152 }
2153+ if (!strcmp (key , "SendEntity" ))
2154+ {
2155+ return offsetof(ext_entvars_t , sendentity ) | GetExtFieldCookie ();
2156+ }
2157+ if (!strcmp (key , "pvsflags" ))
2158+ {
2159+ return offsetof(ext_entvars_t , pvsflags ) | GetExtFieldCookie ();
2160+ }
21082161 }
21092162
21102163 return 0 ;
0 commit comments