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

Double command execution #217

Closed
bretonium opened this issue Oct 15, 2018 · 2 comments
Closed

Double command execution #217

bretonium opened this issue Oct 15, 2018 · 2 comments

Comments

@bretonium
Copy link
Contributor

  1. Login as moderator/aministrator
  2. Execute command "status"

Expected: the command is executed once
Actual: the command is executed twice

In commit 09e0202 the following lines were added:
`
diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp
index c8711f9..2d7398b 100644
--- a/src/engine/shared/console.cpp
+++ b/src/engine/shared/console.cpp
@@ -372,6 +372,10 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
Print(OUTPUT_LEVEL_STANDARD, "Console", "Invalid arguments.");
Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf);
}

  •                                           else
    
  •                                           pCommand->m_pfnCallback(&Result, pCommand->m_pUserData);
    
  •                                           return;
                                      }
                              }
                      }
    

`

This leads to double execution of commands in console. Any idea why it was added? Can we remove it?

@bretonium
Copy link
Contributor Author

Oh well.

diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp
index c8711f9..2d7398b 100644
--- a/src/engine/shared/console.cpp
+++ b/src/engine/shared/console.cpp
@@ -372,6 +372,10 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo
                                                        Print(OUTPUT_LEVEL_STANDARD, "Console", "Invalid arguments.");
                                                        Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf);
                                                }
+                                               else
+                                               pCommand->m_pfnCallback(&Result, pCommand->m_pUserData);
+
+                                               return;
                                        }
                                }
                        }

@progval
Copy link
Collaborator

progval commented Oct 15, 2018

So that's what was causing that bug! Thanks! Fixed in 1e9d7be.

@progval progval closed this as completed Oct 15, 2018
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

No branches or pull requests

2 participants