Skip to content

Commit

Permalink
calcDroidMuzzleLocation: Sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Aug 23, 2024
1 parent b826514 commit 909b3d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,7 @@ bool calcDroidMuzzleLocation(const DROID *psDroid, Vector3i *muzzle, int weapon_

CHECK_DROID(psDroid);

if (psBodyImd && !psBodyImd->connectors.empty())
if (psBodyImd && static_cast<size_t>(weapon_slot) < psBodyImd->connectors.size())
{
char debugStr[250], debugLen = 0; // Each "(%d,%d,%d)" uses up to 34 bytes, for very large values. So 250 isn't exaggerating.

Expand Down

0 comments on commit 909b3d6

Please sign in to comment.