diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 235a47933..c5ea7031d 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -2306,6 +2306,12 @@ void FBehavior::LoadScriptsDirectory () default: break; } + +// [EP] Clang 3.5.0 optimizer miscompiles this function and causes random +// crashes in the program. I hope that Clang 3.5.x will fix this. +#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 5 + asm("" : "+g" (NumScripts)); +#endif for (i = 0; i < NumScripts; ++i) { Scripts[i].Flags = 0; @@ -4361,6 +4367,7 @@ enum EACSFunctions ACSF_ChangeActorAngle, ACSF_ChangeActorPitch, // 80 ACSF_GetArmorInfo, + ACSF_DropInventory, /* Zandronum's - these must be skipped when we reach 99! -100:ResetMap(0), @@ -5485,6 +5492,42 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) break; } + case ACSF_DropInventory: + { + const char *type = FBehavior::StaticLookupString(args[1]); + AInventory *inv; + + if (type != NULL) + { + if (args[0] == 0) + { + if (activator != NULL) + { + inv = activator->FindInventory(type); + if (inv) + { + activator->DropInventory(inv); + } + } + } + else + { + FActorIterator it(args[0]); + AActor *actor; + + while ((actor = it.Next()) != NULL) + { + inv = actor->FindInventory(type); + if (inv) + { + actor->DropInventory(inv); + } + } + } + } + break; + } + case ACSF_CheckFlag: { AActor *actor = SingleActorFromTID(args[0], activator); diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index b1c9e9065..f80e89aad 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1755,6 +1755,8 @@ enum SIX_Flags SIXF_TRANSFERSPECIAL = 1 << 15, SIXF_CLEARCALLERSPECIAL = 1 << 16, SIXF_TRANSFERSTENCILCOL = 1 << 17, + SIXF_TRANSFERALPHA = 1 << 18, + SIXF_TRANSFERRENDERSTYLE = 1 << 19, }; static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) @@ -1843,6 +1845,10 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) // If this is a missile or something else set the target to the originator mo->target = originator ? originator : self; } + if (flags & SIXF_SETMASTER) + { + mo->master = originator; + } if (flags & SIXF_TRANSFERSCALE) { mo->scaleX = self->scaleX; @@ -1871,6 +1877,14 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) { mo->fillcolor = self->fillcolor; } + if (flags & SIXF_TRANSFERALPHA) + { + mo->alpha = self->alpha; + } + if (flags & SIXF_TRANSFERRENDERSTYLE) + { + mo->RenderStyle = self->RenderStyle; + } return true; } @@ -4966,3 +4980,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropItem) P_DropItem(self, spawntype, amount, chance); } + +//========================================================================== +// +// A_SetSpeed +// +//========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpeed) +{ + ACTION_PARAM_START(1); + ACTION_PARAM_FIXED(speed, 0); + + self->Speed = speed; +} diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index c578ddb2b..7dbf5ec36 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -88,6 +88,7 @@ DEFINE_MEMBER_VARIABLE(height, AActor) DEFINE_MEMBER_VARIABLE(radius, AActor) DEFINE_MEMBER_VARIABLE(reactiontime, AActor) DEFINE_MEMBER_VARIABLE(meleerange, AActor) +DEFINE_MEMBER_VARIABLE(Speed, AActor) //========================================================================== diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 501933f04..e66226c1e 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -62,6 +62,7 @@ ACTOR Actor native //: Thinker native fixed_t radius; native int reactiontime; native fixed_t meleerange; + native fixed_t speed; // Meh, MBF redundant functions. Only for DeHackEd support. action native A_Turn(float angle = 0); @@ -302,6 +303,7 @@ ACTOR Actor native //: Thinker action native A_SetTics(int tics); action native A_SetDamageType(name damagetype); action native A_DropItem(class item, int dropamount = -1, int chance = 256); + action native A_SetSpeed(float speed); action native A_CheckSightOrRange(float distance, state label); action native A_CheckRange(float distance, state label); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index d5358e5af..bf998e6b0 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -65,6 +65,8 @@ const int SXF_TRANSFERSCALE = 16384; const int SXF_TRANSFERSPECIAL = 32768; const int SXF_CLEARCALLERSPECIAL = 65536; const int SXF_TRANSFERSTENCILCOL = 131072; +const int SXF_TRANSFERALPHA = 262144; +const int SXF_TRANSFERRENDERSTYLE = 524288; // Flags for A_Chase const int CHF_FASTCHASE = 1;