Skip to content

Commit

Permalink
Fixed swimming in soil, added missing material types
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderJax committed Jan 11, 2017
1 parent 572aba2 commit fd85e3c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ Data/
# CScope, Ctags
cscope.files
tags


2 changes: 1 addition & 1 deletion lib/SFML
2 changes: 1 addition & 1 deletion lib/glm
Submodule glm updated 264 files
7 changes: 3 additions & 4 deletions src/content/Materials.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
8 changes: 7 additions & 1 deletion src/logic/PlayerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
10 changes: 5 additions & 5 deletions src/target/REGoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd85e3c

Please sign in to comment.