diff --git a/source/src/physics.cpp b/source/src/physics.cpp index cefd3ec3..36d66cf0 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -61,7 +61,7 @@ float raycube(const vec &o, const vec &ray, vec &surface) physent *hitplayer = NULL; -bool plcollide(physent *d, physent *o, float &headspace, float &hi, float &lo) // collide with player or monster +bool plcollide(physent *d, physent *o, float &headspace, float &hi, float &lo) // collide with physent { if(o->state!=CS_ALIVE) return true; const float r = o->radius+d->radius, dx = o->o.x-d->o.x, dy = o->o.y-d->o.y; @@ -182,9 +182,9 @@ bool collide(physent *d, bool spawn, float drop, float rise) if(!plcollide(d, o, headspace, hi, lo)) return false; } - if(d!=player1 && !(d->type==ENT_BOUNCE && ((bounceent *)d)->bouncestate==NADE_ACTIVATED || ((bounceent *)d)->bouncestate==NADE_THROWED)) if(!plcollide(d, player1, headspace, hi, lo)) return false; - headspace -= 0.01f; + if(d!=player1) if(!plcollide(d, player1, headspace, hi, lo)) return false; + headspace -= 0.01f; mmcollide(d, hi, lo); // collide with map models if(spawn) diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 2d2bdf61..56eea83e 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -769,9 +769,13 @@ struct grenades : weapon const float speed = cosf(RAD*owner->pitch); vec vel(sinf(RAD*owner->yaw)*speed, -cosf(RAD*owner->yaw)*speed, sinf(RAD*owner->pitch)); vel.mul(1.5f); + vec from(vel); - from.mul(1.1f*owner->radius); - from.add(owner->o); + from.normalize(); + from.mul(owner->radius+inhandnade->radius); + from.mul(1.8f); + from.add(owner->o); + thrownade(from, vel, inhandnade); owner->attacking = false; }