mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
4d3f6cae2e
6 changed files with 40 additions and 11 deletions
|
@ -650,8 +650,8 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int rstrict)
|
|||
|
||||
if ( ( rstrict & 2 ) )
|
||||
{
|
||||
long total_sample_size;
|
||||
long remain;
|
||||
int32 total_sample_size;
|
||||
int32 remain;
|
||||
rem = f;
|
||||
f = dumbfile_buffer_mod_2(rem, sigdata->n_samples, sigdata->sample, &total_sample_size, &remain);
|
||||
if (!f) {
|
||||
|
|
|
@ -436,7 +436,7 @@ static int limit_xm_getc(void *f)
|
|||
|
||||
|
||||
|
||||
static long limit_xm_getnc(char *ptr, int32 n, void *f)
|
||||
static int32 limit_xm_getnc(char *ptr, int32 n, void *f)
|
||||
{
|
||||
LIMITED_XM *lx = f;
|
||||
int left;
|
||||
|
|
|
@ -137,18 +137,40 @@ DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
enum
|
||||
{
|
||||
AMF_TARGETEMITTER = 1,
|
||||
AMF_TARGETNONPLAYER = 2,
|
||||
AMF_EMITFROMTARGET = 4,
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_AlertMonsters)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_FIXED(maxdist, 0);
|
||||
ACTION_PARAM_INT(Flags, 1);
|
||||
|
||||
if (self->player != NULL)
|
||||
AActor * target;
|
||||
AActor * emitter = self;
|
||||
|
||||
if (self->player != NULL || (Flags & AMF_TARGETEMITTER))
|
||||
{
|
||||
P_NoiseAlert(self, self, false, maxdist);
|
||||
target = self;
|
||||
}
|
||||
else if (self->target != NULL && (Flags & AMF_TARGETNONPLAYER))
|
||||
{
|
||||
target = self->target;
|
||||
}
|
||||
else if (self->target != NULL && self->target->player != NULL)
|
||||
{
|
||||
P_NoiseAlert (self->target, self, false, maxdist);
|
||||
target = self->target;
|
||||
}
|
||||
|
||||
if (Flags & AMF_EMITFROMTARGET) emitter = target;
|
||||
|
||||
if (target != NULL && emitter != NULL)
|
||||
{
|
||||
P_NoiseAlert(target, emitter, false, maxdist);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_TurretLook();
|
||||
action native A_KlaxonBlare();
|
||||
action native A_Countdown();
|
||||
action native A_AlertMonsters(float maxdist = 0);
|
||||
action native A_AlertMonsters(float maxdist = 0, int flags = 0);
|
||||
action native A_ClearSoundTarget();
|
||||
action native A_FireAssaultGun();
|
||||
action native A_CheckTerrain();
|
||||
|
|
|
@ -348,5 +348,12 @@ enum
|
|||
CLOFF_NOAIM = CLOFF_NOAIM_VERT|CLOFF_NOAIM_HORZ
|
||||
};
|
||||
|
||||
|
||||
// Flags for A_AlertMonsters
|
||||
const int AMF_TARGETEMITTER = 1;
|
||||
const int AMF_TARGETNONPLAYER = 2;
|
||||
const int AMF_EMITFROMTARGET = 4;
|
||||
|
||||
|
||||
// This is only here to provide one global variable for testing.
|
||||
native int testglobalvar;
|
||||
|
|
Loading…
Reference in a new issue