diff options
Diffstat (limited to 'src/game/client/gameclient.cpp')
| -rw-r--r-- | src/game/client/gameclient.cpp | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 813e0ca0..1fde8f18 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -8,27 +8,30 @@ #include "gc_map_image.hpp" #include "gameclient.hpp" -#include "components/killmessages.hpp" -#include "components/chat.hpp" -#include "components/motd.hpp" + + +#include "components/binds.hpp" #include "components/broadcast.hpp" +#include "components/camera.hpp" +#include "components/chat.hpp" #include "components/console.hpp" -#include "components/binds.hpp" -#include "components/particles.hpp" -#include "components/menus.hpp" -#include "components/skins.hpp" +#include "components/controls.hpp" +#include "components/damageind.hpp" +#include "components/debughud.hpp" +#include "components/effects.hpp" +#include "components/emoticon.hpp" #include "components/flow.hpp" -#include "components/players.hpp" +#include "components/hud.hpp" #include "components/items.hpp" +#include "components/killmessages.hpp" #include "components/maplayers.hpp" -#include "components/camera.hpp" -#include "components/hud.hpp" -#include "components/debughud.hpp" -#include "components/controls.hpp" -#include "components/effects.hpp" +#include "components/menus.hpp" +#include "components/motd.hpp" +#include "components/particles.hpp" +#include "components/players.hpp" #include "components/scoreboard.hpp" +#include "components/skins.hpp" #include "components/sounds.hpp" -#include "components/emoticon.hpp" GAMECLIENT gameclient; @@ -51,6 +54,7 @@ static EFFECTS effects; static SCOREBOARD scoreboard; static SOUNDS sounds; static EMOTICON emoticon; +static DAMAGEIND damageind; static PLAYERS players; static ITEMS items; @@ -97,6 +101,7 @@ void GAMECLIENT::on_init() effects = &::effects; sounds = &::sounds; motd = &::motd; + damageind = &::damageind; // make a list of all the systems, make sure to add them in the corrent render order all.add(skins); @@ -115,6 +120,7 @@ void GAMECLIENT::on_init() all.add(&players); all.add(&maplayers_foreground); all.add(&particles->render_general); + all.add(damageind); all.add(&hud); all.add(&emoticon); all.add(&killmessages); @@ -140,6 +146,10 @@ void GAMECLIENT::on_init() for(int i = 0; i < all.num; i++) all.components[i]->on_init(); + // add the some console commands + MACRO_REGISTER_COMMAND("team", "", con_team, this); + MACRO_REGISTER_COMMAND("kill", "", con_kill, this); + // setup item sizes for(int i = 0; i < NUM_NETOBJTYPES; i++) snap_set_staticsize(i, netobj_get_size(i)); @@ -720,3 +730,15 @@ void GAMECLIENT::send_kill(int client_id) msg.pack(MSGFLAG_VITAL); client_send_msg(); } + + + +void GAMECLIENT::con_team(void *result, void *user_data) +{ + ((GAMECLIENT*)user_data)->send_switch_team(console_arg_int(result, 0)); +} + +void GAMECLIENT::con_kill(void *result, void *user_data) +{ + ((GAMECLIENT*)user_data)->send_kill(-1); +} |