Use Block_Parse in place command

This commit is contained in:
TomCube 2024-04-29 23:46:41 -05:00 committed by GitHub
parent b67370c02b
commit 189efeef28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -299,11 +299,9 @@ static void PlaceCommand_Execute(const cc_string* args, int argsCount) {
return;
}
if (!argsCount || argsCount == 3) {
block = Inventory_SelectedBlock;
}
else {
if (!Convert_ParseInt(&args[0], &block)) {
block = !argsCount || argsCount == 3 ? Inventory_SelectedBlock : Block_Parse(&args[0]);
if (block == -1) {
Chat_AddRaw("&eCould not parse block.");
return;
}
@ -311,7 +309,6 @@ static void PlaceCommand_Execute(const cc_string* args, int argsCount) {
Chat_Add1("&eThere is no block with id \"%i\".", &block);
return;
}
}
if (argsCount > 2) {
off = argsCount == 4;