2025-07-20 22:11 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003085Spring engineLuapublic2012-05-11 19:11
ReporterGoogle_Frog 
Assigned TojK 
PrioritynormalSeverityminorReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version88.0 
Target VersionFixed in Version 
Summary0003085: AllowWeaponTarget return ignores visibility
DescriptionIf true is returned from gadget:AllowWeaponTarget the weapon is able to target the targetID regardless of unit visibility. For example a lone cloaked unit within range will be automatically shot at.

This has been worked around by checking for visibility within AllowWeaponTarget but it is a bad workaround because AllowWeaponTarget is called enough to create a performance issue. The below code is just a clarification of

I would like an AllowWeaponTarget that minimises lua calls by only asking about units that Spring would chose as targets if Al
Additional Informationfunction gadget:AllowWeaponTarget(unitID, targetID, ...)

  if unitID can see targetID then
    if unit_I_want_to_handle[unitID] then
      -- do stuff
    else
      return true, 1
    end
  else
    return false, 1
  end
end
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

+Notes

-Issue History
Date Modified Username Field Change
2012-05-11 17:51 Google_Frog New Issue
2012-05-11 19:11 jK Note Added: 0008680
2012-05-11 19:11 jK Status new => resolved
2012-05-11 19:11 jK Resolution open => fixed
2012-05-11 19:11 jK Assigned To => jK
+Issue History