|
|
@ -75,6 +75,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com |
|
|
|
#include "../plInputCore/plInputDevice.h" |
|
|
|
#include "../plInputCore/plInputDevice.h" |
|
|
|
#include "../plMath/plRandom.h" |
|
|
|
#include "../plMath/plRandom.h" |
|
|
|
#include "../plPipeline/plDebugText.h" |
|
|
|
#include "../plPipeline/plDebugText.h" |
|
|
|
|
|
|
|
#include "../plNetClient/plNetClientMgr.h" |
|
|
|
#include "../plNetClient/plNetLinkingMgr.h" |
|
|
|
#include "../plNetClient/plNetLinkingMgr.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "../plMessage/plAvatarMsg.h" |
|
|
|
#include "../plMessage/plAvatarMsg.h" |
|
|
@ -494,12 +495,20 @@ hsBool plAvBrainHuman::IHandleClimbMsg(plClimbMsg *msg) |
|
|
|
bool isStartClimb = msg->fCommand == plClimbMsg::kStartClimbing; |
|
|
|
bool isStartClimb = msg->fCommand == plClimbMsg::kStartClimbing; |
|
|
|
if(isStartClimb) |
|
|
|
if(isStartClimb) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// let's build a seek task to get us to the attach point
|
|
|
|
// Warp the player to the Seekpoint
|
|
|
|
plKey seekTarget = msg->fTarget; |
|
|
|
plSceneObject *avatarObj = plSceneObject::ConvertNoRef(plNetClientMgr::GetInstance()->GetLocalPlayer()); |
|
|
|
plAvTaskSeek *seekTask = TRACKED_NEW plAvTaskSeek(seekTarget); |
|
|
|
plSceneObject *obj = plSceneObject::ConvertNoRef(msg->fTarget->ObjectIsLoaded()); |
|
|
|
QueueTask(seekTask); |
|
|
|
plArmatureMod *localAvatar = plAvatarMgr::GetInstance()->GetLocalAvatar(); |
|
|
|
|
|
|
|
plArmatureMod *climbAvatar = plArmatureMod::ConvertNoRef(fArmature); |
|
|
|
|
|
|
|
if (climbAvatar == localAvatar) // is it our avatar who has to seek?
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hsMatrix44 target = obj->GetLocalToWorld(); |
|
|
|
|
|
|
|
plWarpMsg *warp = TRACKED_NEW plWarpMsg(NULL, avatarObj->GetKey(), plWarpMsg::kFlushTransform, target); |
|
|
|
|
|
|
|
warp->SetBCastFlag(plMessage::kNetPropagate); |
|
|
|
|
|
|
|
plgDispatch::MsgSend(warp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// now a brain task to start the actual climb.
|
|
|
|
// build the Climb brain
|
|
|
|
plAvBrainClimb::Mode startMode; |
|
|
|
plAvBrainClimb::Mode startMode; |
|
|
|
switch(msg->fDirection) |
|
|
|
switch(msg->fDirection) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -515,10 +524,11 @@ hsBool plAvBrainHuman::IHandleClimbMsg(plClimbMsg *msg) |
|
|
|
case plClimbMsg::kRight: |
|
|
|
case plClimbMsg::kRight: |
|
|
|
startMode = plAvBrainClimb::kMountingRight; |
|
|
|
startMode = plAvBrainClimb::kMountingRight; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
plAvBrainClimb *brain = TRACKED_NEW plAvBrainClimb(startMode); |
|
|
|
plAvBrainClimb *brain = TRACKED_NEW plAvBrainClimb(startMode); |
|
|
|
plAvTaskBrain *brainTask = TRACKED_NEW plAvTaskBrain(brain); |
|
|
|
climbAvatar->PushBrain(brain); |
|
|
|
QueueTask(brainTask); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// ** potentially controversial:
|
|
|
|
// ** potentially controversial:
|
|
|
|
// It's fairly easy for a human brain to hit a climb trigger - like when falling off a wall.
|
|
|
|
// It's fairly easy for a human brain to hit a climb trigger - like when falling off a wall.
|
|
|
|