mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
- Fixed: FWeaponSlot::PickWeapon() wrapped around improperly when the starting
value for i was 0. SVN r1750 (trunk)
This commit is contained in:
parent
00f88610ac
commit
be9830f219
2 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,8 @@
|
|||
August 3, 2009 (Changes by Graf Zahl)
|
||||
August 4, 2009
|
||||
- Fixed: FWeaponSlot::PickWeapon() wrapped around improperly when the starting
|
||||
value for i was 0.
|
||||
|
||||
August 3, 2009 (Changes by Graf Zahl)
|
||||
- Added kgsws's SummonActor enhancement and bumped netgame and demo versions
|
||||
because this submission changes an existing command.
|
||||
|
||||
|
|
|
@ -776,9 +776,9 @@ AWeapon *FWeaponSlot::PickWeapon(player_t *player)
|
|||
player->ReadyWeapon->SisterWeapon != NULL &&
|
||||
player->ReadyWeapon->SisterWeapon->GetClass() == Weapons[i].Type))
|
||||
{
|
||||
for (j = (unsigned)(i - 1) % Weapons.Size();
|
||||
for (j = (i == 0 ? Weapons.Size() - 1 : i - 1);
|
||||
j != i;
|
||||
j = (unsigned)(j + Weapons.Size() - 1) % Weapons.Size()) // + Weapons.Size is to avoid underflows
|
||||
j = (j == 0 ? Weapons.Size() - 1 : j - 1))
|
||||
{
|
||||
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory(Weapons[j].Type));
|
||||
|
||||
|
|
Loading…
Reference in a new issue