mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- Fixed a crash in the weapon code with missing player starts.
SVN r1471 (trunk)
This commit is contained in:
parent
fcdab6a777
commit
bc91192473
1 changed files with 13 additions and 10 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue