Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -123,14 +123,14 @@ public:
|
||||
|
||||
void putBoolean(const wstring &name, bool val)
|
||||
{
|
||||
putByte(name, val?static_cast<byte>(1):0);
|
||||
putByte(name, val?(byte)1:0);
|
||||
}
|
||||
|
||||
Tag *get(const wstring &name)
|
||||
{
|
||||
auto it = tags.find(name);
|
||||
if(it != tags.end()) return it->second;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool contains(const wstring &name)
|
||||
@@ -141,19 +141,19 @@ public:
|
||||
byte getByte(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (byte)0;
|
||||
return static_cast<ByteTag *>(tags[name])->data;
|
||||
return ((ByteTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
short getShort(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (short)0;
|
||||
return static_cast<ShortTag *>(tags[name])->data;
|
||||
return ((ShortTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
int getInt(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (int)0;
|
||||
return static_cast<IntTag *>(tags[name])->data;
|
||||
return ((IntTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
int64_t getLong(const wstring &name)
|
||||
@@ -164,44 +164,44 @@ public:
|
||||
|
||||
float getFloat(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return static_cast<float>(0);
|
||||
return static_cast<FloatTag *>(tags[name])->data;
|
||||
if (tags.find(name) == tags.end()) return (float)0;
|
||||
return ((FloatTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
double getDouble(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return (double)0;
|
||||
return static_cast<DoubleTag *>(tags[name])->data;
|
||||
return ((DoubleTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
wstring getString(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return wstring( L"" );
|
||||
return static_cast<StringTag *>(tags[name])->data;
|
||||
return ((StringTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
byteArray getByteArray(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return byteArray();
|
||||
return static_cast<ByteArrayTag *>(tags[name])->data;
|
||||
return ((ByteArrayTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
intArray getIntArray(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return intArray();
|
||||
return static_cast<IntArrayTag *>(tags[name])->data;
|
||||
return ((IntArrayTag *) tags[name])->data;
|
||||
}
|
||||
|
||||
CompoundTag *getCompound(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return new CompoundTag(name);
|
||||
return static_cast<CompoundTag *>(tags[name]);
|
||||
return (CompoundTag *) tags[name];
|
||||
}
|
||||
|
||||
ListTag<Tag> *getList(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return new ListTag<Tag>(name);
|
||||
return static_cast<ListTag<Tag> *>(tags[name]);
|
||||
return (ListTag<Tag> *) tags[name];
|
||||
}
|
||||
|
||||
bool getBoolean(const wstring &string)
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
{
|
||||
if (Tag::equals(obj))
|
||||
{
|
||||
CompoundTag *o = static_cast<CompoundTag *>(obj);
|
||||
CompoundTag *o = (CompoundTag *) obj;
|
||||
|
||||
if(tags.size() == o->tags.size())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user