From 263eba782bb292d2fad6a6b71e11096e0ebbd45b Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Thu, 20 Feb 2014 10:04:38 +0100 Subject: [PATCH 1/3] Found unmarked debug hack Naughty collegues --- Code/Game/GameClient/GameClientState/MainState.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Game/GameClient/GameClientState/MainState.cpp b/Code/Game/GameClient/GameClientState/MainState.cpp index f34b9ad6..5b96b385 100644 --- a/Code/Game/GameClient/GameClientState/MainState.cpp +++ b/Code/Game/GameClient/GameClientState/MainState.cpp @@ -79,9 +79,10 @@ GameClientState::ClientState MainState::Update( float deltaTime ) { bool test = this->privData->input->IsMousePressed(); if(test) - { + { // HACK: debug trap still in use? int i = 0; }; + this->privData->input->GetMousePos( mouseState.x, mouseState.y ); mouseState.mouseButtonPressed = this->privData->input->IsMousePressed(); } From dd397ec7521f77d1a7a4cd8468f90d00725dc491 Mon Sep 17 00:00:00 2001 From: lindaandersson Date: Thu, 20 Feb 2014 10:13:01 +0100 Subject: [PATCH 2/3] GameClient set onMoveFunc for all objects --- Code/Game/GameLogic/Object.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp index 1f43263b..22273b7e 100644 --- a/Code/Game/GameLogic/Object.cpp +++ b/Code/Game/GameLogic/Object.cpp @@ -30,6 +30,7 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfte this->objectID = objectID; this->extraDamageOnCollision = 0; this->rigidBody->SetCustomTag(this); + this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc); } @@ -41,6 +42,7 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICusto this->objectID = objectID; this->extraDamageOnCollision = 0; this->rigidBody->SetCustomTag(this); + this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc); } Object::~Object(void) From e6cd1f1e5f376196c4233aa62c28ef3e01bcdf2f Mon Sep 17 00:00:00 2001 From: lindaandersson Date: Thu, 20 Feb 2014 10:33:27 +0100 Subject: [PATCH 3/3] GameClient now objects say to client that they have moved! --- Code/Game/GameLogic/Level.cpp | 1 + Code/Game/GameLogic/Object.cpp | 2 -- Code/Game/GameLogic/Player.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 9febbe47..c9938dbd 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -300,6 +300,7 @@ bool Level::InitiateLevel(std::wstring levelPath) Object* dynamicGameObj = CreateGameObj(dynamicObjData, rigidBody_Dynamic); if (dynamicGameObj != NULL) { + dynamicGameObj->GetRigidBody()->SetSubscription(Level::PhysicsOnMoveLevel); this->dynamicObjects.Push((DynamicObject*)dynamicGameObj); } } diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp index 22273b7e..1f43263b 100644 --- a/Code/Game/GameLogic/Object.cpp +++ b/Code/Game/GameLogic/Object.cpp @@ -30,7 +30,6 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfte this->objectID = objectID; this->extraDamageOnCollision = 0; this->rigidBody->SetCustomTag(this); - this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc); } @@ -42,7 +41,6 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICusto this->objectID = objectID; this->extraDamageOnCollision = 0; this->rigidBody->SetCustomTag(this); - this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc); } Object::~Object(void) diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 77953d43..848c528a 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -127,7 +127,7 @@ void Player::BeginFrame() } - if (key_forward <= 0.001 && key_backward <= 0.001 && key_strafeRight <= 0.001 && key_strafeLeft <= 0.001 && key_jump <= 0.001 ) //&& this->rigidBody->GetLambda() < 0.7f) + if (key_forward <= 0.001 && key_backward <= 0.001 && key_strafeRight <= 0.001 && key_strafeLeft <= 0.001 && key_jump <= 0.001 && this->rigidBody->GetLambda() < 0.7f) { /* Dampen when on the ground and not being moved by the player */ linearVelocity *= 0.2f;