- added a 'nocheck' parameter to A_Raise* and Thing_Raise.

This commit is contained in:
Christoph Oelckers 2017-02-26 17:50:48 +01:00
parent 3f5ef48dac
commit c4b546404a
7 changed files with 32 additions and 16 deletions

View File

@ -15,7 +15,7 @@ DEFINE_SPECIAL(Door_LockedRaise, 13, 4, 5, 5)
DEFINE_SPECIAL(Door_Animated, 14, 4, 4, 4)
DEFINE_SPECIAL(Autosave, 15, 0, 0, 0) // [RH] Save the game *now*
DEFINE_SPECIAL(Transfer_WallLight, 16, -1, -1, 2)
DEFINE_SPECIAL(Thing_Raise, 17, 1, 1, 1)
DEFINE_SPECIAL(Thing_Raise, 17, 1, 2, 2)
DEFINE_SPECIAL(StartConversation, 18, 1, 2, 2)
DEFINE_SPECIAL(Thing_Stop, 19, 1, 1, 1)
DEFINE_SPECIAL(Floor_LowerByValue, 20, 3, 4, 4)

View File

@ -4602,6 +4602,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChangeCountFlags)
return 0;
}
enum ERaise
{
RF_TRANSFERFRIENDLINESS = 1,
RF_NOCHECKPOSITION = 2
};
//===========================================================================
//
// A_RaiseMaster
@ -4610,11 +4617,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChangeCountFlags)
DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(copy);
PARAM_INT_DEF(flags);
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
if (self->master != NULL)
{
P_Thing_Raise(self->master, copy ? self : NULL);
P_Thing_Raise(self->master, copy ? self : NULL, (flags & RF_NOCHECKPOSITION));
}
return 0;
}
@ -4627,16 +4635,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(copy);
PARAM_INT_DEF(flags);
TThinkerIterator<AActor> it;
AActor *mo;
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
while ((mo = it.Next()) != NULL)
{
if (mo->master == self)
{
P_Thing_Raise(mo, copy ? self : NULL);
P_Thing_Raise(mo, copy ? self : NULL, (flags & RF_NOCHECKPOSITION));
}
}
return 0;
@ -4650,18 +4659,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(copy);
PARAM_INT_DEF(flags);
TThinkerIterator<AActor> it;
AActor *mo;
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
if (self->master != NULL)
{
while ((mo = it.Next()) != NULL)
{
if (mo->master == self->master && mo != self)
{
P_Thing_Raise(mo, copy ? self : NULL);
P_Thing_Raise(mo, copy ? self : NULL, (flags & RF_NOCHECKPOSITION));
}
}
}

View File

@ -1737,14 +1737,14 @@ FUNC(LS_Thing_SpawnFacing)
}
FUNC(LS_Thing_Raise)
// Thing_Raise(tid)
// Thing_Raise(tid, nocheck)
{
AActor * target;
bool ok = false;
if (arg0==0)
{
ok = P_Thing_Raise (it,NULL);
ok = P_Thing_Raise (it,NULL, arg1);
}
else
{
@ -1752,7 +1752,7 @@ FUNC(LS_Thing_Raise)
while ( (target = iterator.Next ()) )
{
ok |= P_Thing_Raise(target,NULL);
ok |= P_Thing_Raise(target,NULL, arg1);
}
}
return ok;

View File

@ -151,7 +151,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, const DVector3 &vec, bool add, bool setbob);
void P_RemoveThing(AActor * actor);
bool P_Thing_Raise(AActor *thing, AActor *raiser);
bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck = false);
bool P_Thing_CanRaise(AActor *thing);
PClassActor *P_GetSpawnableType(int spawnnum);
void InitSpawnablesFromMapinfo();

View File

@ -406,7 +406,7 @@ void P_RemoveThing(AActor * actor)
}
bool P_Thing_Raise(AActor *thing, AActor *raiser)
bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
{
FState * RaiseState = thing->GetRaiseState();
if (RaiseState == NULL)
@ -426,7 +426,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser)
thing->flags |= MF_SOLID;
thing->Height = info->Height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius
if (!P_CheckPosition (thing, thing->Pos()))
if (!nocheck && !P_CheckPosition (thing, thing->Pos()))
{
thing->flags = oldflags;
thing->radius = oldradius;

View File

@ -790,9 +790,9 @@ class Actor : Thinker native
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0);
deprecated native void A_ChangeFlag(string flagname, bool value);
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
native void A_RaiseMaster(bool copy = 0);
native void A_RaiseChildren(bool copy = 0);
native void A_RaiseSiblings(bool copy = 0);
native void A_RaiseMaster(int flags = 0);
native void A_RaiseChildren(int flags = 0);
native void A_RaiseSiblings(int flags = 0);
deprecated native void A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, double missileheight);
action native bool, Actor A_ThrowGrenade(class<Actor> itemtype, double zheight = 0, double xyvel = 0, double zvel = 0, bool useammo = true);
native void A_Weave(int xspeed, int yspeed, double xdist, double ydist);

View File

@ -996,6 +996,12 @@ enum EFindFloorCeiling
FFCF_NODROPOFF = 256, // Caller does not need a dropoff (saves some time when checking portals)
};
enum ERaise
{
RF_TRANSFERFRIENDLINESS = 1,
RF_NOCHECKPOSITION = 2
}
enum ETeleport
{
TELF_DESTFOG = 1,