mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!argsCount || argsCount == 3) {
|
block = !argsCount || argsCount == 3 ? Inventory_SelectedBlock : Block_Parse(&args[0]);
|
||||||
block = Inventory_SelectedBlock;
|
|
||||||
|
if (block == -1) {
|
||||||
|
Chat_AddRaw("&eCould not parse block.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else {
|
if (block > Game_Version.MaxCoreBlock && !Block_IsCustomDefined(block)) {
|
||||||
if (!Convert_ParseInt(&args[0], &block)) {
|
Chat_Add1("&eThere is no block with id \"%i\".", &block);
|
||||||
Chat_AddRaw("&eCould not parse block.");
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (block > Game_Version.MaxCoreBlock && !Block_IsCustomDefined(block)) {
|
|
||||||
Chat_Add1("&eThere is no block with id \"%i\".", &block);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argsCount > 2) {
|
if (argsCount > 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user