diff --git a/data/base/stats/weapons.json b/data/base/stats/weapons.json index a9d487b00b7..91de842e2d2 100644 --- a/data/base/stats/weapons.json +++ b/data/base/stats/weapons.json @@ -2957,8 +2957,6 @@ "lightWorld": 1, "longHit": 80, "longRange": 12032, - "maxElevation": 90, - "minElevation": -30, "minRange": 512, "minimumDamage": 33, "missGfx": "FXMExp.PIE", diff --git a/data/mods/campaign/wz2100_camclassic/stats/weapons.json b/data/mods/campaign/wz2100_camclassic/stats/weapons.json index 3055a7cbf17..3f5dccc69c2 100644 --- a/data/mods/campaign/wz2100_camclassic/stats/weapons.json +++ b/data/mods/campaign/wz2100_camclassic/stats/weapons.json @@ -2289,8 +2289,6 @@ "lightWorld": 1, "longHit": 80, "longRange": 12000, - "maxElevation": 90, - "minElevation": -30, "minRange": 512, "minimumDamage": 33, "missGfx": "FXMExp.PIE", diff --git a/data/mp/stats/weapons.json b/data/mp/stats/weapons.json index 03465362bad..cba1c4d0d24 100644 --- a/data/mp/stats/weapons.json +++ b/data/mp/stats/weapons.json @@ -3183,8 +3183,6 @@ "lightWorld": 1, "longHit": 65, "longRange": 1920, - "maxElevation": 90, - "minElevation": -30, "minRange": 256, "minimumDamage": 33, "missGfx": "FXMExp.PIE", @@ -4100,8 +4098,6 @@ "lightWorld": 1, "longHit": 55, "longRange": 1280, - "maxElevation": 90, - "minElevation": -60, "minRange": 128, "minimumDamage": 33, "missGfx": "FXMNExp.PIE", diff --git a/src/projectile.cpp b/src/projectile.cpp index 2e519042f1d..1cfb348b460 100644 --- a/src/projectile.cpp +++ b/src/projectile.cpp @@ -551,15 +551,16 @@ static PROJECTILE* proj_SendProjectileAngledInternal(WEAPON* psWeap, SIMPLE_OBJE proj.state = PROJ_INFLIGHT; // If droid or structure, set muzzle pitch. + // Don't allow pitching the muzzle above outside the weapon's limits. if (psAttacker != nullptr && weapon_slot >= 0) { if (psAttacker->type == OBJ_DROID) { - ((DROID *)psAttacker)->asWeaps[weapon_slot].rot.pitch = proj.rot.pitch; + ((DROID *)psAttacker)->asWeaps[weapon_slot].rot.pitch = (uint16_t)clip(angleDelta(proj.rot.pitch), (int32_t)DEG(psStats->minElevation), (int32_t)DEG(psStats->maxElevation)); } else if (psAttacker->type == OBJ_STRUCTURE) { - ((STRUCTURE *)psAttacker)->asWeaps[weapon_slot].rot.pitch = proj.rot.pitch; + ((STRUCTURE *)psAttacker)->asWeaps[weapon_slot].rot.pitch = (uint16_t)clip(angleDelta(proj.rot.pitch), (int32_t)DEG(psStats->minElevation), (int32_t)DEG(psStats->maxElevation)); } }