Subversion Repositories eoserv

Compare Revisions

Ignore whitespace Rev 369 → Rev 370

/trunk/src/map.cpp
46,7 → 46,7
{
bool needs_update = false;
 
std::vector<std::list<std::reference_wrapper<const Map_Chest_Spawn>>> spawns;
std::vector<std::list<Map_Chest_Spawn>> spawns;
spawns.resize(chest->slots);
 
UTIL_CFOREACH(chest->spawns, spawn)
53,7 → 53,20
{
if (spawn.last_taken + spawn.time*60.0 < current_time)
{
spawns[spawn.slot - 1].emplace_back(spawn);
bool slot_used = false;
 
UTIL_CFOREACH(chest->items, item)
{
if (item.slot == spawn.slot)
{
slot_used = true;
}
}
 
if (!slot_used)
{
spawns[spawn.slot - 1].emplace_back(spawn);
}
}
}
 
/trunk/src/util.hpp
52,7 → 52,7
 
#define UTIL_FOREACH_GENERIC(begin, end, as) \
for (util::foreach_helper<decltype((begin)), decltype((end))> _util_fe_{(begin), (end), 1}; _util_fe_.clause(); _util_fe_.act()) \
for (auto as = *_util_fe_.it; !_util_fe_.cont; _util_fe_.cont = 1)
for (auto& as = *_util_fe_.it; !_util_fe_.cont; _util_fe_.cont = 1)
 
#define UTIL_FOREACH(c, as) UTIL_FOREACH_GENERIC(util::begin((c)), util::end((c)), as)
#define UTIL_CFOREACH(c, as) UTIL_FOREACH_GENERIC(util::cbegin((c)),util::cend((c)), as)