]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix getsurfacetriangle on a submodel
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Feb 2010 14:35:33 +0000 (14:35 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Feb 2010 14:35:33 +0000 (14:35 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9969 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index 0e9e94aeabe5fd5369bd4dd709990f387767853a..bd6b426ac236425423aa60e2d494c201d206ae84 100644 (file)
@@ -6381,6 +6381,7 @@ void VM_getsurfacenumtriangles(void)
 //PF_getsurfacetriangle,     // #??? vector(entity e, float s, float n) getsurfacetriangle = #???;
 void VM_getsurfacetriangle(void)
 {
+       const vec3_t d = {-1, -1, -1};
        prvm_edict_t *ed;
        dp_model_t *model;
        msurface_t *surface;
@@ -6394,5 +6395,5 @@ void VM_getsurfacetriangle(void)
        if (trinum < 0 || trinum >= surface->num_triangles)
                return;
        // FIXME: implement rotation/scaling
-       VectorCopy(&(model->surfmesh.data_element3i + 3 * surface->num_firsttriangle)[trinum * 3], PRVM_G_VECTOR(OFS_RETURN));
+       VectorMA(&(model->surfmesh.data_element3i + 3 * surface->num_firsttriangle)[trinum * 3], surface->num_firstvertex, d, PRVM_G_VECTOR(OFS_RETURN));
 }