mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Added: Boolean to specify if A_Raise functions should perform CopyFriendliness based upon who raised it. By default, this is false.
This commit is contained in:
parent
b2fdd32b0a
commit
94f08aa593
5 changed files with 35 additions and 13 deletions
|
@ -1510,7 +1510,7 @@ FUNC(LS_Thing_Raise)
|
|||
|
||||
if (arg0==0)
|
||||
{
|
||||
ok = P_Thing_Raise (it);
|
||||
ok = P_Thing_Raise (it,NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1518,7 +1518,7 @@ FUNC(LS_Thing_Raise)
|
|||
|
||||
while ( (target = iterator.Next ()) )
|
||||
{
|
||||
ok |= P_Thing_Raise(target);
|
||||
ok |= P_Thing_Raise(target,NULL);
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
|
|
|
@ -171,7 +171,7 @@ bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog);
|
|||
int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type);
|
||||
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add, bool setbob);
|
||||
void P_RemoveThing(AActor * actor);
|
||||
bool P_Thing_Raise(AActor *thing);
|
||||
bool P_Thing_Raise(AActor *thing, AActor *raiser);
|
||||
bool P_Thing_CanRaise(AActor *thing);
|
||||
const PClass *P_GetSpawnableType(int spawnnum);
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ void P_RemoveThing(AActor * actor)
|
|||
|
||||
}
|
||||
|
||||
bool P_Thing_Raise(AActor *thing)
|
||||
bool P_Thing_Raise(AActor *thing, AActor *raiser)
|
||||
{
|
||||
FState * RaiseState = thing->GetRaiseState();
|
||||
if (RaiseState == NULL)
|
||||
|
@ -445,6 +445,12 @@ bool P_Thing_Raise(AActor *thing)
|
|||
|
||||
thing->Revive();
|
||||
|
||||
if (raiser != NULL)
|
||||
{
|
||||
// Let's copy the friendliness of the one who raised it.
|
||||
thing->CopyFriendliness(raiser, false);
|
||||
}
|
||||
|
||||
thing->SetState (RaiseState);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -3761,11 +3761,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFlag)
|
|||
// A_RaiseMaster
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RaiseMaster)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_BOOL(copy, 0);
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
P_Thing_Raise(self->master);
|
||||
if (copy)
|
||||
P_Thing_Raise(self->master, self);
|
||||
else
|
||||
P_Thing_Raise(self->master, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3774,8 +3780,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
|
|||
// A_RaiseChildren
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RaiseChildren)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_BOOL(copy, 0);
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
|
@ -3783,7 +3791,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
|
|||
{
|
||||
if (mo->master == self)
|
||||
{
|
||||
P_Thing_Raise(mo);
|
||||
if (copy)
|
||||
P_Thing_Raise(mo, self);
|
||||
else
|
||||
P_Thing_Raise(mo, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3793,8 +3804,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
|
|||
// A_RaiseSiblings
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RaiseSiblings)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_BOOL(copy, 0);
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
|
@ -3804,7 +3817,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
|
|||
{
|
||||
if (mo->master == self->master && mo != self)
|
||||
{
|
||||
P_Thing_Raise(mo);
|
||||
if (copy)
|
||||
P_Thing_Raise(mo, self);
|
||||
else
|
||||
P_Thing_Raise(mo, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,9 +241,9 @@ ACTOR Actor native //: Thinker
|
|||
action native A_KillMaster(name damagetype = "none", int flags = 0);
|
||||
action native A_KillChildren(name damagetype = "none", int flags = 0);
|
||||
action native A_KillSiblings(name damagetype = "none", int flags = 0);
|
||||
action native A_RaiseMaster();
|
||||
action native A_RaiseChildren();
|
||||
action native A_RaiseSiblings();
|
||||
action native A_RaiseMaster(bool copy = 0);
|
||||
action native A_RaiseChildren(bool copy = 0);
|
||||
action native A_RaiseSiblings(bool copy = 0);
|
||||
action native A_CheckFloor(state label);
|
||||
action native A_CheckCeiling(state label);
|
||||
action native A_PlayerSkinCheck(state label);
|
||||
|
|
Loading…
Reference in a new issue