Skip to content

Commit 78a2402

Browse files
committed
disable rumble, log/abort on missing animations
1 parent 5dd97d4 commit 78a2402

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

include/engine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class InputState final
360360
mGamePadButtons[event.button].mRawDownState = (event.type == SDL_CONTROLLERBUTTONDOWN);
361361
if (mGamePadButtons[event.button].mRawDownState)
362362
{
363-
Rumble(1.0f);
363+
//Rumble(1.0f);
364364
}
365365
}
366366

src/gridmap.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ void Player::Init(ResourceLocator& locator)
131131
{
132132
for (const auto& anim : kAbeAnims)
133133
{
134-
mAnims.insert(std::make_pair(anim, locator.LocateAnimation(anim)));
134+
auto pAnim = locator.LocateAnimation(anim);
135+
if (!pAnim)
136+
{
137+
LOG_ERROR("Animation: " << anim << " not found");
138+
abort();
139+
}
140+
mAnims.insert(std::make_pair(anim, std::move(pAnim)));
135141
}
136142

137143
LoadScript(locator);
@@ -183,8 +189,8 @@ void Player::SetAnimation(const std::string& animation)
183189
{
184190
if (mAnims.find(animation) == std::end(mAnims))
185191
{
186-
LOG_ERROR("Animation " << animation << " is not preloaded");
187-
return;
192+
LOG_ERROR("Animation " << animation << " is not preloaded - attempting to load");
193+
abort();
188194
}
189195
mAnim = mAnims[animation].get();
190196
mAnim->Restart();

0 commit comments

Comments
 (0)