Subversion Repositories eoserv

Compare Revisions

Ignore whitespace Rev 478 → Rev 479

/trunk/admin.ini
116,7 → 116,7
evacuate = 3
 
# Reloads a changed map
# $remap
# $remap [id]
remap = 4
 
# Forces an arena launch on the current map
/trunk/src/commands/server.cpp
25,16 → 25,37
 
void ReloadMap(const std::vector<std::string>& arguments, Character* from)
{
(void)arguments;
World* world = from->SourceWorld();
Map* map = from->map;
bool isnew = false;
 
if (!(from->map->Reload()))
if (arguments.size() >= 1)
{
while (!from->map->characters.empty())
int mapid = util::to_int(arguments[0]);
 
if (mapid < 1)
mapid = 1;
 
if (world->maps.size() > mapid - 1)
{
from->map->characters.back()->player->client->Close();
from->map->characters.pop_back();
map = world->maps[mapid - 1];
}
else if (mapid <= static_cast<int>(world->config["Maps"]))
{
isnew = true;
 
while (world->maps.size() < mapid)
{
int newmapid = world->maps.size() + 1;
world->maps.push_back(new Map(newmapid, world));
}
}
}
 
if (map && !isnew)
{
map->Reload();
}
}
 
void ReloadPub(const std::vector<std::string>& arguments, Command_Source* from)
/trunk/src/map.cpp
2433,8 → 2433,6
 
this->characters = temp;
 
std::fclose(fh);
 
UTIL_FOREACH(temp, character)
{
character->player->client->Upload(FILE_MAP, character->mapid, INIT_MAP_MUTATION);
/trunk/src/world.cpp
415,7 → 415,7
 
}
}
Console::Out("%i quests loaded.", this->quests.size());
Console::Out("%i/%i quests loaded.", this->quests.size(), max_quest);
 
this->last_character_id = 0;
 
943,17 → 943,42
c->quests.clear();
}
 
// Reload quests
UTIL_IFOREACH(this->quests, it)
// Reload all quests
short max_quest = 0;
 
UTIL_FOREACH(this->enf->data, npc)
{
if (npc.type == ENF::Quest)
max_quest = std::max(max_quest, npc.vendor_id);
}
 
for (short i = 0; i <= max_quest; ++i)
{
try
{
std::shared_ptr<Quest> q = std::make_shared<Quest>(it->first, this);
std::swap(it->second, q);
std::shared_ptr<Quest> q = std::make_shared<Quest>(i, this);
this->quests.insert(std::make_pair(i, std::move(q)));
}
catch (...)
{
this->quests.erase(i);
}
}
 
// Reload quests that might still be loaded above the highest quest npc ID
UTIL_IFOREACH(this->quests, it)
{
if (it->first > max_quest)
{
try
{
std::shared_ptr<Quest> q = std::make_shared<Quest>(it->first, this);
std::swap(it->second, q);
}
catch (...)
{
it = this->quests.erase(it);
}
}
}
 
997,7 → 1022,7
c->CheckQuestRules();
}
 
Console::Out("%i quests loaded.", this->quests.size());
Console::Out("%i/%i quests loaded.", this->quests.size(), max_quest);
}
 
Character *World::GetCharacter(std::string name)