All pastes #940671 Raw Edit

ufo:ai cl_parse.c patch

public text v1 · immutable
·published 2008-03-13 04:26 UTC
rendered paste body
Index: cl_le.c
===================================================================
--- cl_le.c	(revision 15707)
+++ cl_le.c	(working copy)
@@ -862,6 +862,9 @@
 	switch (le->type) {
 	case ET_ROTATING:
 	case ET_DOOR:
+		VectorCopy(ent->mins, le->mins);
+		VectorCopy(ent->maxs, le->maxs);
+		VectorCopy(ent->origin, le->origin);
 		break;
 	case ET_BREAKABLE:
 		break;
@@ -1042,6 +1045,10 @@
 				break;
 			}
 
+			if (le->type == ET_DOOR) {
+				VectorCopy(le->origin, ent.origin);
+				VectorCopy(le->origin, ent.oldorigin);
+			}
 
 			/**
 			 * Offset the model to be inside the cursor box
Index: cl_parse.c
===================================================================
--- cl_parse.c	(revision 15707)
+++ cl_parse.c	(working copy)
@@ -769,6 +769,8 @@
 	le->levelflags = levelflags;
 	le->addFunc = LE_BrushModelAction;
 	le->think = LET_BrushModel;
+	/* The origin is REQUIRED for tdoors to work! */
+	VectorCopy(origin, le->origin);
 
 	Com_sprintf(le->inlineModelName, sizeof(le->inlineModelName), "*%i", le->modelnum1);
 	model = cl.model_clip[le->modelnum1];
@@ -798,6 +800,7 @@
 	ent->alpha = 1.0;
 	VectorCopy(le->mins, ent->mins);
 	VectorCopy(le->maxs, ent->maxs);
+	VectorCopy(le->origin, ent->origin);
 	return qtrue;
 }