mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-30 00:41:19 +00:00
* Updated to ZDoom 4161:
- Fixed: RandomSpawner could hang on lists with monsters when nomonsters is enabled or with 'None' items. - Fixed: A TITLEMAP defined with SpawnWithWeaponRaised set caused a crash. - Fixed: r4067 completely disabled weapon switching via A_ReFire. - Fixed: r3860 inadvertently inverted the damage check for thrusting in P_RadiusAttack(). - Cleared GCC warnings. - Fixed: strcpy on map arrays didn't properly translate the array number. - Fixed: the ExplosiveBarrel's height was wrong. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1531 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
e7092846bb
commit
5f6aad30f5
10 changed files with 49 additions and 28 deletions
|
@ -215,6 +215,7 @@ enum
|
|||
WF_DISABLESWITCH = 1 << 4, // Disable weapon switching completely
|
||||
WF_WEAPONRELOADOK = 1 << 5, // [XA] Okay to reload this weapon.
|
||||
WF_WEAPONZOOMOK = 1 << 6, // [XA] Okay to use weapon zoom function.
|
||||
WF_REFIRESWITCHOK = 1 << 7, // Mirror WF_WEAPONSWITCHOK for A_ReFire
|
||||
};
|
||||
|
||||
#define WPIECE1 1
|
||||
|
|
|
@ -1107,7 +1107,6 @@ void APowerWeaponLevel2::EndEffect ()
|
|||
Super::EndEffect();
|
||||
if (player != NULL)
|
||||
{
|
||||
|
||||
if (player->ReadyWeapon != NULL &&
|
||||
player->ReadyWeapon->WeaponFlags & WIF_POWERED_UP)
|
||||
{
|
||||
|
|
|
@ -59,22 +59,24 @@ class ARandomSpawner : public AActor
|
|||
// Take a random number...
|
||||
n = pr_randomspawn(n);
|
||||
// And iterate in the array up to the random number chosen.
|
||||
while (n > -1)
|
||||
while (n > -1 && di != NULL)
|
||||
{
|
||||
if (di->Name != NAME_None)
|
||||
if (di->Name != NAME_None &&
|
||||
(!nomonsters || !(GetDefaultByType(PClass::FindClass(di->Name))->flags3 & MF3_ISMONSTER)))
|
||||
{
|
||||
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;
|
||||
}
|
||||
n -= di->amount;
|
||||
if ((di->Next != NULL) && (n > -1))
|
||||
di = di->Next;
|
||||
else
|
||||
n = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
di = di->Next;
|
||||
}
|
||||
}
|
||||
// So now we can spawn the dropped item.
|
||||
if (bouncecount >= MAX_RANDOMSPAWNERS_RECURSION) // Prevents infinite recursions
|
||||
if (di == NULL || bouncecount >= MAX_RANDOMSPAWNERS_RECURSION) // Prevents infinite recursions
|
||||
{
|
||||
Spawn("Unknown", x, y, z, NO_REPLACE); // Show that there's a problem.
|
||||
Destroy();
|
||||
|
|
|
@ -7327,7 +7327,12 @@ scriptwait:
|
|||
{
|
||||
case PCD_STRCPYTOMAPCHRANGE:
|
||||
{
|
||||
Stack[sp-6] = activeBehavior->CopyStringToArray(STACK(5), index, capacity, lookup);
|
||||
int a = STACK(5);
|
||||
if (a < NUM_MAPVARS && a > 0 &&
|
||||
activeBehavior->MapVars[a])
|
||||
{
|
||||
Stack[sp-6] = activeBehavior->CopyStringToArray(*(activeBehavior->MapVars[a]), index, capacity, lookup);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PCD_STRCPYTOWORLDCHRANGE:
|
||||
|
@ -7856,7 +7861,7 @@ static void ShowProfileData(TArray<ProfileCollector> &profiles, long ilimit,
|
|||
}
|
||||
|
||||
// Module name
|
||||
mysnprintf(modname, sizeof(modname), prof->Module->GetModuleName());
|
||||
mysnprintf(modname, sizeof(modname), "%s", prof->Module->GetModuleName());
|
||||
|
||||
// Script/function name
|
||||
if (functions)
|
||||
|
@ -7932,7 +7937,7 @@ CCMD(acsprofile)
|
|||
// If it's a name, set the sort method. We accept partial matches for
|
||||
// options that are shorter than the sort name.
|
||||
size_t optlen = strlen(argv[i]);
|
||||
int j;
|
||||
unsigned int j;
|
||||
for (j = 0; j < countof(sort_names); ++j)
|
||||
{
|
||||
if (optlen < sort_match_len[j] || optlen > strlen(sort_names[j]))
|
||||
|
|
|
@ -908,7 +908,7 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
|
|||
if (!(tm.thing->flags & MF_MISSILE) ||
|
||||
!(tm.thing->flags2 & MF2_RIP) ||
|
||||
(thing->flags5 & MF5_DONTRIP) ||
|
||||
(tm.thing->flags6 & MF6_NOBOSSRIP) && (thing->flags2 & MF2_BOSS))
|
||||
((tm.thing->flags6 & MF6_NOBOSSRIP) && (thing->flags2 & MF2_BOSS)))
|
||||
{
|
||||
if (tm.thing->flags3 & thing->flags3 & MF3_DONTOVERLAP)
|
||||
{ // Some things prefer not to overlap each other, if possible
|
||||
|
@ -4581,7 +4581,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
if (!(flags & RADF_NODAMAGE) && !(bombspot->flags3 & MF3_BLOODLESSIMPACT))
|
||||
P_TraceBleed (newdam > 0 ? newdam : damage, thing, bombspot);
|
||||
|
||||
if (!(flags & RADF_NODAMAGE) || !(bombspot->flags2 & MF2_NODMGTHRUST))
|
||||
if ((flags & RADF_NODAMAGE) || !(bombspot->flags2 & MF2_NODMGTHRUST))
|
||||
{
|
||||
if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST))
|
||||
{
|
||||
|
|
|
@ -170,8 +170,11 @@ void P_BringUpWeapon (player_t *player)
|
|||
|
||||
if (player->PendingWeapon == WP_NOCHANGE)
|
||||
{
|
||||
player->psprites[ps_weapon].sy = WEAPONTOP;
|
||||
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetReadyState());
|
||||
if (player->ReadyWeapon != NULL)
|
||||
{
|
||||
player->psprites[ps_weapon].sy = WEAPONTOP;
|
||||
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetReadyState());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -477,12 +480,22 @@ void P_BobWeapon (player_t *player, pspdef_t *psp, fixed_t *x, fixed_t *y)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
void DoReadyWeaponToSwitch (AActor *self)
|
||||
void DoReadyWeaponToSwitch (AActor *self, bool switchable)
|
||||
{
|
||||
// Prepare for switching action.
|
||||
player_t *player;
|
||||
if (self && (player = self->player))
|
||||
player->WeaponState |= WF_WEAPONSWITCHOK;
|
||||
{
|
||||
if (switchable)
|
||||
{
|
||||
player->WeaponState |= WF_WEAPONSWITCHOK | WF_REFIRESWITCHOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// WF_WEAPONSWITCHOK is automatically cleared every tic by P_SetPsprite().
|
||||
player->WeaponState &= ~WF_REFIRESWITCHOK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoReadyWeaponDisableSwitch (AActor *self, INTBOOL disable)
|
||||
|
@ -494,6 +507,7 @@ void DoReadyWeaponDisableSwitch (AActor *self, INTBOOL disable)
|
|||
if (disable)
|
||||
{
|
||||
player->WeaponState |= WF_DISABLESWITCH;
|
||||
player->WeaponState &= ~WF_REFIRESWITCHOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -589,7 +603,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_WeaponReady)
|
|||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_INT(paramflags, 0);
|
||||
|
||||
if (!(paramflags & WRF_NoSwitch)) DoReadyWeaponToSwitch(self);
|
||||
DoReadyWeaponToSwitch(self, !(paramflags & WRF_NoSwitch));
|
||||
if ((paramflags & WRF_NoFire) != WRF_NoFire) DoReadyWeaponToFire(self, !(paramflags & WRF_NoPrimary), !(paramflags & WRF_NoSecondary));
|
||||
if (!(paramflags & WRF_NoBob)) DoReadyWeaponToBob(self);
|
||||
if ((paramflags & WRF_AllowReload)) DoReadyWeaponToReload(self);
|
||||
|
@ -739,7 +753,7 @@ void A_ReFire(AActor *self, FState *state)
|
|||
{
|
||||
return;
|
||||
}
|
||||
pending = player->PendingWeapon == WP_NOCHANGE && (player->WeaponState & WF_WEAPONSWITCHOK);
|
||||
pending = player->PendingWeapon != WP_NOCHANGE && (player->WeaponState & WF_REFIRESWITCHOK);
|
||||
if ((player->cmd.ucmd.buttons & BT_ATTACK)
|
||||
&& !player->ReadyWeapon->bAltFire && !pending && player->health > 0)
|
||||
{
|
||||
|
|
|
@ -94,7 +94,7 @@ void P_GunShot (AActor *mo, bool accurate, const PClass *pufftype, angle_t pitch
|
|||
void DoReadyWeapon(AActor * self);
|
||||
void DoReadyWeaponToBob(AActor * self);
|
||||
void DoReadyWeaponToFire(AActor * self, bool primary = true, bool secondary = true);
|
||||
void DoReadyWeaponToSwitch(AActor * self);
|
||||
void DoReadyWeaponToSwitch(AActor * self, bool switchable = true);
|
||||
|
||||
DECLARE_ACTION(A_Raise)
|
||||
void A_ReFire(AActor *self, FState *state = NULL);
|
||||
|
|
|
@ -244,10 +244,10 @@ player_t::player_t()
|
|||
lastkilltime(0),
|
||||
multicount(0),
|
||||
spreecount(0),
|
||||
WeaponState(0),
|
||||
ReadyWeapon(0),
|
||||
PendingWeapon(0),
|
||||
cheats(0),
|
||||
WeaponState(0),
|
||||
timefreezer(0),
|
||||
refire(0),
|
||||
inconsistant(0),
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "4154"
|
||||
#define ZD_SVN_REVISION_NUMBER 4154
|
||||
#define ZD_SVN_REVISION_STRING "4161"
|
||||
#define ZD_SVN_REVISION_NUMBER 4161
|
||||
|
|
|
@ -6,7 +6,7 @@ ACTOR ExplosiveBarrel 2035
|
|||
SpawnID 125
|
||||
Health 20
|
||||
Radius 10
|
||||
Height 34
|
||||
Height 42
|
||||
+SOLID
|
||||
+SHOOTABLE
|
||||
+NOBLOOD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue