- Fixed a crash in the weapon code with missing player starts.

SVN r1471 (trunk)
This commit is contained in:
Christoph Oelckers 2009-03-11 00:42:04 +00:00
parent fcdab6a777
commit bc91192473

View file

@ -1140,19 +1140,22 @@ void FWeaponSlots::CompleteSetup(const PClass *type)
void P_CompleteWeaponSetup()
{
// Set up the weapon slots locally
LocalWeapons.CompleteSetup(players[consoleplayer].mo->GetClass());
// Now transmit them across the network
for (int i = 0; i < NUM_WEAPON_SLOTS; ++i)
if (players[consoleplayer].mo != NULL)
{
if (LocalWeapons.Slots[i].Size() > 0)
// Set up the weapon slots locally
LocalWeapons.CompleteSetup(players[consoleplayer].mo->GetClass());
// Now transmit them across the network
for (int i = 0; i < NUM_WEAPON_SLOTS; ++i)
{
Net_WriteByte(DEM_SETSLOT);
Net_WriteByte(i);
Net_WriteByte(LocalWeapons.Slots[i].Size());
for(int j = 0; j < LocalWeapons.Slots[i].Size(); j++)
if (LocalWeapons.Slots[i].Size() > 0)
{
Net_WriteWeapon(LocalWeapons.Slots[i].GetWeapon(j));
Net_WriteByte(DEM_SETSLOT);
Net_WriteByte(i);
Net_WriteByte(LocalWeapons.Slots[i].Size());
for(int j = 0; j < LocalWeapons.Slots[i].Size(); j++)
{
Net_WriteWeapon(LocalWeapons.Slots[i].GetWeapon(j));
}
}
}
}