Skip to content

feat(client/api): Add zones single option support#143

Merged
thelindat merged 1 commit into
overextended:mainfrom
Moozdzn:fix(zones)-support-single-option
May 4, 2024
Merged

feat(client/api): Add zones single option support#143
thelindat merged 1 commit into
overextended:mainfrom
Moozdzn:fix(zones)-support-single-option

Conversation

@Moozdzn

@Moozdzn Moozdzn commented Apr 11, 2024

Copy link
Copy Markdown
Contributor

Add single option and option type checks to zones api

This PR addresses the issue where the zones api would not have the same single option support nor do the same options type checks as the functions that use addTarget

Changes Made

  • Moved typeError function to the top of the file
  • Moved the addTarget options type checks into its own checkOptions function at the top of the file
  • Use checkOptions in addPolyZone, addBoxZone, addSphereZone, addTarget

Testing

  • Tested addBoxZone and addModel with:
    • Wrong type, empty table, single option, array of options

@thelindat

Copy link
Copy Markdown
Member

Not a fix though.

I only added options support because I got sick of people renaming qtarget/qbtarget exports and keeping the format the same. Zones never had that.

@Moozdzn

Moozdzn commented Apr 11, 2024

Copy link
Copy Markdown
Contributor Author

I wasnt sure if it was a fix or a new feature. went with fix because I thought maybe it got overlooked. For consistency I think it should be supported, but if not then maybe something in the docs mentioning different functionality between zones and entities

@thelindat

Copy link
Copy Markdown
Member

I don't even think docs mention the hashmap being valid for options arg. Considering the number of numbskulls constantly complaining about such a dumb and well documented thing I don't mind merging but it's really more of a feature.

@Moozdzn Moozdzn changed the title fix(api/zones): Support single option feat(api/zones): Support single option Apr 11, 2024
@Moozdzn

Moozdzn commented Apr 11, 2024

Copy link
Copy Markdown
Contributor Author

Docs just mention table
Updated the title

Edit: In the options page it does mention array of options but the variable options under each function just say table

@Moozdzn Moozdzn changed the title feat(api/zones): Support single option feat(client/api): Add zones single option support Apr 11, 2024
@thelindat thelindat merged commit cd292c9 into overextended:main May 4, 2024
@Moozdzn Moozdzn deleted the fix(zones)-support-single-option branch May 4, 2024 15:01
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.

2 participants