Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Szepe <HG1_public@gmx.net>2015-10-11 16:41:40 +0300
committerThomas Szepe <HG1_public@gmx.net>2015-10-11 16:41:40 +0300
commit83721682bb12a5b3c277e832241e0752fdb2df2e (patch)
treed3c4b1d6dc4e9a22e98a68dfd2427acc6da41156 /source/gameengine/Ketsji
parent5295202c2ca3ae6a57a0af0ddbd637c220760826 (diff)
BGE: Change character jumping to char
* Change the character jumping variables and methods from int to char. * Limit the maxJumps integer value from 0 to 255. * Allow to set the minimum jump amount to 0. Reviewers: panzergame, lordloki, moguri Reviewed By: lordloki, moguri Subscribers: agoose77 Projects: #game_engine Differential Revision: https://developer.blender.org/D1305
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_CharacterWrapper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_CharacterWrapper.cpp b/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
index fdf4fa01b03..d777ae7ec80 100644
--- a/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_CharacterWrapper.cpp
@@ -25,6 +25,7 @@
#include "KX_CharacterWrapper.h"
#include "PHY_ICharacter.h"
#include "KX_PyMath.h"
+#include "BLI_utildefines.h"
KX_CharacterWrapper::KX_CharacterWrapper(PHY_ICharacter* character) :
PyObjectPlus(),
@@ -116,7 +117,9 @@ int KX_CharacterWrapper::pyattr_set_max_jumps(void *self_v, const KX_PYATTRIBUTE
return PY_SET_ATTR_FAIL;
}
- self->m_character->SetMaxJumps((int)param);
+ CLAMP(param, 0, 255);
+
+ self->m_character->SetMaxJumps((unsigned char)param);
return PY_SET_ATTR_SUCCESS;
}