Улучшение определения. Теперь можно определять и первые слова предложений.
This commit is contained in:
parent
9cf08dff23
commit
556eeca7a4
10
engine.lua
10
engine.lua
|
@ -143,14 +143,18 @@ end
|
||||||
|
|
||||||
function is_activated(previous, current, room)
|
function is_activated(previous, current, room)
|
||||||
for i,v in ipairs(room.obj) do
|
for i,v in ipairs(room.obj) do
|
||||||
if v ~= nil then
|
|
||||||
for j,word in ipairs(v.obj) do
|
for j,word in ipairs(v.obj) do
|
||||||
if (word ~= nil) then
|
if (word._word ~= nil) then
|
||||||
|
if (previous ~= nil) then
|
||||||
if (word._word == previous) then
|
if (word._word == previous) then
|
||||||
if (v.obj[j+2]._word == current) then --следующее слово _после пробела_
|
if (v.obj[j+2]._word == current) then --следующее слово _после пробела_
|
||||||
return v.obj[j+2]._enabled;
|
return v.obj[j+2]._enabled
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if (word._word == current) then
|
||||||
|
return word._enabled
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue