#include "util/strfnd.h"
#include "util/basic_macros.h"
-#define PLAYER_TO_SA(p) p->getEnv()->getScriptIface()
+#define PLAYER_TO_SA(p) p->getEnv()->getScriptIface()
/*
InventoryLocation
{
switch (type) {
case InventoryLocation::UNDEFINED:
- os << "undefined";
+ os<<"undefined";
break;
case InventoryLocation::CURRENT_PLAYER:
- os << "current_player";
+ os<<"current_player";
break;
case InventoryLocation::PLAYER:
- os << "player:" << name;
+ os<<"player:"<<name;
break;
case InventoryLocation::NODEMETA:
- os << "nodemeta:" << p.X << "," << p.Y << "," << p.Z;
+ os<<"nodemeta:"<<p.X<<","<<p.Y<<","<<p.Z;
break;
case InventoryLocation::DETACHED:
- os << "detached:" << name;
+ os<<"detached:"<<name;
break;
default:
FATAL_ERROR("Unhandled inventory location type");
type = InventoryLocation::DETACHED;
std::getline(is, name, '\n');
} else {
- infostream << "Unknown InventoryLocation type=\"" << tname << "\""
- << std::endl;
+ infostream<<"Unknown InventoryLocation type=\""<<tname<<"\""<<std::endl;
throw SerializationError("Unknown InventoryLocation type");
}
}
IMoveAction
*/
-IMoveAction::IMoveAction(std::istream &is, bool somewhere) : move_somewhere(somewhere)
+IMoveAction::IMoveAction(std::istream &is, bool somewhere) :
+ move_somewhere(somewhere)
{
std::string ts;
}
}
-void IMoveAction::apply(
- InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef)
+void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef)
{
Inventory *inv_from = mgr->getInventory(from_inv);
Inventory *inv_to = mgr->getInventory(to_inv);
if (!inv_from) {
infostream << "IMoveAction::apply(): FAIL: source inventory not found: "
- << "from_inv=\"" << from_inv.dump() << "\""
- << ", to_inv=\"" << to_inv.dump() << "\"" << std::endl;
+ << "from_inv=\""<<from_inv.dump() << "\""
+ << ", to_inv=\"" << to_inv.dump() << "\"" << std::endl;
return;
}
if (!inv_to) {
- infostream << "IMoveAction::apply(): FAIL: destination inventory not "
- "found: "
- << "from_inv=\"" << from_inv.dump() << "\""
- << ", to_inv=\"" << to_inv.dump() << "\"" << std::endl;
+ infostream << "IMoveAction::apply(): FAIL: destination inventory not found: "
+ << "from_inv=\"" << from_inv.dump() << "\""
+ << ", to_inv=\"" << to_inv.dump() << "\"" << std::endl;
return;
}
*/
if (!list_from) {
infostream << "IMoveAction::apply(): FAIL: source list not found: "
- << "from_inv=\"" << from_inv.dump() << "\""
- << ", from_list=\"" << from_list << "\"" << std::endl;
+ << "from_inv=\"" << from_inv.dump() << "\""
+ << ", from_list=\"" << from_list << "\"" << std::endl;
return;
}
if (!list_to) {
infostream << "IMoveAction::apply(): FAIL: destination list not found: "
- << "to_inv=\"" << to_inv.dump() << "\""
- << ", to_list=\"" << to_list << "\"" << std::endl;
+ << "to_inv=\""<<to_inv.dump() << "\""
+ << ", to_list=\"" << to_list << "\"" << std::endl;
return;
}
move_somewhere = false;
infostream << "IMoveAction::apply(): moving item somewhere"
- << " msom=" << move_somewhere << " count=" << count
- << " from inv=\"" << from_inv.dump() << "\""
- << " list=\"" << from_list << "\""
- << " i=" << from_i << " to inv=\"" << to_inv.dump() << "\""
- << " list=\"" << to_list << "\"" << std::endl;
+ << " msom=" << move_somewhere
+ << " count=" << count
+ << " from inv=\"" << from_inv.dump() << "\""
+ << " list=\"" << from_list << "\""
+ << " i=" << from_i
+ << " to inv=\"" << to_inv.dump() << "\""
+ << " list=\"" << to_list << "\""
+ << std::endl;
// Try to add the item to destination list
s16 dest_size = list_to->getSize();
}
if ((u16)to_i > list_to->getSize()) {
- infostream << "IMoveAction::apply(): FAIL: destination index out of "
- "bounds: "
- << "to_i=" << to_i << ", size=" << list_to->getSize()
- << std::endl;
+ infostream << "IMoveAction::apply(): FAIL: destination index out of bounds: "
+ << "to_i=" << to_i
+ << ", size=" << list_to->getSize() << std::endl;
return;
}
/*
Do not handle rollback if both inventories are that of the same player
*/
- bool ignore_rollback = (from_inv.type == InventoryLocation::PLAYER &&
- from_inv == to_inv);
+ bool ignore_rollback = (
+ from_inv.type == InventoryLocation::PLAYER &&
+ from_inv == to_inv);
/*
Collect information of endpoints
/* Query detached inventories */
// Move occurs in the same detached inventory
- if (from_inv.type == InventoryLocation::DETACHED && from_inv == to_inv) {
+ if (from_inv.type == InventoryLocation::DETACHED &&
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowMove(
- *this, try_take_count, player);
+ *this, try_take_count, player);
dst_can_put_count = src_can_take_count;
} else {
// Destination is detached
if (to_inv.type == InventoryLocation::DETACHED) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- dst_can_put_count =
- PLAYER_TO_SA(player)->detached_inventory_AllowPut(
- *this, src_item, player);
+ dst_can_put_count = PLAYER_TO_SA(player)->detached_inventory_AllowPut(
+ *this, src_item, player);
}
// Source is detached
if (from_inv.type == InventoryLocation::DETACHED) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- src_can_take_count =
- PLAYER_TO_SA(player)
- ->detached_inventory_AllowTake(
- *this, src_item,
- player);
+ src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowTake(
+ *this, src_item, player);
}
}
// Both endpoints are nodemeta
// Move occurs in the same nodemeta inventory
- if (from_inv.type == InventoryLocation::NODEMETA && from_inv == to_inv) {
+ if (from_inv.type == InventoryLocation::NODEMETA &&
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowMove(
- *this, try_take_count, player);
+ *this, try_take_count, player);
dst_can_put_count = src_can_take_count;
} else {
// Destination is nodemeta
if (to_inv.type == InventoryLocation::NODEMETA) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- dst_can_put_count =
- PLAYER_TO_SA(player)->nodemeta_inventory_AllowPut(
- *this, src_item, player);
+ dst_can_put_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowPut(
+ *this, src_item, player);
}
// Source is nodemeta
if (from_inv.type == InventoryLocation::NODEMETA) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- src_can_take_count =
- PLAYER_TO_SA(player)
- ->nodemeta_inventory_AllowTake(
- *this, src_item,
- player);
+ src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowTake(
+ *this, src_item, player);
}
}
// Query player inventories
// Move occurs in the same player inventory
- if (from_inv.type == InventoryLocation::PLAYER && from_inv == to_inv) {
+ if (from_inv.type == InventoryLocation::PLAYER &&
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowMove(
- *this, try_take_count, player);
+ *this, try_take_count, player);
dst_can_put_count = src_can_take_count;
} else {
// Destination is a player
if (to_inv.type == InventoryLocation::PLAYER) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- dst_can_put_count =
- PLAYER_TO_SA(player)->player_inventory_AllowPut(
- *this, src_item, player);
+ dst_can_put_count = PLAYER_TO_SA(player)->player_inventory_AllowPut(
+ *this, src_item, player);
}
// Source is a player
if (from_inv.type == InventoryLocation::PLAYER) {
ItemStack src_item = list_from->getItem(from_i);
src_item.count = try_take_count;
- src_can_take_count =
- PLAYER_TO_SA(player)->player_inventory_AllowTake(
- *this, src_item, player);
+ src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowTake(
+ *this, src_item, player);
}
}
if (to_inv.type == InventoryLocation::PLAYER)
list_to->setModified();
- infostream << "IMoveAction::apply(): move was completely disallowed:"
- << " count=" << old_count << " from inv=\"" << from_inv.dump()
- << "\""
- << " list=\"" << from_list << "\""
- << " i=" << from_i << " to inv=\"" << to_inv.dump() << "\""
- << " list=\"" << to_list << "\""
- << " i=" << to_i << std::endl;
+ infostream<<"IMoveAction::apply(): move was completely disallowed:"
+ <<" count="<<old_count
+ <<" from inv=\""<<from_inv.dump()<<"\""
+ <<" list=\""<<from_list<<"\""
+ <<" i="<<from_i
+ <<" to inv=\""<<to_inv.dump()<<"\""
+ <<" list=\""<<to_list<<"\""
+ <<" i="<<to_i
+ <<std::endl;
return;
}
same as source), nothing happens
*/
bool did_swap = false;
- move_count = list_from->moveItem(from_i, list_to, to_i, count,
- !caused_by_move_somewhere, &did_swap);
+ move_count = list_from->moveItem(from_i,
+ list_to, to_i, count, !caused_by_move_somewhere, &did_swap);
// If source is infinite, reset it's stack
if (src_can_take_count == -1) {
- // For the caused_by_move_somewhere == true case we didn't force-put the
- // item, which guarantees there is no leftover, and code below would
- // duplicate the (not replaced) to_stack_was item.
+ // For the caused_by_move_somewhere == true case we didn't force-put the item,
+ // which guarantees there is no leftover, and code below would duplicate the
+ // (not replaced) to_stack_was item.
if (!caused_by_move_somewhere) {
- // If destination stack is of different type and there are
- // leftover items, attempt to put the leftover items to a
- // different place in the destination inventory. The client-side
- // GUI will try to guess if this happens.
+ // If destination stack is of different type and there are leftover
+ // items, attempt to put the leftover items to a different place in the
+ // destination inventory.
+ // The client-side GUI will try to guess if this happens.
if (from_stack_was.name != to_stack_was.name) {
for (u32 i = 0; i < list_to->getSize(); i++) {
if (list_to->getItem(i).empty()) {
}
infostream << "IMoveAction::apply(): moved"
- << " msom=" << move_somewhere << " caused=" << caused_by_move_somewhere
- << " count=" << count << " from inv=\"" << from_inv.dump() << "\""
- << " list=\"" << from_list << "\""
- << " i=" << from_i << " to inv=\"" << to_inv.dump() << "\""
- << " list=\"" << to_list << "\""
- << " i=" << to_i << std::endl;
+ << " msom=" << move_somewhere
+ << " caused=" << caused_by_move_somewhere
+ << " count=" << count
+ << " from inv=\"" << from_inv.dump() << "\""
+ << " list=\"" << from_list << "\""
+ << " i=" << from_i
+ << " to inv=\"" << to_inv.dump() << "\""
+ << " list=\"" << to_list << "\""
+ << " i=" << to_i
+ << std::endl;
// If we are inside the move somewhere loop, we don't need to report
// anything if nothing happened (perhaps we don't need to report
from_inv.serialize(os);
loc = os.str();
}
- action.setModifyInventoryStack(
- loc, from_list, from_i, false, src_item);
+ action.setModifyInventoryStack(loc, from_list, from_i, false,
+ src_item);
rollback->reportAction(action);
}
// If destination is not infinite, record item put
to_inv.serialize(os);
loc = os.str();
}
- action.setModifyInventoryStack(
- loc, to_list, to_i, true, src_item);
+ action.setModifyInventoryStack(loc, to_list, to_i, true,
+ src_item);
rollback->reportAction(action);
}
}
/* Detached inventories */
// Both endpoints are same detached
- if (from_inv.type == InventoryLocation::DETACHED && from_inv == to_inv) {
- PLAYER_TO_SA(player)->detached_inventory_OnMove(*this, count, player);
+ if (from_inv.type == InventoryLocation::DETACHED &&
+ from_inv == to_inv) {
+ PLAYER_TO_SA(player)->detached_inventory_OnMove(
+ *this, count, player);
} else {
// Destination is detached
if (to_inv.type == InventoryLocation::DETACHED) {
PLAYER_TO_SA(player)->detached_inventory_OnPut(
- *this, src_item, player);
+ *this, src_item, player);
}
// Source is detached
if (from_inv.type == InventoryLocation::DETACHED) {
PLAYER_TO_SA(player)->detached_inventory_OnTake(
- *this, src_item, player);
+ *this, src_item, player);
}
}
/* Node metadata inventories */
// Both endpoints are same nodemeta
- if (from_inv.type == InventoryLocation::NODEMETA && from_inv == to_inv) {
- PLAYER_TO_SA(player)->nodemeta_inventory_OnMove(*this, count, player);
+ if (from_inv.type == InventoryLocation::NODEMETA &&
+ from_inv == to_inv) {
+ PLAYER_TO_SA(player)->nodemeta_inventory_OnMove(
+ *this, count, player);
} else {
// Destination is nodemeta
if (to_inv.type == InventoryLocation::NODEMETA) {
PLAYER_TO_SA(player)->nodemeta_inventory_OnPut(
- *this, src_item, player);
+ *this, src_item, player);
}
// Source is nodemeta
if (from_inv.type == InventoryLocation::NODEMETA) {
PLAYER_TO_SA(player)->nodemeta_inventory_OnTake(
- *this, src_item, player);
+ *this, src_item, player);
}
}
// Player inventories
// Both endpoints are same player inventory
- if (from_inv.type == InventoryLocation::PLAYER && from_inv == to_inv) {
- PLAYER_TO_SA(player)->player_inventory_OnMove(*this, count, player);
+ if (from_inv.type == InventoryLocation::PLAYER &&
+ from_inv == to_inv) {
+ PLAYER_TO_SA(player)->player_inventory_OnMove(
+ *this, count, player);
} else {
// Destination is player inventory
if (to_inv.type == InventoryLocation::PLAYER) {
PLAYER_TO_SA(player)->player_inventory_OnPut(
- *this, src_item, player);
+ *this, src_item, player);
}
// Source is player inventory
if (from_inv.type == InventoryLocation::PLAYER) {
PLAYER_TO_SA(player)->player_inventory_OnTake(
- *this, src_item, player);
+ *this, src_item, player);
}
}
from_i = stoi(ts);
}
-void IDropAction::apply(
- InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef)
+void IDropAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef)
{
Inventory *inv_from = mgr->getInventory(from_inv);
if (!inv_from) {
- infostream << "IDropAction::apply(): FAIL: source inventory not found: "
- << "from_inv=\"" << from_inv.dump() << "\"" << std::endl;
+ infostream<<"IDropAction::apply(): FAIL: source inventory not found: "
+ <<"from_inv=\""<<from_inv.dump()<<"\""<<std::endl;
return;
}
If a list doesn't exist or the source item doesn't exist
*/
if (!list_from) {
- infostream << "IDropAction::apply(): FAIL: source list not found: "
- << "from_inv=\"" << from_inv.dump() << "\"" << std::endl;
+ infostream<<"IDropAction::apply(): FAIL: source list not found: "
+ <<"from_inv=\""<<from_inv.dump()<<"\""<<std::endl;
return;
}
if (list_from->getItem(from_i).empty()) {
- infostream << "IDropAction::apply(): FAIL: source item not found: "
- << "from_inv=\"" << from_inv.dump() << "\""
- << ", from_list=\"" << from_list << "\""
- << " from_i=" << from_i << std::endl;
+ infostream<<"IDropAction::apply(): FAIL: source item not found: "
+ <<"from_inv=\""<<from_inv.dump()<<"\""
+ <<", from_list=\""<<from_list<<"\""
+ <<" from_i="<<from_i<<std::endl;
return;
}
switch (from_inv.type) {
case InventoryLocation::DETACHED:
src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowTake(
- *this, src_item, player);
+ *this, src_item, player);
break;
case InventoryLocation::NODEMETA:
src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowTake(
- *this, src_item, player);
+ *this, src_item, player);
break;
case InventoryLocation::PLAYER:
src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowTake(
- *this, src_item, player);
+ *this, src_item, player);
break;
default:
break;
// Drop the item
ItemStack item1 = list_from->getItem(from_i);
item1.count = take_count;
- if (PLAYER_TO_SA(player)->item_OnDrop(item1, player, player->getBasePosition())) {
+ if(PLAYER_TO_SA(player)->item_OnDrop(item1, player,
+ player->getBasePosition())) {
int actually_dropped_count = take_count - item1.count;
if (actually_dropped_count == 0) {
- infostream << "Actually dropped no items" << std::endl;
+ infostream<<"Actually dropped no items"<<std::endl;
// Revert client prediction. See 'clientApply'
if (from_inv.type == InventoryLocation::PLAYER)
// If source isn't infinite
if (src_can_take_count != -1) {
// Take item from source list
- ItemStack item2 = list_from->takeItem(
- from_i, actually_dropped_count);
+ ItemStack item2 = list_from->takeItem(from_i, actually_dropped_count);
if (item2.count != actually_dropped_count)
- errorstream << "Could not take dropped count of items"
- << std::endl;
+ errorstream<<"Could not take dropped count of items"<<std::endl;
}
src_item.count = actually_dropped_count;
mgr->setInventoryModified(from_inv);
}
- infostream << "IDropAction::apply(): dropped "
- << " from inv=\"" << from_inv.dump() << "\""
- << " list=\"" << from_list << "\""
- << " i=" << from_i << std::endl;
+ infostream<<"IDropAction::apply(): dropped "
+ <<" from inv=\""<<from_inv.dump()<<"\""
+ <<" list=\""<<from_list<<"\""
+ <<" i="<<from_i
+ <<std::endl;
+
/*
Report drop to endpoints
switch (from_inv.type) {
case InventoryLocation::DETACHED:
- PLAYER_TO_SA(player)->detached_inventory_OnTake(*this, src_item, player);
+ PLAYER_TO_SA(player)->detached_inventory_OnTake(
+ *this, src_item, player);
break;
case InventoryLocation::NODEMETA:
- PLAYER_TO_SA(player)->nodemeta_inventory_OnTake(*this, src_item, player);
+ PLAYER_TO_SA(player)->nodemeta_inventory_OnTake(
+ *this, src_item, player);
break;
case InventoryLocation::PLAYER:
- PLAYER_TO_SA(player)->player_inventory_OnTake(*this, src_item, player);
+ PLAYER_TO_SA(player)->player_inventory_OnTake(
+ *this, src_item, player);
break;
default:
break;
from_inv.serialize(os);
loc = os.str();
}
- action.setModifyInventoryStack(
- loc, from_list, from_i, false, src_item);
+ action.setModifyInventoryStack(loc, from_list, from_i,
+ false, src_item);
rollback->reportAction(action);
}
}
craft_inv.deSerialize(ts);
}
-void ICraftAction::apply(
- InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef)
+void ICraftAction::apply(InventoryManager *mgr,
+ ServerActiveObject *player, IGameDef *gamedef)
{
Inventory *inv_craft = mgr->getInventory(craft_inv);
if (!inv_craft) {
infostream << "ICraftAction::apply(): FAIL: inventory not found: "
- << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
+ << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
return;
}
*/
if (!list_craft) {
infostream << "ICraftAction::apply(): FAIL: craft list not found: "
- << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
+ << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
return;
}
if (!list_craftresult) {
infostream << "ICraftAction::apply(): FAIL: craftresult list not found: "
- << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
+ << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
return;
}
if (list_craftresult->getSize() < 1) {
infostream << "ICraftAction::apply(): FAIL: craftresult list too short: "
- << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
+ << "craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
return;
}
std::vector<ItemStack> temp;
// Decrement input and add crafting output
getCraftingResult(inv_craft, crafted, temp, true, gamedef);
- PLAYER_TO_SA(player)->item_OnCraft(
- crafted, player, &saved_craft_list, craft_inv);
+ PLAYER_TO_SA(player)->item_OnCraft(crafted, player, &saved_craft_list, craft_inv);
list_craftresult->addItem(0, crafted);
mgr->setInventoryModified(craft_inv);
for (auto &itemstack : temp) {
for (auto &output_replacement : output_replacements) {
if (itemstack.name == output_replacement.name) {
- itemstack = output_replacement.addItem(
- itemstack, itemdef);
+ itemstack = output_replacement.addItem(itemstack, itemdef);
if (itemstack.empty())
continue;
}
output_replacements.push_back(itemstack);
}
- actionstream << player->getDescription() << " crafts "
- << crafted.getItemString() << std::endl;
+ actionstream << player->getDescription()
+ << " crafts "
+ << crafted.getItemString()
+ << std::endl;
// Decrement counter
if (count_remaining == 1)
// Get next crafting result
getCraftingResult(inv_craft, crafted, temp, false, gamedef);
- PLAYER_TO_SA(player)->item_CraftPredict(
- crafted, player, list_craft, craft_inv);
+ PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv);
found = !crafted.empty();
}
u16 count = output_replacement.count;
do {
PLAYER_TO_SA(player)->item_OnDrop(output_replacement, player,
- player->getBasePosition());
+ player->getBasePosition());
if (count >= output_replacement.count) {
- errorstream << "Couldn't drop replacement stack "
- << output_replacement.getItemString()
- << " because drop loop didn't "
- "decrease count."
- << std::endl;
+ errorstream << "Couldn't drop replacement stack " <<
+ output_replacement.getItemString() << " because drop loop didn't "
+ "decrease count." << std::endl;
break;
}
} while (!output_replacement.empty());
}
- infostream << "ICraftAction::apply(): crafted "
- << " craft_inv=\"" << craft_inv.dump() << "\"" << std::endl;
+ infostream<<"ICraftAction::apply(): crafted "
+ <<" craft_inv=\""<<craft_inv.dump()<<"\""
+ <<std::endl;
}
void ICraftAction::clientApply(InventoryManager *mgr, IGameDef *gamedef)
// to make lag less apparent.
}
+
// Crafting helper
bool getCraftingResult(Inventory *inv, ItemStack &result,
- std::vector<ItemStack> &output_replacements, bool decrementInput,
- IGameDef *gamedef)
+ std::vector<ItemStack> &output_replacements,
+ bool decrementInput, IGameDef *gamedef)
{
result.clear();
CraftInput ci;
ci.method = CRAFT_METHOD_NORMAL;
ci.width = clist->getWidth() ? clist->getWidth() : 3;
- for (u16 i = 0; i < clist->getSize(); i++)
+ for (u16 i=0; i < clist->getSize(); i++)
ci.items.push_back(clist->getItem(i));
// Find out what is crafted and add it to result item slot
if (found && decrementInput) {
// CraftInput has been changed, apply changes in clist
- for (u16 i = 0; i < clist->getSize(); i++) {
+ for (u16 i=0; i < clist->getSize(); i++) {
clist->changeItem(i, ci.items[i]);
}
}
return found;
}
+