Skip to content

Commit

Permalink
Ship: fix assert when manually firing a missile
Browse files Browse the repository at this point in the history
- When pressing the keybind to launch a missile, Ship:FireMissileAt was not checking the validity of a missile object
  • Loading branch information
sturnclaw committed Jan 8, 2025
1 parent c40358f commit f31402d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/libs/Ship.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ function Ship:FireMissileAt(missile, target)
missile = equipSet:GetInstalledOfType("missile")[1]
end

-- No missile available to fire, likely this function was called from a C++ action binding
if not missile then
return nil
end

-- FIXME: handle multiple-count missile mounts
equipSet:Remove(missile)

Expand Down

0 comments on commit f31402d

Please sign in to comment.