]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - progs.h
sv.edicts (and related things) are now dynamically reallocated as more edicts are...
[xonotic/darkplaces.git] / progs.h
diff --git a/progs.h b/progs.h
index 702c44594baa4ac3b8ed4c54685aa6eb60a85b59..929bd27c0b1a636bd38ddd6b7e33e5fb96038d71 100644 (file)
--- a/progs.h
+++ b/progs.h
@@ -37,7 +37,7 @@ typedef union eval_s
 
 typedef struct link_s
 {
-       void *entity;
+       int entitynumber;
        struct link_s   *prev, *next;
 } link_t;
 
@@ -157,15 +157,19 @@ void ED_ParseGlobals (const char *data);
 
 void ED_LoadFromFile (const char *data);
 
-edict_t *EDICT_NUM_ERROR(int n);
-#define EDICT_NUM(n) ((n >= 0 && n < sv.max_edicts) ? sv.edictstable[(n)] : EDICT_NUM_ERROR(n))
+edict_t *EDICT_NUM_ERROR(int n, char *filename, int fileline);
+#define EDICT_NUM(n) (((n) >= 0 && (n) < sv.max_edicts) ? sv.edictstable[(n)] : EDICT_NUM_ERROR(n, __FILE__, __LINE__))
 
-int NUM_FOR_EDICT(edict_t *e);
+//int NUM_FOR_EDICT_ERROR(edict_t *e);
+#define NUM_FOR_EDICT(e) ((edict_t *)(e) - sv.edicts)
+//int NUM_FOR_EDICT(edict_t *e);
 
 #define        NEXT_EDICT(e) ((e) + 1)
 
-int EDICT_TO_PROG(edict_t *e);
-edict_t *PROG_TO_EDICT(int n);
+#define EDICT_TO_PROG(e) (NUM_FOR_EDICT(e))
+//int EDICT_TO_PROG(edict_t *e);
+#define PROG_TO_EDICT(n) (EDICT_NUM(n))
+//edict_t *PROG_TO_EDICT(int n);
 
 //============================================================================