mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
This commit is contained in:
commit
bf1aa71194
7 changed files with 35 additions and 25 deletions
|
@ -230,7 +230,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo, int am
|
||||||
int enough, enoughmask;
|
int enough, enoughmask;
|
||||||
int lAmmoUse1;
|
int lAmmoUse1;
|
||||||
|
|
||||||
if ((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO))
|
if ((dmflags & DF_INFINITE_AMMO) || (Owner->FindInventory (PClass::FindActor(NAME_PowerInfiniteAmmo), true) != nullptr))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ DEFINE_ACTION_FUNCTION(AWeapon, CheckAmmo)
|
||||||
|
|
||||||
bool AWeapon::DepleteAmmo (bool altFire, bool checkEnough, int ammouse)
|
bool AWeapon::DepleteAmmo (bool altFire, bool checkEnough, int ammouse)
|
||||||
{
|
{
|
||||||
if (!((dmflags & DF_INFINITE_AMMO) || (Owner->player->cheats & CF_INFINITEAMMO)))
|
if (!((dmflags & DF_INFINITE_AMMO) || (Owner->FindInventory (PClass::FindActor(NAME_PowerInfiniteAmmo), true) != nullptr)))
|
||||||
{
|
{
|
||||||
if (checkEnough && !CheckAmmo (altFire ? AltFire : PrimaryFire, false, false, ammouse))
|
if (checkEnough && !CheckAmmo (altFire ? AltFire : PrimaryFire, false, false, ammouse))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1283,7 +1283,7 @@ DMenuItemBase * CreateOptionMenuItemSubmenu(const char *label, FName cmd, int ce
|
||||||
|
|
||||||
DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBindings *bindings)
|
DMenuItemBase * CreateOptionMenuItemControl(const char *label, FName cmd, FKeyBindings *bindings)
|
||||||
{
|
{
|
||||||
auto c = PClass::FindClass("OptionMenuItemControl");
|
auto c = PClass::FindClass("OptionMenuItemControlBase");
|
||||||
auto p = c->CreateNew();
|
auto p = c->CreateNew();
|
||||||
VMValue params[] = { p, FString(label), cmd.GetIndex(), bindings };
|
VMValue params[] = { p, FString(label), cmd.GetIndex(), bindings };
|
||||||
auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false));
|
auto f = dyn_cast<PFunction>(c->Symbols.FindSymbol("Init", false));
|
||||||
|
|
|
@ -203,6 +203,8 @@ xx(CallTryPickup)
|
||||||
xx(QuestItem25)
|
xx(QuestItem25)
|
||||||
xx(QuestItem28)
|
xx(QuestItem28)
|
||||||
xx(QuestItem29)
|
xx(QuestItem29)
|
||||||
|
xx(PowerDoubleFiringSpeed)
|
||||||
|
xx(PowerInfiniteAmmo)
|
||||||
|
|
||||||
xx(AcolyteBlue)
|
xx(AcolyteBlue)
|
||||||
xx(SpectralLightningV1)
|
xx(SpectralLightningV1)
|
||||||
|
|
|
@ -771,7 +771,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
||||||
int highestfloorterrain = -1;
|
int highestfloorterrain = -1;
|
||||||
FTextureID lowestceilingpic;
|
FTextureID lowestceilingpic;
|
||||||
sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL;
|
sector_t *lowestceilingsec = NULL, *highestfloorsec = NULL;
|
||||||
secplane_t *highestfloorplanes[2] = { NULL, NULL };
|
secplane_t *highestfloorplanes[2] = { &open.frontfloorplane, &open.backfloorplane };
|
||||||
|
|
||||||
highestfloorpic.SetInvalid();
|
highestfloorpic.SetInvalid();
|
||||||
lowestceilingpic.SetInvalid();
|
lowestceilingpic.SetInvalid();
|
||||||
|
@ -798,13 +798,19 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
||||||
lowestceilingsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
lowestceilingsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ff_top > highestfloor && delta1 <= delta2 && (!restrict || thing->Z() >= ff_top))
|
if(delta1 <= delta2 && (!restrict || thing->Z() >= ff_top))
|
||||||
{
|
{
|
||||||
highestfloor = ff_top;
|
if (ff_top > highestfloor)
|
||||||
highestfloorpic = *rover->top.texture;
|
{
|
||||||
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
highestfloor = ff_top;
|
||||||
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
highestfloorpic = *rover->top.texture;
|
||||||
highestfloorplanes[j] = rover->top.plane;
|
highestfloorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
||||||
|
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
|
||||||
|
}
|
||||||
|
if (ff_top > highestfloorplanes[j]->ZatPoint(x, y))
|
||||||
|
{
|
||||||
|
highestfloorplanes[j] = rover->top.plane;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(ff_top > lowestfloor[j] && ff_top <= thing->Z() + thing->MaxStepHeight) lowestfloor[j] = ff_top;
|
if(ff_top > lowestfloor[j] && ff_top <= thing->Z() + thing->MaxStepHeight) lowestfloor[j] = ff_top;
|
||||||
}
|
}
|
||||||
|
@ -816,16 +822,16 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
||||||
open.floorpic = highestfloorpic;
|
open.floorpic = highestfloorpic;
|
||||||
open.floorterrain = highestfloorterrain;
|
open.floorterrain = highestfloorterrain;
|
||||||
open.bottomsec = highestfloorsec;
|
open.bottomsec = highestfloorsec;
|
||||||
if (highestfloorplanes[0])
|
}
|
||||||
{
|
if (highestfloorplanes[0] != &open.frontfloorplane)
|
||||||
open.frontfloorplane = *highestfloorplanes[0];
|
{
|
||||||
if (open.frontfloorplane.fC() < 0) open.frontfloorplane.FlipVert();
|
open.frontfloorplane = *highestfloorplanes[0];
|
||||||
}
|
if (open.frontfloorplane.fC() < 0) open.frontfloorplane.FlipVert();
|
||||||
if (highestfloorplanes[1])
|
}
|
||||||
{
|
if (highestfloorplanes[1] != &open.backfloorplane)
|
||||||
open.backfloorplane = *highestfloorplanes[1];
|
{
|
||||||
if (open.backfloorplane.fC() < 0) open.backfloorplane.FlipVert();
|
open.backfloorplane = *highestfloorplanes[1];
|
||||||
}
|
if (open.backfloorplane.fC() < 0) open.backfloorplane.FlipVert();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lowestceiling < open.top)
|
if(lowestceiling < open.top)
|
||||||
|
|
|
@ -2841,7 +2841,7 @@ FUNC(LS_SetPlayerProperty)
|
||||||
// Add or remove a power
|
// Add or remove a power
|
||||||
if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED)
|
if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED)
|
||||||
{
|
{
|
||||||
static ENamedName powers[11] =
|
static ENamedName powers[13] =
|
||||||
{
|
{
|
||||||
NAME_PowerInvulnerable,
|
NAME_PowerInvulnerable,
|
||||||
NAME_PowerStrength,
|
NAME_PowerStrength,
|
||||||
|
@ -2853,7 +2853,9 @@ FUNC(LS_SetPlayerProperty)
|
||||||
NAME_PowerFlight,
|
NAME_PowerFlight,
|
||||||
NAME_None,
|
NAME_None,
|
||||||
NAME_None,
|
NAME_None,
|
||||||
NAME_PowerSpeed
|
NAME_PowerSpeed,
|
||||||
|
NAME_PowerInfiniteAmmo,
|
||||||
|
NAME_PowerDoubleFiringSpeed
|
||||||
};
|
};
|
||||||
int power = arg2 - PROP_INVULNERABILITY;
|
int power = arg2 - PROP_INVULNERABILITY;
|
||||||
|
|
||||||
|
|
|
@ -1447,7 +1447,7 @@ void DPSprite::Tick()
|
||||||
Tics--;
|
Tics--;
|
||||||
|
|
||||||
// [BC] Apply double firing speed.
|
// [BC] Apply double firing speed.
|
||||||
if ((Flags & PSPF_POWDOUBLE) && Tics && (Owner->cheats & CF_DOUBLEFIRINGSPEED))
|
if ((Flags & PSPF_POWDOUBLE) && Tics && (Owner->mo->FindInventory (PClass::FindActor(NAME_PowerDoubleFiringSpeed), true)))
|
||||||
Tics--;
|
Tics--;
|
||||||
|
|
||||||
if (!Tics)
|
if (!Tics)
|
||||||
|
|
|
@ -1854,7 +1854,7 @@ public:
|
||||||
intptr_t v1i = intptr_t(ParsedLines[i].v1);
|
intptr_t v1i = intptr_t(ParsedLines[i].v1);
|
||||||
intptr_t v2i = intptr_t(ParsedLines[i].v2);
|
intptr_t v2i = intptr_t(ParsedLines[i].v2);
|
||||||
|
|
||||||
if (v1i >= level.vertexes.Size() || v2i >= level.vertexes.Size() || v1i < 0 || v2i < 0)
|
if ((unsigned)v1i >= level.vertexes.Size() || (unsigned)v2i >= level.vertexes.Size())
|
||||||
{
|
{
|
||||||
I_Error ("Line %d has invalid vertices: %zd and/or %zd.\nThe map only contains %u vertices.", i+skipped, v1i, v2i, level.vertexes.Size());
|
I_Error ("Line %d has invalid vertices: %zd and/or %zd.\nThe map only contains %u vertices.", i+skipped, v1i, v2i, level.vertexes.Size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue