]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
if an origin brush exists, ALSO take into account the "origin" key (add the two)
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 1 Jan 2009 12:14:01 +0000 (12:14 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 1 Jan 2009 12:14:01 +0000 (12:14 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@143 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/map.c
tools/quake3/q3map2/q3map2.h

index 78c772931d3caf785b5a82b1cc79052f44b121d3..18ab6b216fa8ee0066baa27f95f47aa19214604b 100644 (file)
@@ -595,6 +595,19 @@ produces a final brush based on the buildBrush->sides array
 and links it to the current entity
 */
 
+static void MergeOrigin(entity_t *ent, vec3_t origin)
+{
+       vec3_t adjustment;
+
+       VectorMA(origin, -1, ent->originbrush_origin, adjustment);
+       VectorAdd(adjustment, ent->origin, ent->origin);
+       VectorCopy(origin, ent->originbrush_origin);
+
+       char string[128];
+       sprintf(string, "%f %f %f", ent->origin[0], ent->origin[1], ent->origin[2]);
+       SetKeyValue(ent, "origin", string);
+}
+
 brush_t *FinishBrush( void )
 {
        brush_t         *b;
@@ -621,10 +634,7 @@ brush_t *FinishBrush( void )
                VectorAdd (buildBrush->mins, buildBrush->maxs, origin);
                VectorScale (origin, 0.5, origin);
 
-               sprintf( string, "%i %i %i", (int) origin[ 0 ], (int) origin[ 1 ], (int) origin[ 2 ] );
-               SetKeyValue( &entities[ numEntities - 1 ], "origin", string);
-
-               VectorCopy( origin, entities[ numEntities - 1 ].origin);
+               MergeOrigin(&entities[ numEntities - 1 ], origin);
 
                /* don't keep this brush */
                return NULL;
index 96a8799efc5db8d7b17b855c740a62b2c1552bfc..2fe5f7b883b95b427237dd1a8563f0e2b7e629bb 100644 (file)
@@ -1076,6 +1076,7 @@ typedef struct
        int                                     mapEntityNum, firstDrawSurf;
        int                                     firstBrush, numBrushes;         /* only valid during BSP compile */
        epair_t                         *epairs;
+       vec3_t                          originbrush_origin;
 }
 entity_t;