Camera centering and client drop message

This commit is contained in:
Kayne Ruse
2014-12-19 20:33:09 +11:00
parent 44a1edac30
commit 900f623f3b
3 changed files with 11 additions and 2 deletions
+7 -1
View File
@@ -145,6 +145,12 @@ void InWorld::Update() {
it.second.Update();
}
//update the camera
if (localCharacter) {
camera.x = localCharacter->GetOrigin().x - camera.marginX;
camera.y = localCharacter->GetOrigin().y - camera.marginY;
}
//check the connection (heartbeat)
if (Clock::now() - lastBeat > std::chrono::seconds(3)) {
if (attemptedBeats > 2) {
@@ -355,7 +361,7 @@ void InWorld::HandleLogoutResponse(ClientPacket* const argPacket) {
characterIndex = -1;
//reset the camera
camera.x = camera .y = 0;
camera.x = camera.y = 0;
camera.marginX = camera.marginY = 0;
SendDisconnectRequest();