//添加物品
function AddItemBag (cu: TClientItem): Boolean;
var
i: integer;
begin
if cu.S.NeedLevel>65536 then
cu.S.NeedLevel:=HiWord(cu.S.NeedLevel);
if cu.S.DuraMax>65536 then
cu.S.DuraMax:=HiWord(cu.S.DuraMax);
Result := FALSE;
//检查要添加的物品是否已经存在
for i:=0 to MAXBAGITEMCL-1 do begin
if (g_ItemArr.MakeIndex = cu.MakeIndex) and (g_ItemArr.S.Name = cu.S.Name) then begin
exit;
end;
end;
if cu.S.Name = '' then exit;
if cu.S.StdMode <= 3 then begin //可以使用的物品,首先放在快捷物品栏
for i:=0 to 5 do
if g_ItemArr.S.Name = '' then begin //找一个空档放下
g_ItemArr := cu;
Result := TRUE;
exit;
end;
end;
for i:=6 to MAXBAGITEMCL-1 do begin
if g_ItemArr.S.Name = '' then begin
g_ItemArr := cu;
Result := TRUE;
break;
end;
end;
ArrangeItembag;
end;