Fix build for server

coverity_scan^2
David Cernat 8 years ago
parent fa9d6e810e
commit 7be86388db

@ -69,12 +69,12 @@ void Networking::ProcessPlayerPacket(RakNet::Packet *packet)
return; return;
} }
if (*player->GetPassw() != passw) if (*player->getPassw() != passw)
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong server password for player %d, name: %s (pass: %s)", LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong server password for player %d, name: %s (pass: %s)",
player->GetID(), player->GetID(),
player->Npc()->mName.c_str(), player->Npc()->mName.c_str(),
player->GetPassw()->c_str()); player->getPassw()->c_str());
KickPlayer(player->guid); KickPlayer(player->guid);
return; return;
} }
@ -239,26 +239,26 @@ void Networking::ProcessPlayerPacket(RakNet::Packet *packet)
{ {
myPacket->Read(player); myPacket->Read(player);
Player *target = Players::GetPlayer(player->GetAttack()->target); Player *target = Players::GetPlayer(player->getAttack()->target);
if (target == nullptr) if (target == nullptr)
target = player; target = player;
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Player: %s attacked %s state: %d", player->Npc()->mName.c_str(), LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Player: %s attacked %s state: %d", player->Npc()->mName.c_str(),
target->Npc()->mName.c_str(), player->GetAttack()->pressed == 1); target->Npc()->mName.c_str(), player->getAttack()->pressed == 1);
if (player->GetAttack()->pressed == 0) if (player->getAttack()->pressed == 0)
{ {
LOG_APPEND(Log::LOG_VERBOSE, "success: %d", player->GetAttack()->success == 1); LOG_APPEND(Log::LOG_VERBOSE, "success: %d", player->getAttack()->success == 1);
if (player->GetAttack()->success == 1) if (player->getAttack()->success == 1)
{ {
LOG_APPEND(Log::LOG_VERBOSE, "damage: %d", player->GetAttack()->damage == 1); LOG_APPEND(Log::LOG_VERBOSE, "damage: %d", player->getAttack()->damage == 1);
target->setLastAttackerId(player->GetID()); target->setLastAttackerId(player->GetID());
target->setLastAttackerTime(std::chrono::steady_clock::now()); target->setLastAttackerTime(std::chrono::steady_clock::now());
} }
} }
myPacket->Send(player, true); myPacket->Send(player, true);
playerController->GetPacket(ID_GAME_DYNAMICSTATS)->RequestData(player->GetAttack()->target); playerController->GetPacket(ID_GAME_DYNAMICSTATS)->RequestData(player->getAttack()->target);
} }
break; break;
} }

Loading…
Cancel
Save