bullet->id = owner->currentWeapon->id;
bullet->dx = dx;
bullet->dy = owner->currentWeapon->dy + dy;
+
+ // Add motion of the player and any platform he/she is on to grenades
+ if (owner->currentWeapon->dy)
+ {
+ int tdx, tdy;
+ getTrainMotion(owner, tdx, tdy);
+ bullet->dx += owner->dx - tdx;
+ bullet->dy += -tdy;
+ }
+
bullet->next = NULL;
bullet->health = owner->currentWeapon->health;
bullet->damage = owner->currentWeapon->damage;
checkSwitchContact(bullet);
- if ((checkTrainContact(bullet, 0)) || (checkObstacleContact(bullet, 0)))
+ if ((checkTrainContact(bullet, DIR_XY)) || (checkObstacleContact(bullet, DIR_XY)))
{
if (bullet->flags & ENT_BOUNCES)
bounceBullet(bullet, dx, dy);