Fix some crashes
This commit is contained in:
parent
0ce8d07311
commit
23231dd2a4
@ -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();
|
||||
|
@ -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];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user