Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayer.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-20 15:27:28 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-20 15:27:28 +1000
commitb964668a38a69a3dcec58fece9bdf97b693d6e22 (patch)
treeaf8834fa258863567d99bbf3a3f63794db690197 /source/game/StarPlayer.cpp
parentc1ae23808677028ef6ac1b7f0b19b298d78affc2 (diff)
Let players use tools in lounges
Diffstat (limited to 'source/game/StarPlayer.cpp')
-rw-r--r--source/game/StarPlayer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp
index d790d1c..2fa98df 100644
--- a/source/game/StarPlayer.cpp
+++ b/source/game/StarPlayer.cpp
@@ -879,11 +879,13 @@ void Player::update(uint64_t) {
p.second->update(WorldTimestep * p.second->updateDelta());
if (edgeTriggeredUse) {
- if (canUseTool()) {
+ auto anchor = as<LoungeAnchor>(m_movementController->entityAnchor());
+ bool useTool = canUseTool();
+ if (anchor && (!useTool || anchor->controllable))
+ m_movementController->resetAnchorState();
+ else if (useTool) {
if (auto ie = bestInteractionEntity(true))
interactWithEntity(ie);
- } else if (loungingIn()) {
- m_movementController->resetAnchorState();
}
}
@@ -1393,7 +1395,13 @@ void Player::playEmote(HumanoidEmote emote) {
}
bool Player::canUseTool() const {
- return !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed() && m_state != State::Lounge;
+ bool canUse = !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed();
+ if (canUse) {
+ if (auto loungeAnchor = as<LoungeAnchor>(m_movementController->entityAnchor()))
+ if (loungeAnchor->suppressTools)
+ return false;
+ }
+ return canUse;
}
void Player::beginPrimaryFire() {