diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/game/game.cc b/src/game/game.cc index a76d5e7..85cd457 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -22,10 +22,11 @@ namespace game /// a player joins the game void func_join(core::Player *player, std::string const &args) { - if (player->control) + if (player->control()) return; - player->control = new Ship(player); + player->player_control = new Ship(player); + player->control()->entity_color = player->color(); std::string message(player->name()); message.append(" joins the game."); @@ -37,17 +38,17 @@ void func_join(core::Player *player, std::string const &args) /// a player joins the spectators void func_spectate(core::Player *player, std::string const &args) { - if (!player->control) + if (!player->player_control) return; std::string message(player->name()); message.append(" spectates."); core::server()->broadcast(message); - if (player->control) { + if (player->control()) { // player has only ship for now - player->control->die(); - player->control = 0; + player->player_control->die(); + player->player_control = 0; } player->player_dirty = true; @@ -138,10 +139,10 @@ void Game::player_connect(core::Player *player) void Game::player_disconnect(core::Player *player) { - if (player->control) { + if (player->control()) { // player has only one ship for now - player->control->die(); - player->control = 0; + player->control()->die(); + player->player_control = 0; } } |