1
0
Fork 0
mirror of https://gitlab.com/Oreolek/duel.git synced 2024-06-30 13:55:10 +03:00

Исправление проблемы #6: инвентарь

This commit is contained in:
Alexander Yakovlev 2017-03-31 16:52:28 +07:00
parent 06ca5a1392
commit c0b9fd76d7
2 changed files with 10 additions and 5 deletions

View file

@ -347,7 +347,7 @@ dlg {
obj { obj {
nam = 'car'; nam = 'car';
disp = 'автомобиль'; disp = 'ключи от автомобиля';
dsc = 'Недалеко от вас припаркован ваш {автомобиль.}'; dsc = 'Недалеко от вас припаркован ваш {автомобиль.}';
tak = function() tak = function()
char.quests.car = 5 char.quests.car = 5

View file

@ -219,11 +219,16 @@ fairadd = function(value, add)
end end
-- TODO: глючное перечисление инвентаря. Пропускает вещи. -- TODO: глючное перечисление инвентаря. Пропускает вещи.
listinv = function() listinv = function()
local inv = pl:inventory()
local out = '' local out = ''
for k, v in std.ipairs(inv) do local comma = false
if not std.is_obj(v) or v:disabled() or v:closed() then for k, v in std.ipairs(inv()) do
out = out .. ', ' .. v.disp if v.disp and not v:disabled() then
if comma then
out = out .. ', '
else
comma = true
end
out = out .. v.disp
end end
end end
if out == '' then if out == '' then