mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- 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 25 additions and 38 deletions
|
@ -1,4 +1,8 @@
|
|||
March 25, 2009 (Changes by Graf Zahl)
|
||||
- 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.
|
||||
- Fixed: Implicitly defined clusters were not initialized when being created.
|
||||
|
||||
March 24, 2009 (Changes by Graf Zahl)
|
||||
|
|
|
@ -1262,45 +1262,28 @@ void G_InitLevelLocals ()
|
|||
|
||||
G_AirControlChanged ();
|
||||
|
||||
if (!info->LevelName.IsEmpty())
|
||||
{
|
||||
cluster_info_t *clus = FindClusterInfo (info->cluster);
|
||||
cluster_info_t *clus = FindClusterInfo (info->cluster);
|
||||
|
||||
level.partime = info->partime;
|
||||
level.sucktime = info->sucktime;
|
||||
level.cluster = info->cluster;
|
||||
level.clusterflags = clus ? clus->flags : 0;
|
||||
level.flags |= info->flags;
|
||||
level.flags2 |= info->flags2;
|
||||
level.levelnum = info->levelnum;
|
||||
level.Music = info->Music;
|
||||
level.musicorder = info->musicorder;
|
||||
level.partime = info->partime;
|
||||
level.sucktime = info->sucktime;
|
||||
level.cluster = info->cluster;
|
||||
level.clusterflags = clus ? clus->flags : 0;
|
||||
level.flags |= info->flags;
|
||||
level.flags2 |= info->flags2;
|
||||
level.levelnum = info->levelnum;
|
||||
level.Music = info->Music;
|
||||
level.musicorder = info->musicorder;
|
||||
|
||||
level.LevelName = level.info->LookupLevelName();
|
||||
strncpy (level.nextmap, info->nextmap, 8);
|
||||
level.nextmap[8] = 0;
|
||||
strncpy (level.secretmap, info->secretmap, 8);
|
||||
level.secretmap[8] = 0;
|
||||
strncpy (level.skypic1, info->skypic1, 8);
|
||||
level.skypic1[8] = 0;
|
||||
if (!level.skypic2[0])
|
||||
strncpy (level.skypic2, level.skypic1, 8);
|
||||
level.skypic2[8] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
level.partime = level.cluster = 0;
|
||||
level.sucktime = 0;
|
||||
level.LevelName = "Unnamed";
|
||||
level.nextmap[0] =
|
||||
level.secretmap[0] = 0;
|
||||
level.Music = "";
|
||||
strcpy (level.skypic1, "SKY1");
|
||||
strcpy (level.skypic2, "SKY1");
|
||||
level.flags = 0;
|
||||
level.flags2 = 0;
|
||||
level.levelnum = 1;
|
||||
}
|
||||
level.LevelName = level.info->LookupLevelName();
|
||||
strncpy (level.nextmap, info->nextmap, 8);
|
||||
level.nextmap[8] = 0;
|
||||
strncpy (level.secretmap, info->secretmap, 8);
|
||||
level.secretmap[8] = 0;
|
||||
strncpy (level.skypic1, info->skypic1, 8);
|
||||
level.skypic1[8] = 0;
|
||||
if (!level.skypic2[0])
|
||||
strncpy (level.skypic2, level.skypic1, 8);
|
||||
level.skypic2[8] = 0;
|
||||
|
||||
compatflags.Callback();
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue