From af49b5366d35173702a2b3bd70ac4254b8855538 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 26 Feb 2021 16:55:44 -0500 Subject: Disabled crouching/running in the underwater map --- src/character_system.cpp | 3 ++- src/script_system.cpp | 3 ++- src/sprite.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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) { stopRunning(spriteId); } else { if (sprite.characterMedium == CharacterMedium::Ladder || - sprite.characterMedium == CharacterMedium::Water) { + sprite.characterMedium == CharacterMedium::Water || + sprite.cantCrouch) { return; } 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) { }, "persistent", &Sprite::persistent, "paused", &Sprite::paused, - "clipping", &Sprite::clipping); + "clipping", &Sprite::clipping, + "cantCrouch", &Sprite::cantCrouch); engine_.new_usertype( "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: StepType stepType = StepType::none; int runningSfxChannel = -1; bool clipping = false; + bool cantCrouch = false; // Use this to prevent running // Input bool controllable = false; -- cgit 1.4.1