mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
block on_item_use when activating on_item_use_on_block
This commit is contained in:
parent
c6ed28d250
commit
212c30c866
1 changed files with 5 additions and 10 deletions
|
|
@ -298,17 +298,12 @@ void PlayerController::updateInteraction(){
|
||||||
blocksController->breakBlock(player.get(), target, x, y, z);
|
blocksController->breakBlock(player.get(), target, x, y, z);
|
||||||
}
|
}
|
||||||
if (rclick && !input.shift) {
|
if (rclick && !input.shift) {
|
||||||
bool preventDefault = false;
|
|
||||||
|
|
||||||
if (item->rt.funcsset.on_use) {
|
|
||||||
preventDefault |= scripting::on_item_use(player.get(), item);
|
|
||||||
}
|
|
||||||
if (item->rt.funcsset.on_use_on_block) {
|
if (item->rt.funcsset.on_use_on_block) {
|
||||||
preventDefault |= scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
||||||
}
|
} else
|
||||||
if (preventDefault) {
|
if (item->rt.funcsset.on_use) {
|
||||||
return;
|
scripting::on_item_use(player.get(), item);
|
||||||
}
|
} else return;
|
||||||
}
|
}
|
||||||
if (def && rclick){
|
if (def && rclick){
|
||||||
if (!input.shift && target->rt.funcsset.oninteract) {
|
if (!input.shift && target->rt.funcsset.oninteract) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue