forked from Mirrors/openclonk
Fix C4Command::Jump, i.e. jumping as part of pathfinder.
parent
486d6a33be
commit
0b6126c384
|
@ -2983,6 +2983,14 @@ bool C4Object::SetActionByName(C4String *ActName,
|
|||
return SetAction(Action.getPropList(),pTarget,pTarget2,iCalls,fForce);
|
||||
}
|
||||
|
||||
C4PropList *C4Object::GetActionByName(C4PropertyName &act_name, C4Value *rval_holder)
|
||||
{
|
||||
C4Value ActMap; GetProperty(P_ActMap, &ActMap);
|
||||
if (!ActMap.getPropList()) return false;
|
||||
ActMap.getPropList()->GetProperty(act_name, rval_holder);
|
||||
return rval_holder->getPropList();
|
||||
}
|
||||
|
||||
bool C4Object::SetActionByName(const char * szActName,
|
||||
C4Object *pTarget, C4Object *pTarget2,
|
||||
int32_t iCalls, bool fForce)
|
||||
|
|
|
@ -281,6 +281,7 @@ public:
|
|||
C4PropList* GetAction() const;
|
||||
bool SetAction(C4PropList * Act, C4Object *pTarget=NULL, C4Object *pTarget2=NULL, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
|
||||
bool SetActionByName(C4String * ActName, C4Object *pTarget=NULL, C4Object *pTarget2=NULL, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
|
||||
C4PropList *GetActionByName(C4PropertyName &act_name, C4Value *rval_holder);
|
||||
bool SetActionByName(const char * szActName, C4Object *pTarget=NULL, C4Object *pTarget2=NULL, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
|
||||
void SetDir(int32_t tdir);
|
||||
void SetCategory(int32_t Category) { this->Category = Category; Resort(); SetOCF(); }
|
||||
|
|
|
@ -255,8 +255,9 @@ bool ObjectComJump(C4Object *cObj) // by ObjectComUp, ExecCMDFMoveTo, FnJump
|
|||
if (cObj->GetProcedure()!=DFA_WALK) return false;
|
||||
// Calculate direction & forces
|
||||
C4Real TXDir=Fix0;
|
||||
C4Real iPhysicalWalk = itofix(0);//FIXME: ValByPhysical(280, pPhysical->Walk) * itofix(cObj->GetCon(), FullCon);
|
||||
C4Real iPhysicalJump = itofix(0);//FIXME: ValByPhysical(1000, pPhysical->Jump) * itofix(cObj->GetCon(), FullCon);
|
||||
C4PropList *pActionWalk = cObj->GetAction();
|
||||
C4Real iPhysicalWalk = C4REAL100(pActionWalk->GetPropertyInt(P_Speed)) * itofix(cObj->GetCon(), FullCon);
|
||||
C4Real iPhysicalJump = C4REAL100(cObj->GetPropertyInt(P_JumpSpeed)) * itofix(cObj->GetCon(), FullCon);
|
||||
|
||||
if (cObj->Action.ComDir==COMD_Left || cObj->Action.ComDir==COMD_UpLeft) TXDir=-iPhysicalWalk;
|
||||
else if (cObj->Action.ComDir==COMD_Right || cObj->Action.ComDir==COMD_UpRight) TXDir=+iPhysicalWalk;
|
||||
|
|
|
@ -149,6 +149,7 @@ C4StringTable::C4StringTable()
|
|||
P[P_BlastIncinerate] = "BlastIncinerate";
|
||||
P[P_ContactIncinerate] = "ContactIncinerate";
|
||||
P[P_Global] = "Global";
|
||||
P[P_JumpSpeed] = "JumpSpeed";
|
||||
P[DFA_WALK] = "WALK";
|
||||
P[DFA_FLIGHT] = "FLIGHT";
|
||||
P[DFA_KNEEL] = "KNEEL";
|
||||
|
|
|
@ -341,6 +341,7 @@ enum C4PropertyName
|
|||
P_BlastIncinerate,
|
||||
P_ContactIncinerate,
|
||||
P_Global,
|
||||
P_JumpSpeed,
|
||||
// Default Action Procedures
|
||||
DFA_WALK,
|
||||
DFA_FLIGHT,
|
||||
|
|
Loading…
Reference in New Issue