From 8765f5cd6202fcc4715ad95c653bedd9e7c33aed Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 19 Mar 2010 03:22:19 +0000 Subject: [PATCH] Minor fixes for spam with all-water entities, joints, and compiler warnings. git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3519 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/com_phys_ode.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/engine/common/com_phys_ode.c b/engine/common/com_phys_ode.c index 42580b9c1..25fb12b2a 100644 --- a/engine/common/com_phys_ode.c +++ b/engine/common/com_phys_ode.c @@ -1556,7 +1556,7 @@ static void World_Physics_Frame_JointFromEntity(world_t *world, wedict_t *ed) if(enemy) b1 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, enemy))->ode.ode_body); if(aiment) - b2 = (dBodyID)world->edicts[aiment].ode.ode_body; + b2 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, aiment))->ode.ode_body); dJointAttach(j, b1, b2); switch(jointtype) @@ -1659,7 +1659,7 @@ static qboolean GenerateCollisionMesh(world_t *world, model_t *mod, wedict_t *ed } if (!numindexes) { - Con_Printf("entity %i (classname %s) has no geometry\n", NUM_FOR_EDICT(world->progs, (edict_t*)ed), PR_GetString(world->progs, ed->v->classname)); + Con_DPrintf("entity %i (classname %s) has no geometry\n", NUM_FOR_EDICT(world->progs, (edict_t*)ed), PR_GetString(world->progs, ed->v->classname)); return false; } ed->ode.ode_element3i = BZ_Malloc(numindexes*sizeof(index_t)); @@ -1848,10 +1848,16 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, wedict_t *ed) if (!model) { Con_Printf("entity %i (classname %s) has no model\n", NUM_FOR_EDICT(world->progs, (edict_t*)ed), PR_GetString(world->progs, ed->v->classname)); - break; + if (ed->ode.ode_physics) + World_Physics_RemoveFromEntity(world, ed); + return; } if (!GenerateCollisionMesh(world, model, ed, geomcenter)) - break; + { + if (ed->ode.ode_physics) + World_Physics_RemoveFromEntity(world, ed); + return; + } Matrix4Q_CreateTranslate(ed->ode.ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]); // now create the geom