This commit is contained in:
Christoph Oelckers 2015-11-27 16:59:50 +01:00
commit 6e22be89e4
13 changed files with 2011 additions and 1984 deletions

View file

@ -2328,7 +2328,9 @@ void AM_drawWalls (bool allmap)
AM_drawMline (&l, AMColors.LockedColor); // locked special AM_drawMline (&l, AMColors.LockedColor); // locked special
} }
} }
else if (am_showtriggerlines && AMColors.isValid(AMColors.SpecialWallColor) && lines[i].special != 0 else if (am_showtriggerlines && AMColors.isValid(AMColors.SpecialWallColor)
&& LineSpecialsInfo[lines[i].special] != NULL
&& LineSpecialsInfo[lines[i].special]->max_args >= 0
&& lines[i].special != Door_Open && lines[i].special != Door_Open
&& lines[i].special != Door_Close && lines[i].special != Door_Close
&& lines[i].special != Door_CloseWaitOpen && lines[i].special != Door_CloseWaitOpen

View file

@ -368,8 +368,7 @@ bool FConfigFile::DeleteCurrentSection()
LastSectionPtr = &sec->Next; LastSectionPtr = &sec->Next;
} }
CurrentSection->~FConfigSection(); delete CurrentSection;
delete[] (char *)CurrentSection;
CurrentSection = sec->Next; CurrentSection = sec->Next;
return CurrentSection != NULL; return CurrentSection != NULL;

View file

@ -680,6 +680,7 @@ AInventory *AInventory::CreateCopy (AActor *other)
{ {
AInventory *copy; AInventory *copy;
Amount = MIN(Amount, MaxAmount);
if (GoAway ()) if (GoAway ())
{ {
copy = static_cast<AInventory *>(Spawn (GetClass(), 0, 0, 0, NO_REPLACE)); copy = static_cast<AInventory *>(Spawn (GetClass(), 0, 0, 0, NO_REPLACE));

View file

@ -1338,17 +1338,17 @@ void DBaseStatusBar::Draw (EHudState state)
{ {
if (Scaled) if (Scaled)
{ {
y -= Scale (10, SCREENHEIGHT, 200); y -= Scale (11, SCREENHEIGHT, 200);
} }
else else
{ {
if (SCREENWIDTH < 640) if (SCREENWIDTH < 640)
{ {
y -= 11; y -= 12;
} }
else else
{ // Get past the tops of the gargoyles' wings { // Get past the tops of the gargoyles' wings
y -= 26; y -= 28;
} }
} }
} }

View file

@ -56,6 +56,7 @@
#include "p_3dmidtex.h" #include "p_3dmidtex.h"
#include "d_net.h" #include "d_net.h"
#include "d_event.h" #include "d_event.h"
#include "gstrings.h"
#include "r_data/colormaps.h" #include "r_data/colormaps.h"
#define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \ #define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \
@ -2985,13 +2986,14 @@ FUNC(LS_SendToCommunicator)
{ {
S_StopSound (CHAN_VOICE); S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE, name, 1, ATTN_NORM); S_Sound (CHAN_VOICE, name, 1, ATTN_NORM);
if (arg2 == 0)
// Get the message from the LANGUAGE lump.
FString msg;
msg.Format("TXT_COMM%d", arg2);
const char *str = GStrings[msg];
if (msg != NULL)
{ {
Printf (PRINT_CHAT, "Incoming Message\n"); Printf (PRINT_CHAT, "%s\n", str);
}
else if (arg2 == 1)
{
Printf (PRINT_CHAT, "Incoming Message from BlackBird\n");
} }
} }
return true; return true;

View file

@ -806,12 +806,15 @@ ASkyViewpoint *sector_t::GetSkyBox(int which)
{ {
if (which == floor) if (which == floor)
{ {
return FloorSkyBox != NULL ? FloorSkyBox : (MoreFlags & SECF_NOFLOORSKYBOX)? (ASkyViewpoint*)NULL : level.DefaultSkybox; if (FloorSkyBox != NULL) return FloorSkyBox;
if (MoreFlags & SECF_NOFLOORSKYBOX) return NULL;
} }
else else
{ {
return CeilingSkyBox != NULL ? CeilingSkyBox : (MoreFlags & SECF_NOCEILINGSKYBOX)? (ASkyViewpoint*)NULL : level.DefaultSkybox; if (CeilingSkyBox != NULL) return CeilingSkyBox;
if (MoreFlags & SECF_NOCEILINGSKYBOX) return NULL;
} }
return level.DefaultSkybox;
} }

View file

@ -254,7 +254,7 @@ void R_InitTextureMapping ()
void R_SetVisibility (float vis) void R_SetVisibility (float vis)
{ {
// Allow negative visibilities, just for novelty's sake // Allow negative visibilities, just for novelty's sake
//vis = clamp (vis, -204.7f, 204.7f); vis = clamp (vis, -204.7f, 204.7f); // (205 and larger do not work in 5:4 aspect ratio)
CurrentVisibility = vis; CurrentVisibility = vis;

View file

@ -2375,6 +2375,16 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
} }
} }
FName *aliasp = MusicAliases.CheckKey(musicname);
if (aliasp != NULL)
{
if (*aliasp == NAME_None)
{
return true; // flagged to be ignored
}
musicname = aliasp->GetChars();
}
if (!mus_playing.name.IsEmpty() && if (!mus_playing.name.IsEmpty() &&
mus_playing.handle != NULL && mus_playing.handle != NULL &&
stricmp (mus_playing.name, musicname) == 0 && stricmp (mus_playing.name, musicname) == 0 &&
@ -2413,16 +2423,8 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
int length = 0; int length = 0;
int device = MDEV_DEFAULT; int device = MDEV_DEFAULT;
MusInfo *handle = NULL; MusInfo *handle = NULL;
FName musicasname = musicname;
FName *aliasp = MusicAliases.CheckKey(musicasname); int *devp = MidiDevices.CheckKey(musicname);
if (aliasp != NULL)
{
musicname = (musicasname = *aliasp).GetChars();
if (musicasname == NAME_None) return true;
}
int *devp = MidiDevices.CheckKey(musicasname);
if (devp != NULL) device = *devp; if (devp != NULL) device = *devp;
// Strip off any leading file:// component. // Strip off any leading file:// component.

View file

@ -1349,7 +1349,7 @@ FISoundChannel *OpenALSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener
alSourcei(source, AL_LOOPING, (chanflags&SNDF_LOOP) ? AL_TRUE : AL_FALSE); alSourcei(source, AL_LOOPING, (chanflags&SNDF_LOOP) ? AL_TRUE : AL_FALSE);
alSourcef(source, AL_MAX_GAIN, SfxVolume); alSourcef(source, AL_MAX_GAIN, SfxVolume);
alSourcef(source, AL_GAIN, SfxVolume); alSourcef(source, AL_GAIN, SfxVolume*vol);
if(EnvSlot) if(EnvSlot)
{ {

View file

@ -4884,17 +4884,19 @@ enum RadiusGiveFlags
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
{ {
ACTION_PARAM_START(6); ACTION_PARAM_START(7);
ACTION_PARAM_CLASS(item, 0); ACTION_PARAM_CLASS(item, 0);
ACTION_PARAM_FIXED(distance, 1); ACTION_PARAM_FIXED(distance, 1);
ACTION_PARAM_INT(flags, 2); ACTION_PARAM_INT(flags, 2);
ACTION_PARAM_INT(amount, 3); ACTION_PARAM_INT(amount, 3);
ACTION_PARAM_CLASS(filter, 4); ACTION_PARAM_CLASS(filter, 4);
ACTION_PARAM_NAME(species, 5); ACTION_PARAM_NAME(species, 5);
ACTION_PARAM_FIXED(mindist, 6);
// We need a valid item, valid targets, and a valid range // We need a valid item, valid targets, and a valid range
if (item == NULL || (flags & RGF_MASK) == 0 || !flags || distance <= 0) if (item == NULL || (flags & RGF_MASK) == 0 || !flags || distance <= 0 || mindist >= distance)
{ {
ACTION_SET_RESULT(false);
return; return;
} }
@ -4903,9 +4905,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
amount = 1; amount = 1;
} }
FBlockThingsIterator it(FBoundingBox(self->x, self->y, distance)); FBlockThingsIterator it(FBoundingBox(self->x, self->y, distance));
double distsquared = double(distance) * double(distance);
AActor *thing; AActor *thing;
bool given = false;
while ((thing = it.Next())) while ((thing = it.Next()))
{ {
//[MC] Check for a filter, species, and the related exfilter/expecies/either flag(s). //[MC] Check for a filter, species, and the related exfilter/expecies/either flag(s).
@ -4950,7 +4952,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
bool corpsePass = !!((flags & RGF_CORPSES) && thing->flags & MF_CORPSE); bool corpsePass = !!((flags & RGF_CORPSES) && thing->flags & MF_CORPSE);
bool killedPass = !!((flags & RGF_KILLED) && thing->flags6 & MF6_KILLED); bool killedPass = !!((flags & RGF_KILLED) && thing->flags6 & MF6_KILLED);
bool monsterPass = !!((flags & RGF_MONSTERS) && thing->flags3 & MF3_ISMONSTER); bool monsterPass = !!((flags & RGF_MONSTERS) && thing->flags3 & MF3_ISMONSTER);
bool objectPass = !!((flags & RGF_OBJECTS) && ((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE))); bool objectPass = !!((flags & RGF_OBJECTS) && (thing->player == NULL) && (!(thing->flags3 & MF3_ISMONSTER))
&& ((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE)));
bool playerPass = !!((flags & RGF_PLAYERS) && (thing->player != NULL) && (thing->player->mo == thing)); bool playerPass = !!((flags & RGF_PLAYERS) && (thing->player != NULL) && (thing->player->mo == thing));
bool voodooPass = !!((flags & RGF_VOODOO) && (thing->player != NULL) && (thing->player->mo != thing)); bool voodooPass = !!((flags & RGF_VOODOO) && (thing->player != NULL) && (thing->player->mo != thing));
//Self calls priority over the rest of this. //Self calls priority over the rest of this.
@ -4973,20 +4976,26 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
if (selfPass || monsterPass || corpsePass || killedPass || itemPass || objectPass || missilePass || playerPass || voodooPass) if (selfPass || monsterPass || corpsePass || killedPass || itemPass || objectPass || missilePass || playerPass || voodooPass)
{ {
if (flags & RGF_CUBE) if (flags & RGF_CUBE)
{ // check if inside a cube { // check if inside a cube
if (fabs((double)thing->x - self->x) > (double)distance || double dx = fabs((double)(thing->x - self->x));
fabs((double)thing->y - self->y) > (double)distance || double dy = fabs((double)(thing->y - self->y));
fabs((double)(thing->z + thing->height / 2) - (self->z + self->height / 2)) > (double)distance) double dz = fabs((double)(thing->z + thing->height / 2) - (self->z + self->height / 2));
double dist = (double)distance;
double min = (double)mindist;
if ((dx > dist || dy > dist || dz > dist) || (min && (dx < min && dy < min && dz < min)))
{ {
continue; continue;
} }
} }
else else
{ // check if inside a sphere { // check if inside a sphere
double distsquared = double(distance) * double(distance);
double minsquared = double(mindist) * double(mindist);
TVector3<double> tpos(thing->x, thing->y, thing->z + thing->height / 2); TVector3<double> tpos(thing->x, thing->y, thing->z + thing->height / 2);
TVector3<double> spos(self->x, self->y, self->z + self->height / 2); TVector3<double> spos(self->x, self->y, self->z + self->height / 2);
if ((tpos - spos).LengthSquared() > distsquared) if ((tpos - spos).LengthSquared() > distsquared || (minsquared && ((tpos - spos).LengthSquared() < minsquared)))
{ {
continue; continue;
} }
@ -5009,9 +5018,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
{ {
gift->Destroy(); gift->Destroy();
} }
else
{
given = true;
}
} }
} }
} }
ACTION_SET_RESULT(given);
} }

View file

@ -257,7 +257,7 @@ ACTOR Actor native //: Thinker
action native A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT); action native A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT);
action native A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT); action native A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT);
action native A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT); action native A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT);
action native A_RadiusGive(class<Inventory> itemtype, int distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None"); action native A_RadiusGive(class<Inventory> itemtype, int distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None", int mindist = 0);
action native A_CountdownArg(int argnum, state targstate = ""); action native A_CountdownArg(int argnum, state targstate = "");
action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true); action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
action native A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true); action native A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true);

View file

@ -44,7 +44,7 @@ ACTOR Macil1
Death: Death:
LEAD E 2 A_FaceTarget LEAD E 2 A_FaceTarget
LEAD F 2 BRIGHT A_ShootGun LEAD F 2 BRIGHT A_ShootGun
LEAD E 2 A_SentinelRefire LEAD E 1 A_SentinelRefire
Loop Loop
Pain: Pain:
LEAD Y 3 LEAD Y 3
@ -80,7 +80,7 @@ ACTOR Macil2 : Macil1
LEAD K 3 LEAD K 3
LEAD L 3 A_NoBlocking LEAD L 3 A_NoBlocking
LEAD MNOPQRSTUV 3 LEAD MNOPQRSTUV 3
LEAD W 4 Bright A_SpawnItemEx("AlienSpectre4", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION) LEAD W 3 A_SpawnItemEx("AlienSpectre4", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION)
LEAD X -1 LEAD X -1
Stop Stop
} }

View file

@ -1550,6 +1550,10 @@ TXT_RANDOMGOODBYE_3 = "See you later!";
TXT_HAVEENOUGH = "You seem to have enough!"; TXT_HAVEENOUGH = "You seem to have enough!";
TXT_GOAWAY = "Go away!"; TXT_GOAWAY = "Go away!";
TXT_COMM0 = "Incoming Message";
TXT_COMM1 = "Incoming Message from BlackBird";
// Skills: // Skills:
SKILL_BABY = "I'm too young to die"; SKILL_BABY = "I'm too young to die";