update std rules & add player.destroy binding

This commit is contained in:
MihailRis
2024-11-06 21:28:12 +03:00
parent df2f24d94e
commit d27179b6c3
9 changed files with 22 additions and 9 deletions
+1
View File
@@ -25,6 +25,7 @@ inline const std::string BIND_CAM_MODE = "camera.mode";
inline const std::string BIND_PLAYER_NOCLIP = "player.noclip";
inline const std::string BIND_PLAYER_FLIGHT = "player.flight";
inline const std::string BIND_PLAYER_ATTACK = "player.attack";
inline const std::string BIND_PLAYER_DESTROY = "player.destroy";
inline const std::string BIND_PLAYER_BUILD = "player.build";
inline const std::string BIND_PLAYER_PICK = "player.pick";
inline const std::string BIND_PLAYER_FAST_INTERACTOIN =
+4 -2
View File
@@ -494,7 +494,9 @@ void PlayerController::updateInteraction(float delta) {
bool xkey = Events::active(BIND_PLAYER_FAST_INTERACTOIN);
float maxDistance = xkey ? 200.0f : 10.0f;
bool longInteraction = interactionTimer <= 0 || xkey;
bool lclick = Events::jactive(BIND_PLAYER_ATTACK) ||
bool lclick = Events::jactive(BIND_PLAYER_DESTROY) ||
(longInteraction && Events::active(BIND_PLAYER_DESTROY));
bool lattack = Events::jactive(BIND_PLAYER_ATTACK) ||
(longInteraction && Events::active(BIND_PLAYER_ATTACK));
bool rclick = Events::jactive(BIND_PLAYER_BUILD) ||
(longInteraction && Events::active(BIND_PLAYER_BUILD));
@@ -512,7 +514,7 @@ void PlayerController::updateInteraction(float delta) {
scripting::on_item_use(player.get(), item);
}
if (selection.entity) {
updateEntityInteraction(selection.entity, lclick, rclick);
updateEntityInteraction(selection.entity, lattack, rclick);
}
return;
}