johnbartholomew/pioneer — comment on commit 38855190946dbaa38a817c342d74dc362c66655d
File: data/models/ships/sidewinder/sidewinder.lua line 65
By johnbartholomew:

I haven't decided how best to solve this in the general case. For this particular case of checking whether any laser is equipped the script can just use `if get_equipment('LASER', 1) then`, since the only equipment that could be mounted in that slot would be one of the laser types. A couple of models (constrictor and asp_sparks) do some maths on the laser type code (more powerful lasers are scaled up), that could change to a lookup table approach, which would be more code but also more explicit and flexible.