Creating a variable inside an if statement (C++17)

This commit is contained in:
KaidoRen 2019-05-14 17:16:08 +05:00
parent 5f66e7f190
commit b2c1e7c775

View File

@ -72,9 +72,8 @@ void amx_command()
else else
{ {
auto id = atoi(CMD_ARGV(2)); auto id = atoi(CMD_ARGV(2));
auto plugin = g_plugins.findPlugin(id);
if (auto plugin = g_plugins.findPlugin(id); plugin && plugin->isValid())
if (plugin && plugin->isValid())
{ {
print_srvconsole(" Name: %s\n", plugin->getTitle()); print_srvconsole(" Name: %s\n", plugin->getTitle());
print_srvconsole(" Version: %s\n", plugin->getVersion()); print_srvconsole(" Version: %s\n", plugin->getVersion());