* Updated to ZDoom 4154:

- Use a temporary bitmap when when copying true color pixels of a multipatch texture, the blend   operation is not BLEND_NONE, and it doesn't just redirect straight to a direct texture.
- Fixed: The change in r3951 knew nothing about 3D floors.
- Fixed: RandomSpawner should observe the nomonsters flags when deciding what to spawn.
- Add weapon slots to key configuration menu. 

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1530 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2013-02-20 15:00:16 +00:00
parent 3c5ed0ae1b
commit e7092846bb
5 changed files with 45 additions and 12 deletions

View file

@ -31,6 +31,7 @@ class ARandomSpawner : public AActor
FDropItem *di; // di will be our drop item list iterator
FDropItem *drop; // while drop stays as the reference point.
int n=0;
bool nomonsters = (dmflags & DF_NO_MONSTERS) || (level.flags2 & LEVEL2_NOMONSTERS);
Super::BeginPlay();
drop = di = GetDropItems();
@ -40,11 +41,19 @@ class ARandomSpawner : public AActor
{
if (di->Name != NAME_None)
{
if (di->amount < 0) di->amount = 1; // default value is -1, we need a positive value.
n += di->amount; // this is how we can weight the list.
if (!nomonsters || !(GetDefaultByType(PClass::FindClass(di->Name))->flags3 & MF3_ISMONSTER))
{
if (di->amount < 0) di->amount = 1; // default value is -1, we need a positive value.
n += di->amount; // this is how we can weight the list.
}
di = di->Next;
}
}
if (n == 0)
{ // Nothing left to spawn. They must have all been monsters, and monsters are disabled.
Destroy();
return;
}
// Then we reset the iterator to the start position...
di = drop;
// Take a random number...
@ -54,15 +63,22 @@ class ARandomSpawner : public AActor
{
if (di->Name != NAME_None)
{
n -= di->amount;
if ((di->Next != NULL) && (n > -1)) di = di->Next; else n = -1;
if (!nomonsters || !(GetDefaultByType(PClass::FindClass(di->Name))->flags3 & MF3_ISMONSTER))
{
n -= di->amount;
if ((di->Next != NULL) && (n > -1))
di = di->Next;
else
n = -1;
}
}
}
// So now we can spawn the dropped item.
if (bouncecount >= MAX_RANDOMSPAWNERS_RECURSION) // Prevents infinite recursions
{
Spawn("Unknown", x, y, z, NO_REPLACE); // Show that there's a problem.
Destroy(); return;
Destroy();
return;
}
else if (pr_randomspawn() <= di->probability) // prob 255 = always spawn, prob 0 = never spawn.
{
@ -167,8 +183,10 @@ class ARandomSpawner : public AActor
if (rep && ((rep->flags4 & MF4_BOSSDEATH) || (rep->flags2 & MF2_BOSS)))
boss = true;
}
if (boss) this->tracer = newmobj;
else Destroy(); // "else" because a boss-replacing spawner must wait until it can call A_BossDeath.
if (boss)
this->tracer = newmobj;
else // "else" because a boss-replacing spawner must wait until it can call A_BossDeath.
Destroy();
}
void Tick() // This function is needed for handling boss replacers

View file

@ -550,9 +550,14 @@ bool P_Move (AActor *actor)
{
actor->z = savedz;
}
else if (actor->floorsector->SecActTarget != NULL)
else
{ // The monster just hit the floor, so trigger any actions.
actor->floorsector->SecActTarget->TriggerAction(actor, SECSPAC_HitFloor);
if (actor->floorsector->SecActTarget != NULL &&
actor->floorz == actor->floorsector->floorplane.ZatPoint(actor->x, actor->y))
{
actor->floorsector->SecActTarget->TriggerAction(actor, SECSPAC_HitFloor);
}
P_CheckFor3DFloorHit(actor);
}
}
}

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "4150"
#define ZD_SVN_REVISION_NUMBER 4150
#define ZD_SVN_REVISION_STRING "4154"
#define ZD_SVN_REVISION_NUMBER 4154

View file

@ -558,7 +558,7 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
return Parts[0].Texture->CopyTrueColorPixels(bmp, x, y, rotate, inf);
}
if (rotate != 0 || (inf != NULL && inf->op != OP_OVERWRITE && inf->op != OP_COPY))
if (rotate != 0 || (inf != NULL && ((inf->op != OP_OVERWRITE && inf->op != OP_COPY) || inf->blend != BLEND_NONE)))
{ // We are doing some sort of fancy stuff to the destination bitmap, so composite to
// a temporary bitmap, and copy that.
FBitmap tbmp;

View file

@ -465,6 +465,16 @@ OptionMenu "CustomizeControls"
StaticText "Weapons", 1
Control "Next weapon", "weapnext"
Control "Previous weapon", "weapprev"
Control "Weapon Slot 1", "slot 1"
Control "Weapon Slot 2", "slot 2"
Control "Weapon Slot 3", "slot 3"
Control "Weapon Slot 4", "slot 4"
Control "Weapon Slot 5", "slot 5"
Control "Weapon Slot 6", "slot 6"
Control "Weapon Slot 7", "slot 7"
Control "Weapon Slot 8", "slot 8"
Control "Weapon Slot 9", "slot 9"
Control "Weapon Slot 0", "slot 0"
StaticText ""
StaticText "Inventory", 1
Control "Activate item", "invuse"