### How to check belt slots in 1.4.22?

Posted:

**25 Dec 2017, 01:07**Edit: forget this post, got it sorted for now...

Hi,

So i found the nice easy to use functions in 1.5 to loop through the available belt slots.

So I wrote a little function for Fast Travel to calculate the additional weight for for artifacts and the backpack (which vanilla never did).

I actually use the above code in my PDA Backpack Travel addon.

How would I do the same sort of thing for CoC 1.4.22?

Any input welcome.

Hi,

So i found the nice easy to use functions in 1.5 to loop through the available belt slots.

So I wrote a little function for Fast Travel to calculate the additional weight for for artifacts and the backpack (which vanilla never did).

Code: Select all

`local function bbp_extra_weight()`

if not (string.find(GAME_VERSION,"1.5")) then return 0 end

local ini,x,itm,w = system_ini(),db.actor:belt_count() or 0,nil,0

for i = 0, x - 1, 1 do

itm = db.actor:item_on_belt(i)

w = w + (itm and ini:r_float_ex(itm:section(),"additional_inventory_weight") or 0)

end

itm = db.actor:item_in_slot(13)

return w + (itm and ini:r_float_ex(itm:section(),"additional_inventory_weight") or 0)

end

I actually use the above code in my PDA Backpack Travel addon.

How would I do the same sort of thing for CoC 1.4.22?

Any input welcome.