]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
add cvars for world erp and cfm; remove pistons for ODE 0.9 support
[xonotic/darkplaces.git] / sv_main.c
index bcd38766ee403abfe880e9bb51a3740fddb2498e..ac717fab2507e571c6aa3e95987ff4462a68050f 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -303,13 +303,13 @@ prvm_required_field_t reqfields[] =
        //{ev_float, "modelindex"},
        {ev_vector, "mass"},
        //{ev_vector, "origin"},
-       //{ev_vector, "angles"},
-       {ev_vector, "axis_forward"},
-       {ev_vector, "axis_left"},
-       {ev_vector, "axis_up"},
-       //{ev_vector, "angles"},
        //{ev_vector, "velocity"},
-       {ev_vector, "spinvelocity"},
+       //{ev_vector, "axis_forward"},
+       //{ev_vector, "axis_left"},
+       //{ev_vector, "axis_up"},
+       //{ev_vector, "spinvelocity"},
+       //{ev_vector, "angles"},
+       //{ev_vector, "avelocity"},
 
 };
 
@@ -1239,7 +1239,7 @@ static qboolean SV_PrepareEntityForSending (prvm_edict_t *ent, entity_state_t *c
                        VectorMA(cs->origin, scale, model->rotatedmins, cullmins);
                        VectorMA(cs->origin, scale, model->rotatedmaxs, cullmaxs);
                }
-               else if (cs->angles[1])
+               else if (cs->angles[1] || ((effects | model->effects) & EF_ROTATE))
                {
                        VectorMA(cs->origin, scale, model->yawmins, cullmins);
                        VectorMA(cs->origin, scale, model->yawmaxs, cullmaxs);
@@ -1429,18 +1429,21 @@ qboolean SV_CanSeeBox(int numtraces, vec_t enlarge, vec3_t eye, vec3_t entboxmin
                {
                        touch = touchedicts[touchindex];
                        modelindex = (unsigned int)touch->fields.server->modelindex;
-                       model = sv.models[(int)touch->fields.server->modelindex];
-                       // get the entity matrix
-                       pitchsign = (model->type == mod_alias) ? -1 : 1;
-                       Matrix4x4_CreateFromQuakeEntity(&matrix, touch->fields.server->origin[0], touch->fields.server->origin[1], touch->fields.server->origin[2], pitchsign * touch->fields.server->angles[0], touch->fields.server->angles[1], touch->fields.server->angles[2], 1);
-                       Matrix4x4_Invert_Simple(&imatrix, &matrix);
-                       // see if the ray hits this entity
-                       Matrix4x4_Transform(&imatrix, eye, starttransformed);
-                       Matrix4x4_Transform(&imatrix, endpoints[traceindex], endtransformed);
-                       if (!model->brush.TraceLineOfSight(model, starttransformed, endtransformed))
+                       model = (modelindex >= 1 && modelindex < MAX_MODELS) ? sv.models[(int)touch->fields.server->modelindex] : NULL;
+                       if(model && model->brush.TraceLineOfSight)
                        {
-                               blocked++;
-                               break;
+                               // get the entity matrix
+                               pitchsign = SV_GetPitchSign(touch);
+                               Matrix4x4_CreateFromQuakeEntity(&matrix, touch->fields.server->origin[0], touch->fields.server->origin[1], touch->fields.server->origin[2], pitchsign * touch->fields.server->angles[0], touch->fields.server->angles[1], touch->fields.server->angles[2], 1);
+                               Matrix4x4_Invert_Simple(&imatrix, &matrix);
+                               // see if the ray hits this entity
+                               Matrix4x4_Transform(&imatrix, eye, starttransformed);
+                               Matrix4x4_Transform(&imatrix, endpoints[traceindex], endtransformed);
+                               if (!model->brush.TraceLineOfSight(model, starttransformed, endtransformed))
+                               {
+                                       blocked++;
+                                       break;
+                               }
                        }
                }
                // check if the ray was blocked
@@ -3290,6 +3293,7 @@ static void SV_VM_CB_FreeEdict(prvm_edict_t *ed)
        ed->fields.server->solid = 0;
 
        World_Physics_RemoveFromEntity(&sv.world, ed);
+       World_Physics_RemoveJointFromEntity(&sv.world, ed);
 
        // make sure csqc networking is aware of the removed entity
        e = PRVM_NUM_FOR_EDICT(ed);