diff options
Diffstat (limited to 'src/game/base/base.cc')
-rw-r--r-- | src/game/base/base.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/game/base/base.cc b/src/game/base/base.cc index dfde132..7fa5299 100644 --- a/src/game/base/base.cc +++ b/src/game/base/base.cc @@ -59,7 +59,7 @@ void Base::func_join(core::Player *player, std::string const &args) ship->entity_location.assign(dock->location() + (dock->axis().forward() * dock->radius()*2.0f)); ship->entity_axis.assign(dock->axis()); */ - core::server()->send_sound(player, "game/buy-ship"); + player->sound("game/buy-ship"); std::string message("^B"); message.append(player->name()); @@ -128,34 +128,39 @@ void Base::func_buy(core::Player *player, std::string const &args) player->set_control(ship); core::server()->broadcast("^B" + player->name() + " ^Bpurchased " + aux::article(shipmodel->name())); - core::server()->send_sound(player, "game/buy-ship"); + player->sound("game/buy-ship"); } else { - core::server()->send(player, "Usage: buy [^B" + helpstr + "^N]"); + player->send("Usage: buy [^B" + helpstr + "^N]"); } } // a player sends standard hails void Base::func_hail(core::Player *player, std::string const &args) { + if (player->mute()) { + player->send("^BYou have been muted."); + return; + } + std::string target; std::istringstream is(args); if (!(is >> target)) { - core::server()->send(player, "Usage: hail [player]"); + player->send("Usage: hail [player]"); return; } core::Player *targetplayer = core::server()->find_player(target); if (!targetplayer) { - core::server()->send(player, "^BPlayer " + target + "^B not found."); + player->send("^BPlayer " + target + "^B not found."); return; } - core::server()->send(player, "^BYou hail " + targetplayer->name() + "^B."); - core::server()->send_sound(player, "com/hail"); + player->send("^BYou hail " + targetplayer->name() + "^B."); + player->sound("com/hail"); - core::server()->send(targetplayer, "^B" + player->name() + "^B hails you!"); - core::server()->send_sound(targetplayer, "com/hail"); + targetplayer->send("^B" + player->name() + "^B hails you!"); + targetplayer->send("com/hail"); } // a player actives the hyperspace jump drive on his ship @@ -196,14 +201,14 @@ void Base::func_dock(core::Player *player,core::Entity *entity) return; if (math::distance(entity->location(), player->control()->location()) > 2.0f * entity->radius()) { - core::server()->send(player, "^B" + entity->name() + " is out of range!"); + player->send("^B" + entity->name() + " is out of range!"); return; } player->control()->location().assign(entity->location()); player->control()->set_eventstate(core::Entity::Docked); player->set_view(entity); - core::server()->send(player, "^BDocking at " + entity->name() + "^B..."); + player->send("^BDocking at " + entity->name() + "^B..."); } // launch request |