cleanup
This commit is contained in:
parent
792ee63f22
commit
b98954f95e
@ -289,4 +289,4 @@ network.__process_events = function()
|
||||
cleaned = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -488,7 +488,10 @@ void PlayerController::updateInteraction(const Input& inputEvents, float delta)
|
||||
}
|
||||
const auto& bindings = inputEvents.getBindings();
|
||||
bool xkey = bindings.active(BIND_PLAYER_FAST_INTERACTOIN);
|
||||
float maxDistance = xkey ? 200.0f : player.getMaxInteractionDistance();
|
||||
float maxDistance = player.getMaxInteractionDistance();
|
||||
if (xkey) {
|
||||
maxDistance *= 100.0;
|
||||
}
|
||||
bool longInteraction = interactionTimer <= 0 || xkey;
|
||||
bool lclick = bindings.jactive(BIND_PLAYER_DESTROY) ||
|
||||
(longInteraction && bindings.active(BIND_PLAYER_DESTROY));
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "items/Inventory.hpp"
|
||||
#include "libentity.hpp"
|
||||
#include "objects/Entities.hpp"
|
||||
#include "objects/Entity.hpp"
|
||||
#include "objects/Player.hpp"
|
||||
#include "objects/Players.hpp"
|
||||
#include "objects/Entity.hpp"
|
||||
#include "physics/Hitbox.hpp"
|
||||
#include "window/Camera.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "libentity.hpp"
|
||||
|
||||
using namespace scripting;
|
||||
|
||||
@ -53,7 +53,7 @@ static int l_set_vel(lua::State* L) {
|
||||
auto x = lua::tonumber(L, 2);
|
||||
auto y = lua::tonumber(L, 3);
|
||||
auto z = lua::tonumber(L, 4);
|
||||
|
||||
|
||||
if (auto hitbox = player->getHitbox()) {
|
||||
hitbox->velocity = glm::vec3(x, y, z);
|
||||
}
|
||||
@ -190,7 +190,8 @@ static int l_get_interaction_distance(lua::State* L) {
|
||||
|
||||
static int l_set_interaction_distance(lua::State* L) {
|
||||
if (auto player = get_player(L, 1)) {
|
||||
player->setMaxInteractionDistance( static_cast<float>(lua::tonumber(L, 2)) );
|
||||
player->setMaxInteractionDistance(
|
||||
static_cast<float>(lua::tonumber(L, 2)));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ void Player::deserialize(const dv::value& src) {
|
||||
setSpawnPoint(glm::vec3(
|
||||
sparr[0].asNumber(), sparr[1].asNumber(), sparr[2].asNumber()));
|
||||
|
||||
if (src.has("max-interaction-distance")) maxInteractionDistance = src["max-interaction-distance"].asNumber();
|
||||
src.at("max-interaction-distance").get(maxInteractionDistance);
|
||||
|
||||
flight = src["flight"].asBoolean();
|
||||
noclip = src["noclip"].asBoolean();
|
||||
|
||||
@ -57,8 +57,6 @@ class Player : public Serializable {
|
||||
bool infiniteItems = true;
|
||||
bool instantDestruction = true;
|
||||
bool loadingChunks = true;
|
||||
|
||||
// attributes
|
||||
float maxInteractionDistance = 10.0f;
|
||||
|
||||
entityid_t eid = ENTITY_AUTO;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user