From fd85e3c8f1229120a1b214e3579445f85d8be180 Mon Sep 17 00:00:00 2001 From: Sebastian Sek Date: Wed, 11 Jan 2017 20:36:02 +0100 Subject: [PATCH] Fixed swimming in soil, added missing material types --- .gitignore | 2 -- lib/SFML | 2 +- lib/bullet3 | 2 +- lib/glfw | 2 +- lib/glm | 2 +- src/content/Materials.h | 7 +++---- src/logic/PlayerController.cpp | 8 +++++++- src/target/REGoth.cpp | 10 +++++----- 8 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index b5026a72..d379e802 100644 --- a/.gitignore +++ b/.gitignore @@ -56,5 +56,3 @@ Data/ # CScope, Ctags cscope.files tags - - diff --git a/lib/SFML b/lib/SFML index 5eaa748a..746bb9c8 160000 --- a/lib/SFML +++ b/lib/SFML @@ -1 +1 @@ -Subproject commit 5eaa748adb2a57c6d3b4343cd35b497b2dd29958 +Subproject commit 746bb9c8cab04d44774ea1338c14f903cbaff3ae diff --git a/lib/bullet3 b/lib/bullet3 index 7c348e93..fb51c3f7 160000 --- a/lib/bullet3 +++ b/lib/bullet3 @@ -1 +1 @@ -Subproject commit 7c348e934d4d2037250f6fd5bed1b83128e1cd76 +Subproject commit fb51c3f7ed00ff0892e9ede44fda15633104d85d diff --git a/lib/glfw b/lib/glfw index f29c9630..0f488ac2 160000 --- a/lib/glfw +++ b/lib/glfw @@ -1 +1 @@ -Subproject commit f29c96303063e337d6cb01eb1139ac9ae4792890 +Subproject commit 0f488ac2865d766155344fb356acb40007421ec8 diff --git a/lib/glm b/lib/glm index c8ddeea7..06f08406 160000 --- a/lib/glm +++ b/lib/glm @@ -1 +1 @@ -Subproject commit c8ddeea744d6ea7fc3deda06bba0d1f0d2a31f6a +Subproject commit 06f084063fd6d9aa2ef6904517650700ae47b63d diff --git a/src/content/Materials.h b/src/content/Materials.h index 014282d1..b2109bc3 100755 --- a/src/content/Materials.h +++ b/src/content/Materials.h @@ -8,13 +8,12 @@ namespace Materials /** * Enums defining material group */ - // FIXME names below need to be changed most likely enum MaterialGroup { UNDEFINED, - PLACEHOLDER1, - PLACEHOLDER2, - PLACEHOLDER3, + METAL, + STONE, + WOOD, GROUND, WATER }; diff --git a/src/logic/PlayerController.cpp b/src/logic/PlayerController.cpp index 638a8c3b..e17b3d8a 100644 --- a/src/logic/PlayerController.cpp +++ b/src/logic/PlayerController.cpp @@ -829,10 +829,16 @@ void PlayerController::onUpdateByInput(float deltaTime) { model->setAnimation(waterAniType); } - else if (getSurfaceMaterial() == Materials::MaterialGroup::GROUND) + else if (getSurfaceMaterial() != Materials::MaterialGroup::UNDEFINED) { model->setAnimation(groundAniType); } + else + { + // This happens when NPC enters area that should not be accessible + LogError() << "Encountered undefined material type under NPC's feet"; + model->setAnimation(groundAniType); // Ground animation is the default, we don't want the NPCs to start swimming in soil + } lastMovementAni = getModelVisual()->getAnimationHandler().getActiveAnimationPtr()->getModelAniHeader().aniName; m_NoAniRootPosHack = true; }; diff --git a/src/target/REGoth.cpp b/src/target/REGoth.cpp index d7569fa7..eacfa45d 100755 --- a/src/target/REGoth.cpp +++ b/src/target/REGoth.cpp @@ -867,12 +867,12 @@ class ExampleCubes : public /*entry::AppI*/ PLATFORM_CLASS return true; } - Engine::GameEngine* m_pEngine; - uint32_t m_debug; - uint32_t m_reset; + Engine::GameEngine* m_pEngine; + uint32_t m_debug; + uint32_t m_reset; int m_Width, m_Height; - int64_t m_timeOffset; - float axis; + int64_t m_timeOffset; + float axis; int32_t m_scrollArea; Utils::StopWatch m_stopWatch; bool m_NoHUD;