mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- changed handling of DF_NO_COOP_WEAPON_SPAWN dmflag so that weapons are not determined by class type but by a newly added flag WEAPONSPAWN, to allow CustomInventory replacements to act like weapons when being spawned.
This commit is contained in:
parent
79f3984346
commit
6d4eb7f62d
4 changed files with 8 additions and 2 deletions
|
@ -340,6 +340,7 @@ enum
|
||||||
MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO)
|
MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO)
|
||||||
MF7_ALWAYSTELEFRAG = 0x00000004, // will unconditionally be telefragged when in the way. Overrides all other settings.
|
MF7_ALWAYSTELEFRAG = 0x00000004, // will unconditionally be telefragged when in the way. Overrides all other settings.
|
||||||
MF7_HANDLENODELAY = 0x00000008, // respect NoDelay state flag
|
MF7_HANDLENODELAY = 0x00000008, // respect NoDelay state flag
|
||||||
|
MF7_WEAPONSPAWN = 0x00000010, // subject to DF_NO_COOP_WEAPON_SPAWN dmflag
|
||||||
|
|
||||||
// --- mobj.renderflags ---
|
// --- mobj.renderflags ---
|
||||||
|
|
||||||
|
|
|
@ -4724,7 +4724,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
||||||
// [RH] don't spawn extra weapons in coop if so desired
|
// [RH] don't spawn extra weapons in coop if so desired
|
||||||
if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN))
|
if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN))
|
||||||
{
|
{
|
||||||
if (i->IsDescendantOf (RUNTIME_CLASS(AWeapon)))
|
if (GetDefaultByType(i)->flags7 & MF7_WEAPONSPAWN)
|
||||||
{
|
{
|
||||||
if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH)
|
if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -240,6 +240,7 @@ static FFlagDef ActorFlags[]=
|
||||||
DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7),
|
DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7),
|
||||||
DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7),
|
DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7),
|
||||||
DEFINE_FLAG(MF7, ALWAYSTELEFRAG, AActor, flags7),
|
DEFINE_FLAG(MF7, ALWAYSTELEFRAG, AActor, flags7),
|
||||||
|
DEFINE_FLAG(MF7, WEAPONSPAWN, AActor, flags7),
|
||||||
|
|
||||||
// Effect flags
|
// Effect flags
|
||||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||||
|
|
|
@ -335,6 +335,7 @@ Actor Weapon : Inventory native
|
||||||
Weapon.BobSpeed 1.0
|
Weapon.BobSpeed 1.0
|
||||||
Weapon.BobRangeX 1.0
|
Weapon.BobRangeX 1.0
|
||||||
Weapon.BobRangeY 1.0
|
Weapon.BobRangeY 1.0
|
||||||
|
+WEAPONSPAWN
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
LightDone:
|
LightDone:
|
||||||
|
@ -362,4 +363,7 @@ Actor WeaponHolder : Inventory native
|
||||||
+INVENTORY.UNDROPPABLE
|
+INVENTORY.UNDROPPABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor WeaponPiece : Inventory native {}
|
Actor WeaponPiece : Inventory native
|
||||||
|
{
|
||||||
|
+WEAPONSPAWN
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue