forked from Mirrors/openclonk
#333: Clonk can turn cannon after having grabbed it by using an item
parent
3ccdb7bf2d
commit
beb2cec9d9
|
@ -311,7 +311,11 @@ protected func Departure() { CancelUse(); return _inherited(...); }
|
|||
|
||||
// The same for vehicles
|
||||
protected func AttachTargetLost() { CancelUse(); return _inherited(...); }
|
||||
protected func GrabLost() { CancelUse(); return _inherited(...); }
|
||||
protected func Grab(object target, bool ungrab)
|
||||
{
|
||||
if (ungrab) CancelUse();
|
||||
return _inherited(target,ungrab,...);
|
||||
}
|
||||
|
||||
// ...aaand the same for when the clonk is deselected
|
||||
protected func CrewSelection(bool unselect)
|
||||
|
|
|
@ -3526,6 +3526,8 @@ void GrabLost(C4Object *cObj)
|
|||
{
|
||||
// Grab lost script call on target (quite hacky stuff...)
|
||||
cObj->Action.Target->Call(PSF_GrabLost);
|
||||
// Also, delete the target from the clonk's action (Newton)
|
||||
cObj->Action.Target = NULL;
|
||||
// Clear commands down to first PushTo (if any) in command stack
|
||||
for (C4Command *pCom=cObj->Command; pCom; pCom=pCom->Next)
|
||||
if (pCom->Next && pCom->Next->Command==C4CMD_PushTo)
|
||||
|
|
|
@ -287,8 +287,12 @@ bool ObjectComUnGrab(C4Object *cObj)
|
|||
{
|
||||
if (!cObj->CloseMenu(false)) return false;
|
||||
cObj->Call(PSF_Grab, &C4AulParSet(C4VObj(pTarget), C4VBool(false)));
|
||||
// clear action target
|
||||
cObj->Action.Target = NULL;
|
||||
if (pTarget && pTarget->Status && cObj->Status)
|
||||
{
|
||||
pTarget->Call(PSF_Grabbed, &C4AulParSet(C4VObj(cObj), C4VBool(false)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ bool C4ValueToMatrix(const C4ValueArray& array, StdMeshMatrix* matrix);
|
|||
#define PSF_Hit "~Hit"
|
||||
#define PSF_Hit2 "~Hit2"
|
||||
#define PSF_Hit3 "~Hit3"
|
||||
#define PSF_Grab "~Grab"
|
||||
#define PSF_Grab "~Grab" // pObject, fGrab
|
||||
#define PSF_Grabbed "~Grabbed"
|
||||
#define PSF_Get "~Get"
|
||||
#define PSF_Put "~Put"
|
||||
|
|
Loading…
Reference in New Issue