From 29187a2582c04e3ede63f9c58f09dbbe34834a30 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Oct 2011 01:00:52 +0300 Subject: Add checks and fix code style. --- src/net/ea/playerhandler.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/net/ea/playerhandler.cpp') 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 " -- cgit v1.2.3-70-g09d2