MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / lounge

Method lounge

source/game/StarPlayer.cpp:601–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601bool Player::lounge(EntityId loungeableEntityId, size_t anchorIndex) {
602 if (!canUseTool())
603 return false;
604
605 auto loungeableEntity = world()->get<LoungeableEntity>(loungeableEntityId);
606 if (!loungeableEntity || anchorIndex >= loungeableEntity->anchorCount()
607 || !loungeableEntity->entitiesLoungingIn(anchorIndex).empty()
608 || !loungeableEntity->loungeAnchor(anchorIndex))
609 return false;
610
611 m_state = State::Lounge;
612 m_movementController->setAnchorState({loungeableEntityId, anchorIndex});
613 return true;
614}
615
616void Player::stopLounging() {
617 if (loungingIn()) {

Callers 2

makePlayerCallbacksMethod · 0.80
handleInteractActionMethod · 0.80

Calls 5

entitiesLoungingInMethod · 0.80
setAnchorStateMethod · 0.80
anchorCountMethod · 0.45
emptyMethod · 0.45
loungeAnchorMethod · 0.45

Tested by

no test coverage detected