summaryrefslogtreecommitdiff
path: root/src/net/ea/playerhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-08 01:00:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-08 01:02:48 +0300
commit29187a2582c04e3ede63f9c58f09dbbe34834a30 (patch)
tree93b77c0ad573af9c6d52a6932e76f6c223e2c8f3 /src/net/ea/playerhandler.cpp
parentaf98cb5dea5644e0d95a5bf41c03655e4ab808ef (diff)
downloadmv-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.gz
mv-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.bz2
mv-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.xz
mv-29187a2582c04e3ede63f9c58f09dbbe34834a30.zip
Add checks and fix code style.
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r--src/net/ea/playerhandler.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 3af237b5b..81e520415 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -70,7 +70,8 @@ namespace
{
void action(const gcn::ActionEvent &event A_UNUSED)
{
- Net::getPlayerHandler()->respawn();
+ if (Net::getPlayerHandler())
+ Net::getPlayerHandler()->respawn();
deathNotice = NULL;
Client::closeDialogs();
@@ -326,13 +327,11 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
case 0x0018:
if (!weightNotice)
{
- const int max
- = PlayerInfo::getAttribute(MAX_WEIGHT) / 2;
- const int total
- = PlayerInfo::getAttribute(TOTAL_WEIGHT);
+ const int max = PlayerInfo::getAttribute(MAX_WEIGHT) / 2;
+ const int total = PlayerInfo::getAttribute(TOTAL_WEIGHT);
if (value >= max && total < max)
{
- weightNoticeTime = cur_time + 10;
+ weightNoticeTime = cur_time + 5;
weightNotice = new OkDialog(_("Message"),
_("You are carrying more than "
"half your weight. You are "
@@ -342,7 +341,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg)
}
else if (value < max && total >= max)
{
- weightNoticeTime = cur_time + 10;
+ weightNoticeTime = cur_time + 5;
weightNotice = new OkDialog(_("Message"),
_("You are carrying less than "
"half your weight. You "