mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-01 13:20:29 +00:00
Merge remote-tracking branch 'lazydev/master'
This commit is contained in:
commit
fa880e3274
@ -19,7 +19,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
virtual size_t getSize() const = 0;
|
virtual size_t getSize() const = 0;
|
||||||
virtual void load(ESM::ESMReader &esm, const std::string &id) = 0;
|
virtual void load(ESM::ESMReader &esm, const std::string &id) = 0;
|
||||||
|
|
||||||
virtual bool eraseStatic(const std::string &id) {return false;}
|
virtual bool eraseStatic(const std::string &id) {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ namespace MWWorld
|
|||||||
item.mId = Misc::StringUtils::lowerCase(id);
|
item.mId = Misc::StringUtils::lowerCase(id);
|
||||||
|
|
||||||
typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId);
|
typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId);
|
||||||
|
|
||||||
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
||||||
return &(it->second);
|
return &(it->second);
|
||||||
}
|
}
|
||||||
@ -188,14 +188,14 @@ namespace MWWorld
|
|||||||
item.mId = Misc::StringUtils::lowerCase(id);
|
item.mId = Misc::StringUtils::lowerCase(id);
|
||||||
|
|
||||||
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
|
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
|
||||||
|
|
||||||
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
|
||||||
mStatic.erase(it);
|
mStatic.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool erase(const std::string &id) {
|
bool erase(const std::string &id) {
|
||||||
std::string key = Misc::StringUtils::lowerCase(id);
|
std::string key = Misc::StringUtils::lowerCase(id);
|
||||||
typename Dynamic::iterator it = mDynamic.find(key);
|
typename Dynamic::iterator it = mDynamic.find(key);
|
||||||
@ -220,9 +220,15 @@ namespace MWWorld
|
|||||||
template <>
|
template <>
|
||||||
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
|
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
|
||||||
std::string idLower = Misc::StringUtils::lowerCase(id);
|
std::string idLower = Misc::StringUtils::lowerCase(id);
|
||||||
mStatic[idLower] = ESM::Dialogue();
|
|
||||||
mStatic[idLower].mId = id; // don't smash case here, as this line is printed... I think
|
std::map<std::string, ESM::Dialogue>::iterator it = mStatic.find(idLower);
|
||||||
mStatic[idLower].load(esm);
|
if (it == mStatic.end()) {
|
||||||
|
it = mStatic.insert( std::make_pair( idLower, ESM::Dialogue() ) ).first;
|
||||||
|
it->second.mId = id; // don't smash case here, as this line is printed... I think
|
||||||
|
}
|
||||||
|
|
||||||
|
//I am not sure is it need to load the dialog from a plugin if it was already loaded from prevois plugins
|
||||||
|
it->second.load(esm);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
@ -409,7 +415,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
DynamicInt mDynamicInt;
|
DynamicInt mDynamicInt;
|
||||||
DynamicExt mDynamicExt;
|
DynamicExt mDynamicExt;
|
||||||
|
|
||||||
const ESM::Cell *search(const ESM::Cell &cell) const {
|
const ESM::Cell *search(const ESM::Cell &cell) const {
|
||||||
if (cell.isExterior()) {
|
if (cell.isExterior()) {
|
||||||
return search(cell.getGridX(), cell.getGridY());
|
return search(cell.getGridX(), cell.getGridY());
|
||||||
@ -481,7 +487,7 @@ namespace MWWorld
|
|||||||
newCell->mData.mY = y;
|
newCell->mData.mY = y;
|
||||||
mExt[std::make_pair(x, y)] = *newCell;
|
mExt[std::make_pair(x, y)] = *newCell;
|
||||||
delete newCell;
|
delete newCell;
|
||||||
|
|
||||||
return &mExt[std::make_pair(x, y)];
|
return &mExt[std::make_pair(x, y)];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +534,7 @@ namespace MWWorld
|
|||||||
// There some nasty three-way cyclic header dependency involved, which I could only fix by moving
|
// There some nasty three-way cyclic header dependency involved, which I could only fix by moving
|
||||||
// this method.
|
// this method.
|
||||||
void load(ESM::ESMReader &esm, const std::string &id);
|
void load(ESM::ESMReader &esm, const std::string &id);
|
||||||
|
|
||||||
iterator intBegin() const {
|
iterator intBegin() const {
|
||||||
return iterator(mSharedInt.begin());
|
return iterator(mSharedInt.begin());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user