- Fixed: R_DrawSkyStriped used frontyScale without initializing it first.
- Fixed: P_LineAttack may not check the puff actor for MF6_FORCEPAIN because it's not necessarily spawned yet. - Fixed: FWeaponSlots::PickNext/PrevWeapon must be limited to one iteration through the weapon slots. Otherwise they will hang if there's no weapons in a player's inventory. SVN r1659 (trunk)
This commit is contained in:
parent
da2df2778e
commit
f4c9cf9c4e
4 changed files with 22 additions and 5 deletions
|
|
@ -974,6 +974,7 @@ static bool FindMostRecentWeapon(player_t *player, int *slot, int *index)
|
|||
AWeapon *FWeaponSlots::PickNextWeapon(player_t *player)
|
||||
{
|
||||
int startslot, startindex;
|
||||
int slotschecked = 0;
|
||||
|
||||
if (player->mo == NULL)
|
||||
{
|
||||
|
|
@ -997,6 +998,7 @@ AWeapon *FWeaponSlots::PickNextWeapon(player_t *player)
|
|||
if (++index >= Slots[slot].Size())
|
||||
{
|
||||
index = 0;
|
||||
slotschecked++;
|
||||
if (++slot >= NUM_WEAPON_SLOTS)
|
||||
{
|
||||
slot = 0;
|
||||
|
|
@ -1009,7 +1011,7 @@ AWeapon *FWeaponSlots::PickNextWeapon(player_t *player)
|
|||
return weap;
|
||||
}
|
||||
}
|
||||
while (slot != startslot || index != startindex);
|
||||
while ((slot != startslot || index != startindex) && slotschecked < NUM_WEAPON_SLOTS);
|
||||
}
|
||||
return player->ReadyWeapon;
|
||||
}
|
||||
|
|
@ -1027,6 +1029,7 @@ AWeapon *FWeaponSlots::PickNextWeapon(player_t *player)
|
|||
AWeapon *FWeaponSlots::PickPrevWeapon (player_t *player)
|
||||
{
|
||||
int startslot, startindex;
|
||||
int slotschecked = 0;
|
||||
|
||||
if (player->mo == NULL)
|
||||
{
|
||||
|
|
@ -1049,6 +1052,7 @@ AWeapon *FWeaponSlots::PickPrevWeapon (player_t *player)
|
|||
{
|
||||
if (--index < 0)
|
||||
{
|
||||
slotschecked++;
|
||||
if (--slot < 0)
|
||||
{
|
||||
slot = NUM_WEAPON_SLOTS - 1;
|
||||
|
|
@ -1062,7 +1066,7 @@ AWeapon *FWeaponSlots::PickPrevWeapon (player_t *player)
|
|||
return weap;
|
||||
}
|
||||
}
|
||||
while (slot != startslot || index != startindex);
|
||||
while ((slot != startslot || index != startindex) && slotschecked < NUM_WEAPON_SLOTS);
|
||||
}
|
||||
return player->ReadyWeapon;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue