Skip to content

Conversation

emb3rn
Copy link

@emb3rn emb3rn commented Aug 24, 2025

Work done

Hi, this is my first PR/contribution so let me know if there are any issues.

Decided to look into and fix #4207 since it's been there since January and seemed like a good start.

luarules/gadgets/unit_onlytargetcategory.lua
Previously didn't correctly implement a break statement, which meant that the target categories for Thor (and possibly other units) weren't disregarded if there were multiple categories, which is the intended behaviour according to the original comment:

elseif unitOnlyTargetsCategory[udid] ~= category then -- multiple different onlytargetcategory used: disregard

Also removed a random incrementing i = i + 1 which didn't do anything lol

luarules/gadgets/unit_onlytargetempable.lua
Changed the code to only consider a unit to be an "emp unit" if all of it's weapons have a paralyze effect, which sounds logical to me. If a unit has weapons that don't emp/paralyze, then the player should be able to target emp immune enemies as they have normal non emp weapons. The emp weapons will not fire anyway as those are handled elsewhere.

Screenshots:

boom.mp4

com goes boom (with manual click, you can see hold fire is enabled)

Copy link
Author

@emb3rn emb3rn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, let me know if there are any needed changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thor cant rightclick attack commander
1 participant