diff options
author | Matthias Hartmann <hartmann.matthias@gmail.com> | 2005-09-17 16:42:34 +0000 |
---|---|---|
committer | Matthias Hartmann <hartmann.matthias@gmail.com> | 2005-09-17 16:42:34 +0000 |
commit | db1f671668a615c5e1a4f48009708407bbac8d8c (patch) | |
tree | b10ef65f484c27facc224bfc62c360e9caacaa7e /src/game.cpp | |
parent | 7d7ea134637eb06e194068f157d3eead90115631 (diff) | |
download | mana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.gz mana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.bz2 mana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.xz mana-db1f671668a615c5e1a4f48009708407bbac8d8c.zip |
Added PVP
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index f2f86064..8f9586d9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -664,16 +664,18 @@ void do_input() { switch (target->getType()) { - // Player default: trade + // Player default: attack case Being::PLAYER: { if (target != player_node) { + autoTarget = target; + attack(target);/* MessageOut outMsg; outMsg.writeShort(CMSG_TRADE_REQUEST); outMsg.writeLong(target->getId()); writeSet(6); - tradePartnerName = target->getName(); + tradePartnerName = target->getName();*/ } } break; @@ -772,7 +774,7 @@ void do_input() Being *being; FloorItem *floorItem; - if ((being = findNode(mx, my))) { + if ((being = findNode(mx, my)) && being != player_node) { popupMenu->showPopup(event.button.x, event.button.y, being); } else if ((floorItem = find_floor_item_by_id( @@ -902,11 +904,11 @@ void do_input() if (keys[SDLK_LCTRL] || keys[SDLK_RCTRL] || joy[JOY_BTN0]) { Being *monster = attack(x, y, player_node->direction); - if (monster == NULL && autoTarget != NULL) + if (monster == NULL && autoTarget != NULL && monster != player_node) { attack(autoTarget); } - else if (keys[SDLK_LSHIFT]) + else if (keys[SDLK_LSHIFT] && monster != player_node) { autoTarget = monster; } |