mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 02:56:09 -04:00
Use Block_Parse
in place command
This commit is contained in:
parent
b67370c02b
commit
189efeef28
@ -299,18 +299,15 @@ static void PlaceCommand_Execute(const cc_string* args, int argsCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!argsCount || argsCount == 3) {
|
||||
block = Inventory_SelectedBlock;
|
||||
block = !argsCount || argsCount == 3 ? Inventory_SelectedBlock : Block_Parse(&args[0]);
|
||||
|
||||
if (block == -1) {
|
||||
Chat_AddRaw("&eCould not parse block.");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (!Convert_ParseInt(&args[0], &block)) {
|
||||
Chat_AddRaw("&eCould not parse block.");
|
||||
return;
|
||||
}
|
||||
if (block > Game_Version.MaxCoreBlock && !Block_IsCustomDefined(block)) {
|
||||
Chat_Add1("&eThere is no block with id \"%i\".", &block);
|
||||
return;
|
||||
}
|
||||
if (block > Game_Version.MaxCoreBlock && !Block_IsCustomDefined(block)) {
|
||||
Chat_Add1("&eThere is no block with id \"%i\".", &block);
|
||||
return;
|
||||
}
|
||||
|
||||
if (argsCount > 2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user