From 189cf77cab0d2850c636d926fb1cce44196b1444 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Thu, 22 Oct 2015 12:24:04 -0600 Subject: [PATCH] Changed PlayCommandNoRecurse to check whether the command is nil before running it, so that a command metric set to a nil function isn't an error. Removed TextBannerHighScores::AfterSetCommand metric from _fallback because it pointed to a function that does not exist. --- Themes/_fallback/metrics.ini | 1 - src/Actor.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index c412c0d0a5..cbe5a4e44b 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1509,7 +1509,6 @@ AfterSetCommand=%TextBannerAfterSet [TextBannerHighScores] Fallback="TextBanner" -AfterSetCommand=%TextBannerHighScoreAfterSet [WheelNotifyIcon] diff --git a/src/Actor.cpp b/src/Actor.cpp index a778ae4f4f..1173ea82c8 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -1465,8 +1465,10 @@ void Actor::HandleMessage( const Message &msg ) void Actor::PlayCommandNoRecurse( const Message &msg ) { const apActorCommands *pCmd = GetCommand( msg.GetName() ); - if( pCmd != NULL ) + if(pCmd != NULL && (*pCmd)->IsSet() && !(*pCmd)->IsNil()) + { RunCommands( *pCmd, &msg.GetParamTable() ); + } } void Actor::PushContext( lua_State *L )