mob/verb/grabLoot()
for (var/k=1,k<=8,k++)
//find free inventory slot or abort proc
if (freeInventory()!=0)
var/freeSlot = freeInventory()
//transfer loot item to player inventory & set loot list slot to null
src.loot[k].locale="inventory"
src.equipment[freeSlot] = src.loot[k]
src.loot[k]=null
//send message to player if inventory is full & abort proc
else if (freeInventory()==0)
src<<"SYSTEM: Inventory is full."
return
Problem description:
In the code above, I am looping through a loot list ("src.loot") and transferring the objects in the loot list to the player's inventory list ("src.equipment"). Upon transferring the object, I want to reset a custom object variable called "locale", but when I try to call the variable from inside the loop ("src.loot[k].locale") I get an expected end of statement error because of the second period. Is there a way to directly call this custom variable for the object from inside the loop without having to pass another variable to the verb? In this case, src is the player (a mob), and the custom variable I'm trying to change belongs to an obj in the player's loot list.