From 86ea20df7baaa52151bc28069452b5d665734ae7 Mon Sep 17 00:00:00 2001 From: Matei Date: Wed, 16 Jul 2008 04:23:44 +0000 Subject: [PATCH] Fix a crash which happened when a unit with no actions.move tried to run (it got past the JS guard because JS code crashed). This was SVN commit r6237. --- binaries/data/mods/official/scripts/entity_functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/official/scripts/entity_functions.js b/binaries/data/mods/official/scripts/entity_functions.js index dc087ce535..88ee66a42c 100644 --- a/binaries/data/mods/official/scripts/entity_functions.js +++ b/binaries/data/mods/official/scripts/entity_functions.js @@ -1301,7 +1301,7 @@ function entityEventPrepareOrder( evt ) break; case ORDER_RUN: - if ( !this.actions.move.run ) + if ( !this.actions.move || !this.actions.move.run ) { evt.preventDefault(); return; @@ -2299,4 +2299,4 @@ function updateMessageView() } getGUIObjectByName("globalMessage").caption = result; getGUIObjectByName("globalMessageUnder").caption = result; -} \ No newline at end of file +}