diff --git a/Sources/Client/Client.cpp b/Sources/Client/Client.cpp index 929e730d..875f45da 100644 --- a/Sources/Client/Client.cpp +++ b/Sources/Client/Client.cpp @@ -491,6 +491,11 @@ namespace spades { if (!world->GetLocalPlayer() || world->GetLocalPlayer()->GetTeamId() >= 2) { // join + if (team == 255) { + // weaponId doesn't matter for spectators, but + // NetClient doesn't like invalid weapon ID + weap = WeaponType::RIFLE_WEAPON; + } net->SendJoin(team, weap, playerName, lastKills); } else { Player *p = world->GetLocalPlayer(); diff --git a/Sources/Client/World.h b/Sources/Client/World.h index 6d456750..34f7766b 100644 --- a/Sources/Client/World.h +++ b/Sources/Client/World.h @@ -117,7 +117,7 @@ namespace spades { void SetMode(IGameMode *); Team &GetTeam(int t) { - if (t >= 2) // spectator + if (t >= 2 || t < 0) // spectator return teams[2]; return teams[t]; }