This commit is contained in:
s1lent 2019-06-05 20:30:00 +07:00
parent 247e93b4ff
commit 5d2b1ac703
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C

View File

@ -84,7 +84,7 @@ void PlaceDirectory::Save(int fd)
_write(fd, &count, sizeof(EntryType)); _write(fd, &count, sizeof(EntryType));
// store entries // store entries
for (auto id : m_directory) for (auto &id : m_directory)
{ {
auto placeName = TheBotPhrases->IDToName(id); auto placeName = TheBotPhrases->IDToName(id);
@ -161,7 +161,7 @@ void CNavArea::Save(int fd, unsigned int version)
size_t count = m_connect[d].size(); size_t count = m_connect[d].size();
_write(fd, &count, sizeof(size_t)); _write(fd, &count, sizeof(size_t));
for (auto connect : m_connect[d]) { for (auto &connect : m_connect[d]) {
_write(fd, &connect.area->m_id, sizeof(unsigned int)); _write(fd, &connect.area->m_id, sizeof(unsigned int));
} }
} }
@ -236,7 +236,7 @@ void CNavArea::Save(int fd, unsigned int version)
if (cv_bot_debug.value > 0.0f) if (cv_bot_debug.value > 0.0f)
CONSOLE_ECHO(" m_spotEncounterList.size() = %d\n", count); CONSOLE_ECHO(" m_spotEncounterList.size() = %d\n", count);
for (auto spote : m_spotEncounterList) for (auto &spote : m_spotEncounterList)
{ {
if (spote.from.area) if (spote.from.area)
_write(fd, &spote.from.area->m_id, sizeof(unsigned int)); _write(fd, &spote.from.area->m_id, sizeof(unsigned int));
@ -268,7 +268,7 @@ void CNavArea::Save(int fd, unsigned int version)
_write(fd, &spotCount, sizeof(unsigned char)); _write(fd, &spotCount, sizeof(unsigned char));
saveCount = 0; saveCount = 0;
for (auto order : spote.spotList) for (auto &order : spote.spotList)
{ {
// order->spot may be NULL if we've loaded a nav mesh that has been edited but not re-analyzed // order->spot may be NULL if we've loaded a nav mesh that has been edited but not re-analyzed
unsigned int id = (order.spot) ? order.spot->GetID() : 0; unsigned int id = (order.spot) ? order.spot->GetID() : 0;