Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UEF M5 Fix SMD check bug #441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

maudlin27
Copy link
Contributor

Fix bug when checking for units with SMD:
-Previous code would error out if no units in the rectangle -Also included unnecessary logic to get local units before replacing local units immediately after -also didn't appear to actually check for the categories wanted

Error that prompted this change:
WARNING: Error running lua script: ...alliance\maps\scca_coop_e05\scca_coop_e05_script.lua(485): attempt to loop over local `units' (a nil value)
stack traceback:
...alliance\maps\scca_coop_e05\scca_coop_e05_script.lua(485): in function <...alliance\maps\scca_coop_e05\scca_coop_e05_script.lua:477>

Fix bug when checking for units with SMD:
-Previous code would error out if no units in the rectangle
-Also included unnecessary logic to get local units before replacing local units immediately after
-also didn't appear to actually check for the categories wanted
@speed2CZ
Copy link
Member

You should keep the first way of getting the units, you dont need to change the if condition then

@maudlin27
Copy link
Contributor Author

I'd still be changing the if condition to add the check that the unit has GetTacticalSiloAmmoCount, otherwise it could error out. This way also minimises the changes made to the original code approach (I don't think it ends up mattering in this case since ultimately it's just a case of whether a check is made re if the SMD are built by players 1-4 or not, but as a general approach I find the risk of unexpected consequences is lower if trying to follow the original code approach, unless there's a good reason not to)

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.

None yet

2 participants