[Follow] Sit if target is sitting, stand when they stand

Does object and ground sitting.
May fly to sitting target if they're in air
Ground sits as close as it can get if cannot reach ground sitting target

Optimizes following when within desired range of target

Moves sitting/standing autopilot cancels to more proper places
This commit is contained in:
Liru Færs
2020-01-10 16:57:25 -05:00
parent fa97d8497a
commit 3209507b6c
2 changed files with 67 additions and 7 deletions

View File

@@ -3897,8 +3897,6 @@ void handle_object_sit(LLViewerObject* object, const LLVector3& offset = LLVecto
}
// [/RLVa:KB]
gAgent.stopAutoPilot(true);
gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -3921,9 +3919,10 @@ void handle_object_sit_or_stand()
return;
}
gAgent.stopAutoPilot(true);
if (sitting_on_selection())
{
gAgent.stopAutoPilot(true);
gAgent.standUp();
return;
}
@@ -9649,6 +9648,7 @@ class ListObjectSit : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gAgent.stopAutoPilot(true);
handle_object_sit(gObjectList.findObject(LFIDBearer::getActiveSelectedID()));
return true;
}