summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-26 16:55:44 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-26 16:55:44 -0500
commitaf49b5366d35173702a2b3bd70ac4254b8855538 (patch)
tree66755c194016d7342a0540746c4faa597bc6bb5f /src
parentd5e3bc615b300eb985d59b91ebd1f2f1a4d4e107 (diff)
downloadtanetane-af49b5366d35173702a2b3bd70ac4254b8855538.tar.gz
tanetane-af49b5366d35173702a2b3bd70ac4254b8855538.tar.bz2
tanetane-af49b5366d35173702a2b3bd70ac4254b8855538.zip
Disabled crouching/running in the underwater map
Diffstat (limited to 'src')
-rw-r--r--src/character_system.cpp3
-rw-r--r--src/script_system.cpp3
-rw-r--r--src/sprite.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/src/character_system.cpp b/src/character_system.cpp index a24bdcc..87407af 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp
@@ -237,7 +237,8 @@ void CharacterSystem::beginCrouch(int spriteId) {
237 stopRunning(spriteId); 237 stopRunning(spriteId);
238 } else { 238 } else {
239 if (sprite.characterMedium == CharacterMedium::Ladder || 239 if (sprite.characterMedium == CharacterMedium::Ladder ||
240 sprite.characterMedium == CharacterMedium::Water) { 240 sprite.characterMedium == CharacterMedium::Water ||
241 sprite.cantCrouch) {
241 return; 242 return;
242 } 243 }
243 244
diff --git a/src/script_system.cpp b/src/script_system.cpp index 31b8bee..92e6afe 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp
@@ -39,7 +39,8 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) {
39 }, 39 },
40 "persistent", &Sprite::persistent, 40 "persistent", &Sprite::persistent,
41 "paused", &Sprite::paused, 41 "paused", &Sprite::paused,
42 "clipping", &Sprite::clipping); 42 "clipping", &Sprite::clipping,
43 "cantCrouch", &Sprite::cantCrouch);
43 44
44 engine_.new_usertype<MessageSystem>( 45 engine_.new_usertype<MessageSystem>(
45 "message", 46 "message",
diff --git a/src/sprite.h b/src/sprite.h index 32a082c..657a692 100644 --- a/src/sprite.h +++ b/src/sprite.h
@@ -91,6 +91,7 @@ public:
91 StepType stepType = StepType::none; 91 StepType stepType = StepType::none;
92 int runningSfxChannel = -1; 92 int runningSfxChannel = -1;
93 bool clipping = false; 93 bool clipping = false;
94 bool cantCrouch = false; // Use this to prevent running
94 95
95 // Input 96 // Input
96 bool controllable = false; 97 bool controllable = false;