diff options
| author | fisted <van.fisted@googlemail.com> | 2011-01-18 06:50:24 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-01-20 00:15:18 +0100 |
| commit | 372b62566b15bbcf79e3320d6daf751e04b7e501 (patch) | |
| tree | d1123b210f1cd36014d6c1c9e3f742415e012434 | |
| parent | 17012416369663cdd5bdeead537faede3b8b308d (diff) | |
| download | zcatch-372b62566b15bbcf79e3320d6daf751e04b7e501.tar.gz zcatch-372b62566b15bbcf79e3320d6daf751e04b7e501.zip | |
fixed tower bug
| -rw-r--r-- | scripts/cmd5.py | 2 | ||||
| -rw-r--r-- | src/game/gamecore.cpp | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/scripts/cmd5.py b/scripts/cmd5.py index 6ab65160..3a8848bb 100644 --- a/scripts/cmd5.py +++ b/scripts/cmd5.py @@ -31,6 +31,6 @@ for filename in sys.argv[1:]: hash = hashlib.md5(f).hexdigest().lower()[16:] # TODO: refactor hash that is equal to the 0.5 hash, remove when we # TODO: remove when we don't need it any more -if hash == "026b8eceb4cdd369": +if hash == "f16c2456fc487748": hash = "b67d1f1a1eea234e" print('#define GAME_NETVERSION_HASH "%s"' % hash) diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index c3c29537..629b32e8 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -320,13 +320,15 @@ void CCharacterCore::Tick(bool UseInput) if(d < PhysSize*1.25f && d > 1.0f) { float a = (PhysSize*1.45f - d); - + float v = 0.5f; + // make sure that we don't add excess force by checking the - // direction against the current velocity - vec2 VelDir = normalize(m_Vel); - float v = 1-(dot(VelDir, Dir)+1)/2; - m_Vel = m_Vel + Dir*a*(v*0.75f); - m_Vel = m_Vel * 0.85f; + // direction against the current velocity. if not zero. + if (length(m_Vel) > 0.0001) + v = 1-(dot(normalize(m_Vel), Dir)+1)/2; + + m_Vel += Dir*a*(v*0.75f); + m_Vel *= 0.85f; } // handle hook influence |