- 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:
Christoph Oelckers 2009-03-25 23:29:00 +00:00
commit 03e8f0e355
3 changed files with 27 additions and 40 deletions

View file

@ -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));