]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progsvm.h
Host_Shutdown now calls CL_Disconnect and Host_ShutdownServer so that quitting withou...
[xonotic/darkplaces.git] / progsvm.h
index 2bd376a4f88a7b671d756b3604a06871b0acecf7..f9c1666a803a2139a77ef20c3c6b6ceff26aa1de 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -170,7 +170,27 @@ typedef struct prvm_edict_s
 {
        // engine-private fields (stored in dynamically resized array)
        //edict_engineprivate_t *e;
-       prvm_edict_private_t *e;
+       union 
+       {
+               prvm_edict_private_t *e;
+               void                             *vp;
+               // add other private structs as you desire
+               // new structs have to start with the elements of prvm_edit_private_t
+               // e.g. a new struct has to either look like this:
+               //      typedef struct server_edict_private_s {
+               //              prvm_edict_private_t base;
+               //              vec3_t moved_from;
+               //      vec3_t moved_fromangles;
+               //              ... } server_edict_private_t;
+               // or:
+               //      typedef struct server_edict_private_s {
+               //              qboolean free;
+               //              float freetime;
+               //              vec3_t moved_from;
+               //      vec3_t moved_fromangles;
+               //              ... } server_edict_private_t;
+               // However, the first one should be preferred.
+       } p;
        // QuakeC fields (stored in dynamically resized array)
        //entvars_t *v;
        void *v;
@@ -375,7 +395,7 @@ void PRVM_ED_ClearEdict (prvm_edict_t *e);
 char *PRVM_ED_NewString (const char *string);
 // returns a copy of the string allocated from the server's string heap
 
-void PRVM_ED_Print (prvm_edict_t *ed);
+void PRVM_ED_Print(prvm_edict_t *ed);
 void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed);
 const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent);
 
@@ -388,7 +408,7 @@ prvm_edict_t *PRVM_EDICT_NUM_ERROR(int n, char *filename, int fileline);
 #define        PRVM_EDICT_NUM(n) (((n) >= 0 && (n) < prog->max_edicts) ? prog->edicts + (n) : PRVM_EDICT_NUM_ERROR(n, __FILE__, __LINE__))
 
 //int NUM_FOR_EDICT_ERROR(edict_t *e);
-#define PRVM_NUM_FOR_EDICT(e) ((prvm_edict_t *)(e) - prog->edicts)
+#define PRVM_NUM_FOR_EDICT(e) ((int)((prvm_edict_t *)(e) - prog->edicts))
 //int NUM_FOR_EDICT(edict_t *e);
 
 #define        PRVM_NEXT_EDICT(e) ((e) + 1)
@@ -423,7 +443,7 @@ void PRVM_ED_PrintEdicts_f (void);
 void PRVM_ED_PrintNum (int ent);
 
 #define PRVM_GetString(num) (prog->strings + num)
-#define PRVM_SetString(s)   ((int) (s) ? (s - prog->strings) : 0)
+#define PRVM_SetString(s)   ((s) != NULL ? (int) (s - prog->strings) : 0)
 
 //============================================================================