mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 03:23:45 +01:00
Fix for empty key/value when reading item string with wear but no metadata (#6058)
This commit is contained in:
parent
a08a93bc9c
commit
46ff2e2cef
@ -28,16 +28,18 @@ void ItemStackMetadata::deSerialize(std::istream &is)
|
|||||||
|
|
||||||
m_stringvars.clear();
|
m_stringvars.clear();
|
||||||
|
|
||||||
if (!in.empty() && in[0] == DESERIALIZE_START) {
|
if (!in.empty()) {
|
||||||
Strfnd fnd(in);
|
if (in[0] == DESERIALIZE_START) {
|
||||||
fnd.to(1);
|
Strfnd fnd(in);
|
||||||
while (!fnd.at_end()) {
|
fnd.to(1);
|
||||||
std::string name = fnd.next(DESERIALIZE_KV_DELIM_STR);
|
while (!fnd.at_end()) {
|
||||||
std::string var = fnd.next(DESERIALIZE_PAIR_DELIM_STR);
|
std::string name = fnd.next(DESERIALIZE_KV_DELIM_STR);
|
||||||
m_stringvars[name] = var;
|
std::string var = fnd.next(DESERIALIZE_PAIR_DELIM_STR);
|
||||||
|
m_stringvars[name] = var;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// BACKWARDS COMPATIBILITY
|
||||||
|
m_stringvars[""] = in;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// BACKWARDS COMPATIBILITY
|
|
||||||
m_stringvars[""] = in;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user