fixed block rclick function (error 2 commits ago)
This commit is contained in:
@@ -298,12 +298,15 @@ 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_on_block) {
|
if (item->rt.funcsset.on_use_on_block) {
|
||||||
scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
preventDefault = scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
||||||
} else
|
} else if (item->rt.funcsset.on_use) {
|
||||||
if (item->rt.funcsset.on_use) {
|
preventDefault = scripting::on_item_use(player.get(), item);
|
||||||
scripting::on_item_use(player.get(), item);
|
}
|
||||||
} else return;
|
if (preventDefault) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (def && rclick){
|
if (def && rclick){
|
||||||
if (!input.shift && target->rt.funcsset.oninteract) {
|
if (!input.shift && target->rt.funcsset.oninteract) {
|
||||||
|
|||||||
Reference in New Issue
Block a user