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

get_user_command skips a user every time a command is found #4

Closed
Voltara opened this issue Feb 26, 2013 · 1 comment
Closed

get_user_command skips a user every time a command is found #4

Voltara opened this issue Feb 26, 2013 · 1 comment
Assignees
Labels

Comments

@Voltara
Copy link
Owner

Voltara commented Feb 26, 2013

/* find and return a user command */
for (i = 0; i < max_users; i++) {
    ip = all_users[NextCmdGiver++];
    NextCmdGiver %= max_users;

    /* ... */

    /* if there's a command in the buffer, pull it out! */
    if (ip->iflags & CMD_IN_BUF) {
        NextCmdGiver++;
        NextCmdGiver %= max_users;
        user_command = first_cmd_in_buf(ip);
        break;
    }

It is not necessary to increment NextCmdGiver a second time; this allows one user to starve another of command processing time.

@ghost ghost assigned Voltara Feb 27, 2013
Voltara added a commit that referenced this issue Feb 27, 2013
Removed an extraneous NextCmdGiver++ in get_user_command,
which caused the driver to skip the next user in the list
whenever it process a command.  Flooding the MUD with
command input would prevent the next user's command's
from being processed.

Fixes issue #4
@thefallentree
Copy link

good find!

@Voltara Voltara closed this as completed Feb 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants