From 556eeca7a47eea3c1e1a90c6b9010aa191bdb03f Mon Sep 17 00:00:00 2001 From: Oreolek Date: Mon, 28 Nov 2011 18:47:03 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8F=D1=82=D1=8C=20=D0=B8=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D1=8B=D0=B5=20=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/engine.lua b/engine.lua index 0b8279a..7cc61d3 100644 --- a/engine.lua +++ b/engine.lua @@ -143,16 +143,20 @@ end function is_activated(previous, current, room) for i,v in ipairs(room.obj) do - if v ~= nil then for j,word in ipairs(v.obj) do - if (word ~= nil) then - if (word._word == previous) then - if (v.obj[j+2]._word == current) then --следующее слово _после пробела_ - return v.obj[j+2]._enabled; + if (word._word ~= nil) then + if (previous ~= nil) then + if (word._word == previous) then + if (v.obj[j+2]._word == current) then --следующее слово _после пробела_ + return v.obj[j+2]._enabled + end + end + else + if (word._word == current) then + return word._enabled end end end end - end end end \ No newline at end of file