- Removed some obsolete code from G_InitLevelLocals that was causing problems
with maps that have no name. - Fixed: The inner loop in AWeaponSlot::PickWeapon could endlessly loop when the counter variable became negative. SVN r1504 (trunk)
This commit is contained in:
parent
f7bcd0b98e
commit
03e8f0e355
3 changed files with 27 additions and 40 deletions
|
|
@ -763,7 +763,7 @@ AWeapon *FWeaponSlot::PickWeapon(player_t *player)
|
|||
{
|
||||
for (j = (unsigned)(i - 1) % Weapons.Size();
|
||||
j != i;
|
||||
j = (unsigned)(j - 1) % Weapons.Size())
|
||||
j = (unsigned)(j + Weapons.Size() - 1) % Weapons.Size()) // + Weapons.Size is to avoid underflows
|
||||
{
|
||||
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory(Weapons[j].Type));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue