]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cgame.c
qw support is 99% working
[xonotic/darkplaces.git] / cgame.c
diff --git a/cgame.c b/cgame.c
index 98d9a16cf6921756ec498bf32cbdb690de1ceb01..5dab064b8949b89a712dc1e73f0bd9ae758a187e 100644 (file)
--- a/cgame.c
+++ b/cgame.c
@@ -48,7 +48,7 @@ static localentity_t *entspawn(void)
 {
        int i, best;
        float bestfreetime;
-       bestfreetime = gametime + 100.0f;
+       bestfreetime = (float) (gametime + 100.0);
        best = -1;
        for (i = 0;i < MAX_LOCALENTITIES;i++)
        {
@@ -72,7 +72,7 @@ static localentity_t *entspawn(void)
 static void entremove(localentity_t *e)
 {
        int i;
-       i = (e - localentity) / sizeof(localentity_t);
+       i = (int)((e - localentity) / sizeof(localentity_t));
        if (i < 0 || i >= MAX_LOCALENTITIES)
                return; // this should be an error
        //memset(e, 0, sizeof(*e));
@@ -336,10 +336,10 @@ static void net_gibshower(unsigned char num)
 // called by engine
 void CG_Init(void)
 {
-       localentity = CGVM_Malloc(sizeof(*localentity) * MAX_LOCALENTITIES);
-       localentityactive = CGVM_Malloc(sizeof(*localentityactive) * MAX_LOCALENTITIES);
-       localentityfreetime = CGVM_Malloc(sizeof(*localentityfreetime) * MAX_LOCALENTITIES);
-       phys_entity = CGVM_Malloc(sizeof(*phys_entity) * MAX_LOCALENTITIES);
+       localentity = (localentity_t *)CGVM_Malloc(sizeof(*localentity) * MAX_LOCALENTITIES);
+       localentityactive = (unsigned char *)CGVM_Malloc(sizeof(*localentityactive) * MAX_LOCALENTITIES);
+       localentityfreetime = (float *)CGVM_Malloc(sizeof(*localentityfreetime) * MAX_LOCALENTITIES);
+       phys_entity = (cgphysentity_t *)CGVM_Malloc(sizeof(*phys_entity) * MAX_LOCALENTITIES);
        CGVM_RegisterNetworkCode(1, net_explosion);
        CGVM_RegisterNetworkCode(2, net_gibshower);
        gametime = 0;