]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fixed flawed comparison in VM_CL_gettagindex that always reported the first precached...
authorres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 2 Jan 2008 01:03:41 +0000 (01:03 +0000)
committerres <res@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 2 Jan 2008 01:03:41 +0000 (01:03 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7891 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c

index 254b4b6c0bc15810d30c92dc2c8696f76e86d5fa..e21d090d362d70d20a0ff7054a6fcd3c64bdd605 100644 (file)
@@ -2179,10 +2179,8 @@ static void VM_CL_gettagindex (void)
        }
 
        modelindex = (int)ent->fields.client->modelindex;
-       if(modelindex < 0)
-               modelindex = -(modelindex+1);
        tag_index = 0;
-       if (modelindex <= 0 || modelindex >= MAX_MODELS)
+       if (modelindex >= MAX_MODELS || (modelindex <= -MAX_MODELS /* client models */))
                Con_DPrintf("gettagindex(entity #%i): null or non-precached model\n", PRVM_NUM_FOR_EDICT(ent));
        else
        {