2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 17:04:55 +00:00

Merge pull request #54 from lioncash/overrun

DNAMP1/CTweakPlayerGun: Prevent array overrun cases
This commit is contained in:
2019-09-06 23:20:02 -07:00
committed by GitHub

View File

@@ -89,14 +89,16 @@ struct CTweakPlayerGun final : ITweakPlayerGun {
}
const SWeaponInfo& GetBeamInfo(atInt32 beam) const override {
if (beam < 0 || beam > 5)
if (beam < 0 || beam >= 5) {
return xa8_beams[0];
}
return xa8_beams[beam];
}
const SComboShotParam& GetComboShotInfo(atInt32 beam) const override {
if (beam < 0 || beam > 5)
if (beam < 0 || beam >= 5) {
return x1f0_combos[0];
}
return x1f0_combos[beam];
}