diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-04-28 11:52:08 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-05-02 21:45:54 +0200 |
commit | 0261eb73e5588f5732aef5df753311d488c45d06 (patch) | |
tree | d641b0cad81ea58b8d8680b002197a4f592ef4a9 /src/scripting/luascript.cpp | |
parent | 23ccc8080a5283adce9f06909fc89b63d0e25452 (diff) | |
download | manaserv-0261eb73e5588f5732aef5df753311d488c45d06.tar.gz manaserv-0261eb73e5588f5732aef5df753311d488c45d06.tar.bz2 manaserv-0261eb73e5588f5732aef5df753311d488c45d06.tar.xz manaserv-0261eb73e5588f5732aef5df753311d488c45d06.zip |
Fixed a bunch of cppcheck warnings
Diffstat (limited to 'src/scripting/luascript.cpp')
-rw-r--r-- | src/scripting/luascript.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index 2b9644da..1617f74c 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -101,14 +101,12 @@ void LuaScript::push(const std::list<InventoryItem> &itemList) lua_createtable(mCurrentState, itemList.size(), 0); int itemTable = lua_gettop(mCurrentState); - for (std::list<InventoryItem>::const_iterator i = itemList.begin(); - i != itemList.end(); - i++) + for (const InventoryItem &inventoryItem : itemList) { // create the item structure std::map<std::string, int> item; - item["id"] = i->itemId; - item["amount"] = i->amount; + item["id"] = inventoryItem.itemId; + item["amount"] = inventoryItem.amount; pushSTLContainer<std::string, int>(mCurrentState, item); lua_rawseti(mCurrentState, itemTable, ++position); } |