diff options
-rw-r--r-- | data/branding.xml | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 12 | ||||
-rw-r--r-- | src/localplayer.cpp | 18 | ||||
-rw-r--r-- | src/main.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwserv/protocol.h | 6 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 4 |
6 files changed, 27 insertions, 29 deletions
diff --git a/data/branding.xml b/data/branding.xml index 29974ab4..fd5779f6 100644 --- a/data/branding.xml +++ b/data/branding.xml @@ -15,7 +15,7 @@ writing a branding.xml for their forks. <option name="appIcon" value="icons/tmw.png"/> <option name="loginMusic" value="Magick - Real.ogg"/> <option name="defaultServer" value="server.themanaworld.org"/> - <option name="defaultPort" value="9601"/> + <option name="defaultPort" value="6901"/> <option name="defaultUpdateHost" value="http://updates.themanaworld.org"/> <option name="font" value="fonts/dejavusans.ttf" /> <option name="boldFont" value="fonts/dejavusans-bold.ttf" /> diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index cbde95c4..787723c0 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -357,20 +357,12 @@ void Viewport::mousePressed(gcn::MouseEvent &event) if (player_node->withinAttackRange(being) || keyboard.isKeyActive(keyboard.KEY_ATTACK)) { - player_node->setGotoTarget(being); - player_node->attack(being, !keyboard.isKeyActive(keyboard.KEY_TARGET)); - } else { -#ifdef TMWSERV_SUPPORT - player_node->setDestination(event.getX() + (int) mPixelViewX, - event.getY() + (int) mPixelViewY); -#else - player_node->setDestination(tilex, tiley); -#endif + player_node->setGotoTarget(being); } break; default: @@ -399,9 +391,9 @@ void Viewport::mousePressed(gcn::MouseEvent &event) event.getY() + (int) mPixelViewY); } #else - player_node->stopAttack(); player_node->setDestination(tilex, tiley); #endif + player_node->stopAttack(); mPlayerFollowMouse = true; } } diff --git a/src/localplayer.cpp b/src/localplayer.cpp index b9f4b850..c9dc771d 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -209,18 +209,14 @@ void LocalPlayer::logic() // Find whether target is in range const int rangeX = abs(mTarget->getPosition().x - getPosition().x); const int rangeY = abs(mTarget->getPosition().y - getPosition().y); - const int attackRange = getAttackRange(); - const int inRange = rangeX > attackRange || rangeY > attackRange - ? 1 : 0; #else // Find whether target is in range const int rangeX = abs(mTarget->mX - mX); const int rangeY = abs(mTarget->mY - mY); +#endif const int attackRange = getAttackRange(); const int inRange = rangeX > attackRange || rangeY > attackRange ? 1 : 0; -#endif - mTarget->setTargetAnimation( mTargetCursor[inRange][mTarget->getTargetCursorSize()]); @@ -290,9 +286,7 @@ void LocalPlayer::nextStep() if (mGoingToTarget && mTarget && withinAttackRange(mTarget)) { mAction = Being::STAND; -#ifdef EATHENA_SUPPORT attack(mTarget, true); -#endif mGoingToTarget = false; mPath.clear(); return; @@ -703,11 +697,11 @@ void LocalPlayer::attack(Being *target, bool keep) #else int dist_x = target->mX - mX; int dist_y = target->mY - mY; -#endif // Must be standing to attack if (mAction != STAND) return; +#endif if (abs(dist_y) >= abs(dist_x)) { @@ -744,10 +738,14 @@ void LocalPlayer::attack(Being *target, bool keep) sound.playSfx("sfx/fist-swish.ogg"); } +#ifdef TMWSERV_SUPPORT + if (mLastAction == STAND) +#endif Net::getPlayerHandler()->attack(target->getId()); - +#ifdef EATHENA_SUPPORT if (!keep) stopAttack(); +#endif } void LocalPlayer::stopAttack() @@ -872,7 +870,7 @@ int LocalPlayer::getAttackRange() const ItemInfo info = weapon->getInfo(); return info.getAttackRange(); } - return 32; // unarmed range + return 48; // unarmed range #else return mAttackRange; #endif diff --git a/src/main.cpp b/src/main.cpp index f15eeccc..7c48e728 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -126,6 +126,12 @@ #include <sys/stat.h> #endif +#ifdef TWMSERV_SUPPORT +#define DEFAULT_PORT 9601 +#else +#define DEFAULT_PORT 6901 +#endif + namespace { struct SetupListener : public gcn::ActionListener @@ -347,11 +353,7 @@ static void initConfiguration(const Options &options) std::string defaultHost = branding.getValue("defaultServer", "server.themanaworld.org"); config.setValue("host", defaultHost); -#ifdef TWMSERV_SUPPORT - int defaultPort = (int)branding.getValue("defaultPort", 9601); -#else - int defaultPort = (int)branding.getValue("defaultPort", 6901); -#endif + int defaultPort = (int)branding.getValue("defaultPort", DEFAULT_PORT); config.setValue("port", defaultPort); config.setValue("hwaccel", false); #if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL @@ -953,7 +955,7 @@ int main(int argc, char *argv[]) "server.themanaworld.org").c_str(); } if (options.serverPort == 0) { - loginData.port = (short) branding.getValue("defaultPort", 9601); + loginData.port = (short) branding.getValue("defaultPort", DEFAULT_PORT); } if (loginData.username.empty() && loginData.remember) { loginData.username = config.getValue("username", ""); diff --git a/src/net/tmwserv/protocol.h b/src/net/tmwserv/protocol.h index 0f2a1b0d..6124263a 100644 --- a/src/net/tmwserv/protocol.h +++ b/src/net/tmwserv/protocol.h @@ -162,9 +162,11 @@ enum { CPMSG_GUILD_QUIT_RESPONSE = 0x0361, // B error PCMSG_GUILD_PROMOTE_MEMBER = 0x0365, // W guild, S name, B rights CPMSG_GUILD_PROMOTE_MEMBER_RESPONSE = 0x0366, // B error + PCMSG_GUILD_KICK_MEMBER = 0x0370, // W guild, S name + CPMSG_GUILD_KICK_MEMBER_RESPONSE = 0x0371, // B error - CPMSG_GUILD_INVITED = 0x0370, // S char name, S guild name, W id - CPMSG_GUILD_REJOIN = 0x0371, // S name, W guild, W rights, W channel, S announce + CPMSG_GUILD_INVITED = 0x0388, // S char name, S guild name, W id + CPMSG_GUILD_REJOIN = 0x0389, // S name, W guild, W rights, W channel, S announce // Party PCMSG_PARTY_INVITE = 0x03A0, // S name diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 99907ca7..fa31c556 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -210,6 +210,10 @@ void ItemDB::load() } } + if (weaponType > 0) + if (attackRange == 0) + logger->log("ItemDB: Missing attack range from weapon %i!", id); + #define CHECK_PARAM(param, error_value) \ if (param == error_value) \ logger->log("ItemDB: Missing " #param " attribute for item %i!",id) |