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

Method interact

source/game/StarNpc.cpp:897–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897InteractAction Npc::interact(InteractRequest const& request) {
898 auto result = m_scriptComponent.invoke<Json>("interact",
899 JsonObject{{"sourceId", request.sourceId}, {"sourcePosition", jsonFromVec2F(request.sourcePosition)}}).value();
900
901 if (result.isNull())
902 return {};
903
904 if (result.isType(Json::Type::String))
905 return InteractAction(result.toString(), entityId(), Json());
906
907 return InteractAction(result.getString(0), entityId(), result.get(1));
908}
909
910RectF Npc::interactiveBoundBox() const {
911 return m_movementController->collisionPoly().boundBox();

Callers 2

liquidInteractionMethod · 0.45
InventoryPaneMethod · 0.45

Calls 9

jsonFromVec2FFunction · 0.85
InteractActionClass · 0.85
JsonClass · 0.85
getStringMethod · 0.80
valueMethod · 0.45
isNullMethod · 0.45
isTypeMethod · 0.45
toStringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected