File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -733,8 +733,14 @@ void RegisterVCMPCallbacks() {
733733 }
734734 std::string data (message);
735735 std::vector<std::string> args = std::split (data, ' ' );
736+ std::string command;
737+ if (args.size () > 0 )
738+ {
739+ command = args.at (0 );
740+ args.erase (args.begin ());
741+ }
736742 for (auto fn : handlers) {
737- if (args .size () < = 0 ) { // No command at all? Pass nil
743+ if (command .size () = = 0 ) { // No command at all? Pass nil
738744 sol::function_result r = fn (player, sol::lua_nil, sol::lua_nil);
739745 if (!r.valid ()) {
740746 sol::error e = r;
@@ -747,8 +753,6 @@ void RegisterVCMPCallbacks() {
747753 }
748754 }
749755 else {
750- std::string command = args.at (0 );
751- args.erase (args.begin ());
752756 if (args.size () > 0 ) {
753757 sol::function_result r = fn (player, command, sol::as_table_t <std::vector<std::string>>(args));
754758 if (!r.valid ()) {
You can’t perform that action at this time.
0 commit comments