Skip to content

Fix edge case basecommands plugin error#1138

Merged
Headline merged 1 commit intoalliedmodders:masterfrom
sneak-it:basecommands-fix
Feb 7, 2020
Merged

Fix edge case basecommands plugin error#1138
Headline merged 1 commit intoalliedmodders:masterfrom
sneak-it:basecommands-fix

Conversation

@sneak-it
Copy link
Contributor

@sneak-it sneak-it commented Dec 11, 2019

While testing a plugin I was creating, I needed to use sm_rcon to kick myself from the server console to ensure my console check was working as intended.

I found that when using sm_rcon kick me, I got this error:

L 12/10/2019 - 22:53:23: [SM] Exception reported: Client 1 is not connected
L 12/10/2019 - 22:53:23: [SM] Blaming: basecommands.smx
L 12/10/2019 - 22:53:23: [SM] Call stack trace:
L 12/10/2019 - 22:53:23: [SM]   [0] ReplyToCommand
L 12/10/2019 - 22:53:23: [SM]   [1] Line 401, D:\builds\build-sourcemod-msvc12\windows-1.10\build\plugins\basecommands.sp::Command_Rcon

So as the title states, this is an extreme edge case and does not apply when using sm_rcon sm_kick, but I figure a proper IsClientConnected check was in order to not throw an error in an odd case like this.

I also took the liberty of formatting the couple lines leading up to the fix to match the coding style of the rest of the plugin, hope that's okay.

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

Ha, this is an interesting one. Thanks, sneak-y boy!

@Headline Headline merged commit b6a6387 into alliedmodders:master Feb 7, 2020
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