1
0
Fork 0
forked from fte/fteqw

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
This commit is contained in:
Spoike 2010-03-19 03:22:19 +00:00
parent 12b52d6e11
commit 8765f5cd62

View file

@ -1556,7 +1556,7 @@ static void World_Physics_Frame_JointFromEntity(world_t *world, wedict_t *ed)
if(enemy) if(enemy)
b1 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, enemy))->ode.ode_body); b1 = (dBodyID)(((wedict_t*)EDICT_NUM(world->progs, enemy))->ode.ode_body);
if(aiment) 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); dJointAttach(j, b1, b2);
switch(jointtype) switch(jointtype)
@ -1659,7 +1659,7 @@ static qboolean GenerateCollisionMesh(world_t *world, model_t *mod, wedict_t *ed
} }
if (!numindexes) 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; return false;
} }
ed->ode.ode_element3i = BZ_Malloc(numindexes*sizeof(index_t)); 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) 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)); 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)) 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]); Matrix4Q_CreateTranslate(ed->ode.ode_offsetmatrix, geomcenter[0], geomcenter[1], geomcenter[2]);
// now create the geom // now create the geom