Merge branch 'master' into scripting
Conflicts: src/thingdef/thingdef_codeptr.cpp
This commit is contained in:
commit
36974431ba
11 changed files with 6363 additions and 6285 deletions
|
|
@ -3594,7 +3594,7 @@ int DoGetMasterTID (AActor *self)
|
|||
else return 0;
|
||||
}
|
||||
|
||||
static AActor *SingleActorFromTID (int tid, AActor *defactor)
|
||||
AActor *SingleActorFromTID (int tid, AActor *defactor)
|
||||
{
|
||||
if (tid == 0)
|
||||
{
|
||||
|
|
@ -4421,6 +4421,8 @@ enum EACSFunctions
|
|||
ACSF_ChangeActorRoll,
|
||||
ACSF_GetActorRoll,
|
||||
ACSF_QuakeEx,
|
||||
ACSF_Warp, // 92
|
||||
|
||||
/* Zandronum's - these must be skipped when we reach 99!
|
||||
-100:ResetMap(0),
|
||||
-101 : PlayerIsSpectator(1),
|
||||
|
|
@ -5840,6 +5842,45 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
case ACSF_GetActorRoll:
|
||||
actor = SingleActorFromTID(args[0], activator);
|
||||
return actor != NULL? actor->roll >> 16 : 0;
|
||||
|
||||
// [ZK] A_Warp in ACS
|
||||
case ACSF_Warp:
|
||||
{
|
||||
int tid_dest = args[0];
|
||||
fixed_t xofs = args[1];
|
||||
fixed_t yofs = args[2];
|
||||
fixed_t zofs = args[3];
|
||||
angle_t angle = args[4];
|
||||
int flags = args[5];
|
||||
const char *statename = argCount > 6 ? FBehavior::StaticLookupString(args[6]) : "";
|
||||
bool exact = argCount > 7 ? !!args[7] : false;
|
||||
|
||||
FState *state = argCount > 6 ? activator->GetClass()->FindStateByString(statename, exact) : 0;
|
||||
|
||||
AActor *reference;
|
||||
if((flags & WARPF_USEPTR) && tid_dest != AAPTR_DEFAULT)
|
||||
{
|
||||
reference = COPY_AAPTR(activator, tid_dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
reference = SingleActorFromTID(tid_dest, activator);
|
||||
}
|
||||
|
||||
// If there is no actor to warp to, fail.
|
||||
if (!reference)
|
||||
return false;
|
||||
|
||||
if (P_Thing_Warp(activator, reference, xofs, yofs, zofs, angle, flags))
|
||||
{
|
||||
if (state && argCount > 6)
|
||||
{
|
||||
activator->SetState(state);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue