Merge branch 'master' into scripting

Conflicts:
	src/p_interaction.cpp
	tools/lemon/lemon.c
This commit is contained in:
Christoph Oelckers 2015-04-30 16:13:32 +02:00
commit 1b29c3b6cf
9 changed files with 97 additions and 36 deletions

View file

@ -2240,10 +2240,10 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
mo->RenderStyle = self->RenderStyle;
}
if (flags & SIXF_TRANSFERSPRITEFRAME)
{
mo->sprite = self->sprite;
mo->frame = self->frame;
if (flags & SIXF_TRANSFERSPRITEFRAME)
{
mo->sprite = self->sprite;
mo->frame = self->frame;
}
if (flags & SIXF_TRANSFERROLL)
@ -6195,6 +6195,42 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ResetHealth)
return 0;
}
//===========================================================================
// A_JumpIfHigherOrLower
//
// Jumps if a target, master, or tracer is higher or lower than the calling
// actor. Can also specify how much higher/lower the actor needs to be than
// itself. Can also take into account the height of the actor in question,
// depending on which it's checking. This means adding height of the
// calling actor's self if the pointer is higher, or height of the pointer
// if its lower.
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHigherOrLower)
{
PARAM_ACTION_PROLOGUE;
PARAM_STATE(high);
PARAM_STATE(low);
PARAM_FIXED_OPT(offsethigh) { offsethigh = 0; }
PARAM_FIXED_OPT(offsetlow) { offsetlow = 0; }
PARAM_BOOL_OPT(includeHeight) { includeHeight = true; }
PARAM_INT_OPT(ptr) { ptr = AAPTR_TARGET; }
AActor *mobj = COPY_AAPTR(self, ptr);
ACTION_SET_RESULT(false); //No inventory jump chains please.
if (mobj != NULL && mobj != self) //AAPTR_DEFAULT is completely useless in this regard.
{
if ((high) && (mobj->z > ((includeHeight ? self->height : 0) + self->z + offsethigh)))
ACTION_JUMP(high);
else if ((low) && (mobj->z + (includeHeight ? mobj->height : 0)) < (self->z + offsetlow))
ACTION_JUMP(low);
}
return numret;
}
//===========================================================================
//
// A_SetRipperLevel(int level)