Улучшение определения. Теперь можно определять и первые слова предложений.

This commit is contained in:
Alexander Yakovlev 2011-11-28 18:47:03 +07:00
parent 9cf08dff23
commit 556eeca7a4

View file

@ -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