… | |
… | |
686 | * syntax is: move (to) (tag) (nrof) |
686 | * syntax is: move (to) (tag) (nrof) |
687 | */ |
687 | */ |
688 | void |
688 | void |
689 | MoveCmd (char *buf, int len, player *pl) |
689 | MoveCmd (char *buf, int len, player *pl) |
690 | { |
690 | { |
691 | int vals[3], i; |
691 | int to, tag, nrof; |
692 | |
692 | |
693 | /* A little funky here. We only cycle for 2 records, because |
693 | if (3 != sscanf (buf, "%d %d %d", &to, &tag, &nrof)) |
694 | * we obviously are not going to find a space after the third |
|
|
695 | * record. Perhaps we should just replace this with a |
|
|
696 | * sscanf? |
|
|
697 | */ |
|
|
698 | for (i = 0; i < 2; i++) |
|
|
699 | { |
694 | { |
700 | vals[i] = atoi (buf); |
|
|
701 | |
|
|
702 | if (!(buf = strchr (buf, ' '))) |
|
|
703 | { |
|
|
704 | LOG (llevError, "Incomplete move command: %s\n", buf); |
695 | LOG (llevError, "Incomplete move command: %s\n", buf); |
705 | return; |
696 | return; |
706 | } |
|
|
707 | |
|
|
708 | buf++; |
|
|
709 | } |
697 | } |
710 | |
698 | |
711 | vals[2] = atoi (buf); |
699 | esrv_move_object (pl->ob, to, tag, nrof); |
712 | |
|
|
713 | /* LOG(llevDebug,"Move item %d (nrof=%d) to %d.\n", vals[1], vals[2], vals[0]);*/ |
|
|
714 | esrv_move_object (pl->ob, vals[0], vals[1], vals[2]); |
|
|
715 | } |
700 | } |
716 | |
701 | |
717 | /****************************************************************************** |
702 | /****************************************************************************** |
718 | * |
703 | * |
719 | * Start of commands the server sends to the client. |
704 | * Start of commands the server sends to the client. |