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

Add default values to TeleportEntity #1167

Merged
merged 1 commit into from
Feb 26, 2020
Merged

Add default values to TeleportEntity #1167

merged 1 commit into from
Feb 26, 2020

Conversation

Scags
Copy link
Contributor

@Scags Scags commented Feb 1, 2020

Seems appropriate to me.
Now you'd be able to do something like:

float ang[3] = {-90.0, 0.0, 0.0};
TeleportEntity(client, .angles = ang);

With less taps on the keyboard.

@Headline
Copy link
Member

Headline commented Feb 7, 2020

I'm not sure if this is something we should consider promoting for the future of sourcepawn. @dvander can we get your input on this syntax and if it's something we're keeping?

@Headline Headline added the Feature Request user requested feature label Feb 7, 2020
@Scags
Copy link
Contributor Author

Scags commented Feb 7, 2020

Regardless of whether or not named parameter operators are going to be kept, would that be a factor in implementing this pr? I think that defaulted null vectors would be beneficial, with tossing '.' around being a bonus.

@Headline
Copy link
Member

Headline commented Feb 7, 2020

I believe so, I can’t think off the top of my head where else in the scripting api we’d promote using this syntax. I like the idea, but I want to make sure that it’s something we can move forward with

Thanks!

@dvander
Copy link
Member

dvander commented Feb 26, 2020

Sorry for the late reply - yes, I'm a big fan of this syntax. It greatly improves readability. And it's worth the implementation cost, which is small.

@dvander dvander merged commit 2b6833f into alliedmodders:master Feb 26, 2020
@KyleSanderson
Copy link
Member

Indeed - the more places where we can make scripting easier on people the better off we will be in the long run. Big proponent of sane, default values.

rumblefrog added a commit to rumblefrog/sp-gid that referenced this pull request Feb 27, 2020
TeleportEntity def value: alliedmodders/sourcemod#1167
MatchRegex added offset param: alliedmodders/sourcemod#1175
IsServerProcessing documentation wording: alliedmodders/sourcemod#1188
TR_EnumerateEntities(Sphere/Box/Point): alliedmodders/sourcemod#1145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request user requested feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants