Skip to content

Commit

Permalink
Fix ap command parser
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokya committed Sep 12, 2024
1 parent 22b207b commit 128cf9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/player/player/handlers/handle_player_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ async fn autopickup(player_id: i32, args: &[String], player: &PlayerHandle, map:
return;
}

if args.len() < 2 {
send_error_message(
player,
"Invalid argument. Must be \"list\", \"add\", or \"remove\".".to_string(),
);
return;
}

let identifier = (*args[1]).to_string();

let item_id = match identifier.parse::<u32>() {
Expand Down

0 comments on commit 128cf9a

Please sign in to comment.