| 9435 | int ObjInitTypeSpecific(object *objp, bool reinitializing); |
| 9436 | |
| 9437 | void MultiDoBashPlayerShip(uint8_t *data) { |
| 9438 | int count = 0; |
| 9439 | |
| 9440 | SKIP_HEADER(data, &count); |
| 9441 | int ship_index = FindShipName((const char *)data + count); |
| 9442 | if (ship_index < 0) |
| 9443 | ship_index = 0; |
| 9444 | |
| 9445 | // If told to switch to the Black Pyro, make sure it's allowed |
| 9446 | if (!stricmp(Ships[ship_index].name, "Black Pyro")) { |
| 9447 | extern bool MercInstalled(); |
| 9448 | if (!MercInstalled()) { |
| 9449 | BailOnMultiplayer("Exiting: Game requires Black Pyro"); |
| 9450 | } |
| 9451 | } |
| 9452 | |
| 9453 | AddHUDMessage("%s not allowed", Ships[Players[Player_num].ship_index].name); |
| 9454 | AddHUDMessage("Switching to %s", Ships[ship_index].name); |
| 9455 | |
| 9456 | PlayerChangeShip(Player_num, ship_index); |
| 9457 | mprintf(0, "Server told us to switch ships to the %s\n", (char *)data + count); |
| 9458 | |
| 9459 | FreeCockpit(); |
| 9460 | CloseShipHUD(); |
| 9461 | |
| 9462 | // ObjInitTypeSpecific(Player_object,0); //reset physics, model, etc. |
| 9463 | InitShipHUD(Players[Player_num].ship_index); |
| 9464 | InitCockpit(Players[Player_num].ship_index); |
| 9465 | |
| 9466 | if (GetHUDMode() == HUD_COCKPIT) |
| 9467 | SetHUDMode(HUD_COCKPIT); |
| 9468 | else if (GetHUDMode() == HUD_FULLSCREEN) |
| 9469 | SetHUDMode(HUD_FULLSCREEN); |
| 9470 | } |
| 9471 | |
| 9472 | // If its been x seconds since we've sent a heartbeat, send another! |
| 9473 |
no test coverage detected